[gnome-shell] Bug 573413 – libmozjs linking broken on Ubuntu



commit d7a23b7e31d151b50f23a0586b2e1622222629ae
Author: Dan Winship <danw gnome org>
Date:   Fri Feb 27 11:14:11 2009 -0500

    Bug 573413 â?? libmozjs linking broken on Ubuntu
    
    Patch gnome-shell.in to work around Ubuntu xulrunner bug in the same
    way our .jhbuildrc does
---
 src/gnome-shell.in |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/src/gnome-shell.in b/src/gnome-shell.in
index 5a1cac6..2e452d4 100755
--- a/src/gnome-shell.in
+++ b/src/gnome-shell.in
@@ -114,13 +114,25 @@ def start_shell():
     js_dir = os.path.join(top_dir, "js")
     data_dir = os.path.join(top_dir, "data")
 
+    # Work around Ubuntu xulrunner bug,
+    # http://bugzilla.gnome.org/show_bug.cgi?id=573413
+    mozjs_ld_library_path = ''
+    pkgconfig = subprocess.Popen(['pkg-config', '--variable=sdkdir', 'mozilla-js'],
+                                 stdout=subprocess.PIPE)
+    mozjs_sdkdir = pkgconfig.communicate()[0].strip()
+    pkgconfig.wait()
+    if pkgconfig.returncode == 0:
+        mozjs_libdir = re.sub('-(sdk|devel)', '', mozjs_sdkdir)
+        if os.path.exists(mozjs_libdir + '/libmozjs.so'):
+            mozjs_ld_library_path = ':' + mozjs_libdir
+
     # Set up environment
     env = dict(os.environ)
     env.update({'GNOME_SHELL_JS'      : '@GJS_JS_DIR@:@GJS_JS_NATIVE_DIR@:' + js_dir,
                 'GNOME_SHELL_DATADIR' : data_dir,
                 'GI_TYPELIB_PATH'     : plugin_dir,
                 'PATH'                : '@META_BIN_DIR@:' + os.environ.get('PATH', '') + ':' + plugin_dir,
-                'LD_LIBRARY_PATH'     : os.environ.get('LD_LIBRARY_PATH', '') + ':' + plugin_dir,
+                'LD_LIBRARY_PATH'     : os.environ.get('LD_LIBRARY_PATH', '') + ':' + plugin_dir + mozjs_ld_library_path,
                 'GNOME_DISABLE_CRASH_DIALOG' : '1'})
 
     if not options.verbose:



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