make gnome-shell runnable from an install

This commit is contained in:
Dan Winship 2009-03-11 09:59:02 -04:00
parent e01efd3635
commit 8087e6aee6
4 changed files with 41 additions and 24 deletions

View File

@ -76,5 +76,4 @@ AC_OUTPUT([
js/Makefile
js/ui/Makefile
src/Makefile
src/gnome-shell
])

View File

@ -11,7 +11,7 @@ gnomeshell_taskpanel_SOURCES = \
shell-panel-window.c \
shell-panel-window.h \
$(NULL)
gnomeshell_taskpanel_LDADD = $(TASKPANEL_LIBS)
bin_PROGRAMS += gnomeshell-taskpanel
libexec_PROGRAMS += gnomeshell-taskpanel

View File

@ -2,9 +2,22 @@ NULL =
BUILT_SOURCES =
CLEANFILES =
EXTRA_DIST =
bin_PROGRAMS =
libexec_PROGRAMS =
noinst_LTLIBRARIES =
bin_SCRIPTS = gnome-shell
gnome-shell: gnome-shell.in
sed -e "s|@META_BIN_DIR[@]|$(META_BIN_DIR)|" \
-e "s|@GJS_JS_DIR[@]|$(GJS_JS_DIR)|" \
-e "s|@GJS_JS_NATIVE_DIR[@]|$(GJS_JS_NATIVE_DIR)|" \
-e "s|@libexecdir[@]|$(libexecdir)|" \
-e "s|@libdir[@]|$(libdir)|" \
-e "s|@pkgdatadir[@]|$(pkgdatadir)|" \
$< > $@ && chmod a+x $@
CLEANFILES += gnome-shell
EXTRA_DIST += gnome-shell.in
include Makefile-tidy.am
include Makefile-big.am
include Makefile-gdmuser.am
@ -147,6 +160,3 @@ CLEANFILES += Big-1.0.gir
Big-1.0.typelib: libbig-1.0.la Big-1.0.gir
LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. g-ir-compiler Big-1.0.gir -o $@
CLEANFILES += Big-1.0.typelib
all-local:
chmod a+x gnome-shell

View File

@ -107,16 +107,33 @@ def _get_glx_extensions():
return (server_glx_extensions, client_glx_extensions, glx_extensions)
def start_shell():
# Figure out the path to the plugin when uninstalled
src_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
top_dir = os.path.dirname(src_dir)
plugin_dir = os.path.join(top_dir, "src")
js_dir = os.path.join(top_dir, "js")
data_dir = os.path.join(top_dir, "data")
bin_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
if os.path.exists(os.path.join(bin_dir, 'gnome-shell.in')):
running_from_source_tree = True
top_dir = os.path.dirname(bin_dir)
plugin_dir = os.path.join(top_dir, "src")
typelib_dir = os.path.join(top_dir, "src")
taskpanel_dir = 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')
plugin_dir = '@libdir@/metacity/plugins/clutter'
taskpanel_dir = '@libexecdir@'
# Set up environment
env = dict(os.environ)
env.update({'GNOME_SHELL_JS' : '@GJS_JS_DIR@:@GJS_JS_NATIVE_DIR@:' + js_dir,
'PATH' : '@META_BIN_DIR@:' + os.environ.get('PATH', '') + ':' + taskpanel_dir,
'GNOME_DISABLE_CRASH_DIALOG' : '1'})
if running_from_source_tree:
env.update({'GNOME_SHELL_DATADIR' : data_dir,
'GI_TYPELIB_PATH' : typelib_dir})
# 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()
@ -124,16 +141,7 @@ def start_shell():
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 + mozjs_ld_library_path,
'GNOME_DISABLE_CRASH_DIALOG' : '1'})
env['LD_LIBRARY_PATH'] = os.environ.get('LD_LIBRARY_PATH', '') + ':' + mozjs_libdir
if not options.verbose:
# Unless verbose() is specified, only let gjs show errors and