[glib] Introduce the UNINSTALLED_GLIB_SRCDIR environment variable



commit cd0cd950785515d826abbe55d6b5948c411e1490
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Tue Aug 23 16:38:36 2011 +0100

    Introduce the UNINSTALLED_GLIB_SRCDIR environment variable
    
    This makes it possible to avoid setting PYTHONPATH in
    Makefile.am files.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=650763

 gio/gdbus-2.0/codegen/gdbus-codegen.in             |   13 +++++++++----
 gio/tests/Makefile.am                              |    4 ++--
 gio/tests/gdbus-object-manager-example/Makefile.am |    4 ++--
 3 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/gio/gdbus-2.0/codegen/gdbus-codegen.in b/gio/gdbus-2.0/codegen/gdbus-codegen.in
old mode 100755
new mode 100644
index 36a2148..aaffd5d
--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in
+++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in
@@ -25,9 +25,14 @@
 import os
 import sys
 
-path = os.path.join('@libdir@', 'gdbus-2.0', 'codegen')
-sys.path.insert(0, path)
+srcdir = os.getenv('UNINSTALLED_GLIB_SRCDIR', None)
 
-from codegen_main import codegen_main
+if srcdir is not None:
+    path = os.path.join(srcdir, 'gio', 'gdbus-2.0')
+else:
+    path = os.path.join('@libdir@', 'gdbus-2.0')
 
-sys.exit(codegen_main())
+sys.path.insert(0, os.path.abspath(path))
+from codegen import codegen_main
+
+sys.exit(codegen_main.codegen_main())
diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
index 1eb2985..fd820dc 100644
--- a/gio/tests/Makefile.am
+++ b/gio/tests/Makefile.am
@@ -260,8 +260,8 @@ gdbus_bz627724_LDADD = $(progs_ldadd)
 
 if OS_UNIX
 gdbus-test-codegen-generated.h gdbus-test-codegen-generated.c : test-codegen.xml
-	$(AM_V_GEN) UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
-		PYTHONPATH=$(top_srcdir)/gio/gdbus-2.0 \
+	$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+		UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
 		$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
 		--interface-prefix org.project. \
 		--generate-c-code gdbus-test-codegen-generated \
diff --git a/gio/tests/gdbus-object-manager-example/Makefile.am b/gio/tests/gdbus-object-manager-example/Makefile.am
index 292c0c4..5e6eb9a 100644
--- a/gio/tests/gdbus-object-manager-example/Makefile.am
+++ b/gio/tests/gdbus-object-manager-example/Makefile.am
@@ -22,8 +22,8 @@ GDBUS_GENERATED = 										\
 	$(NULL)
 
 $(GDBUS_GENERATED) : gdbus-example-objectmanager.xml
-	$(AM_V_GEN) UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
-		PYTHONPATH=$(top_srcdir)/gio/gdbus-2.0 \
+	$(AM_V_GEN) UNINSTALLED_GLIB_SRCDIR=$(top_srcdir) \
+		UNINSTALLED_GLIB_BUILDDIR=$(top_builddir) \
 		$(PYTHON) $(top_builddir)/gio/gdbus-2.0/codegen/gdbus-codegen \
 		--interface-prefix org.gtk.GDBus.Example.ObjectManager. \
 		--c-namespace Example \



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]