[gnome-shell] gnome-shell-jhbuild: Adjust GI_TYPELIB_PATH for NM inclusion



commit cab9a580e8f3b370bd69f6706de1d3f6da1ee147
Author: Dan Winship <danw gnome org>
Date:   Wed Mar 16 09:40:25 2011 -0400

    gnome-shell-jhbuild: Adjust GI_TYPELIB_PATH for NM inclusion
    
    When jhbuilding, we use a jhbuilt gobject-introspection, so the
    default typelib path is the jhbuild prefix, not /usr. So if we are
    using NetworkManager from packages, we need to adjust GI_TYPELIB_PATH
    to include it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=621707

 configure.ac               |    8 ++++++++
 src/Makefile.am            |    1 +
 src/gnome-shell-jhbuild.in |   10 ++++++----
 3 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 3ecdfed..0d5581d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,6 +98,14 @@ AC_DEFINE_UNQUOTED([GJS_VERSION], ["$GJS_VERSION"], [The version of GJS we're li
 AC_SUBST([GJS_VERSION], ["$GJS_VERSION"])
 
 GOBJECT_INTROSPECTION_CHECK([$GOBJECT_INTROSPECTION_MIN_VERSION])
+JHBUILD_TYPELIBDIR="$INTROSPECTION_TYPELIBDIR"
+# NM is the only typelib we use that we don't jhbuild
+PKG_CHECK_EXISTS([libnm-glib >= 0.8.995],
+        [NM_TYPELIBDIR=`$PKG_CONFIG --variable=libdir libnm-glib`/girepository-1.0
+	 if test "$INTROSPECTION_TYPELIBDIR" != "$NM_TYPELIBDIR"; then
+	     JHBUILD_TYPELIBDIR="$JHBUILD_TYPELIBDIR:$NM_TYPELIBDIR"
+	 fi])
+AC_SUBST(JHBUILD_TYPELIBDIR)
 
 saved_CFLAGS=$CFLAGS
 saved_LIBS=$LIBS
diff --git a/src/Makefile.am b/src/Makefile.am
index e878f20..7fcd3e8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -38,6 +38,7 @@ generated_script_substitutions = \
 	    -e "s|@datadir[ ]|$(datadir)|" \
 	    -e "s|@libexecdir[ ]|$(libexecdir)|" \
 	    -e "s|@libdir[ ]|$(libdir)|" \
+	    -e "s|@JHBUILD_TYPELIBDIR[ ]|$(JHBUILD_TYPELIBDIR)|" \
 	    -e "s|@pkgdatadir[ ]|$(pkgdatadir)|" \
 	    -e "s|@PYTHON[ ]|$(PYTHON)|" \
 	    -e "s|@VERSION[ ]|$(VERSION)|" \
diff --git a/src/gnome-shell-jhbuild.in b/src/gnome-shell-jhbuild.in
index 1cc4ef4..924e9b3 100755
--- a/src/gnome-shell-jhbuild.in
+++ b/src/gnome-shell-jhbuild.in
@@ -197,12 +197,16 @@ def start_shell(perf_output=None):
     if os.path.exists(os.path.join(self_dir, 'gnome-shell-jhbuild.in')):
         running_from_source_tree = True
         top_dir = os.path.dirname(self_dir)
-        typelib_dir = os.path.join(top_dir, "src")
+        typelib_dir = '@JHBUILD_TYPELIBDIR@:' + os.path.join(top_dir, "src")
         js_dir = os.path.join(top_dir, "js")
         data_dir = os.path.join(top_dir, "data")
     else:
         running_from_source_tree = False
         js_dir = os.path.join('@pkgdatadir@', 'js')
+        typelib_dir = '@JHBUILD_TYPELIBDIR@'
+
+    if os.environ.has_key('GI_TYPELIB_PATH'):
+        typelib_dir = typelib_dir + ":" + os.environ.get('GI_TYPELIB_PATH')
 
     # Set up environment
     env = dict(os.environ)
@@ -215,14 +219,12 @@ def start_shell(perf_output=None):
     # run".  See bug #642084
     env.update({'GNOME_SHELL_JS'      : js_dir,
                 'PATH'                : '@bindir@:' + os.environ.get('PATH', ''),
+                'GI_TYPELIB_PATH'     : typelib_dir,
                 'XDG_CONFIG_DIRS'     : '@sysconfdir@/xdg:' + (os.environ.get('XDG_CONFIG_DIRS') or '/etc/xdg'),
                 'XDG_DATA_DIRS'       : '@datadir@:' + (os.environ.get('XDG_DATA_DIRS') or '/usr/local/share:/usr/share')})
     if running_from_source_tree:
-        if os.environ.has_key('GI_TYPELIB_PATH'):
-            typelib_dir = typelib_dir + ":" + os.environ.get('GI_TYPELIB_PATH')
         env.update({'GNOME_SHELL_BINDIR'   : self_dir,
                     'GNOME_SHELL_DATADIR'  : data_dir,
-                    'GI_TYPELIB_PATH'      : typelib_dir,
                     'GSETTINGS_SCHEMA_DIR' : data_dir })
     else:
         # This is just broken to set in the installed case; see bug #642084



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