From 4800f63c3a622c2f7c67bb2d166641d4c604cc5e Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Sat, 20 Nov 2010 13:01:43 -0500 Subject: [PATCH] Correct and simplify setting the GJS module path We were going to great effort to include the normal directories in the GJS search path and the code to to do this broke recently when jsdir and jsnativedir were moved to gjs-internals-1.0.pc. However, it was actually unnecessary since the standard directories are appended to the default path. (We continue to use a GNOME_SHELL_JS envvar separate from GJS_PATH for the Shell to enable the somewhat unlikely case where someone wants to invoke the shell specifying a GJS_PATH.) https://bugzilla.gnome.org/show_bug.cgi?id=635367 --- configure.ac | 4 ---- src/Makefile.am | 2 -- src/gnome-shell.in | 2 +- tests/Makefile.am | 2 -- tests/run-test.sh.in | 10 +++------- 5 files changed, 4 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index a02faf584..519d02825 100644 --- a/configure.ac +++ b/configure.ac @@ -103,11 +103,7 @@ AC_SUBST(MUTTER_BIN_DIR) AC_SUBST(MUTTER_LIB_DIR) AC_SUBST(MUTTER_PLUGIN_DIR) -GJS_JS_DIR=`$PKG_CONFIG --variable=jsdir gjs-1.0` -GJS_JS_NATIVE_DIR=`$PKG_CONFIG --variable=jsnativedir gjs-1.0` GJS_CONSOLE=`$PKG_CONFIG --variable=gjs_console gjs-1.0` -AC_SUBST(GJS_JS_DIR) -AC_SUBST(GJS_JS_NATIVE_DIR) AC_SUBST(GJS_CONSOLE) AC_CHECK_FUNCS(fdwalk) diff --git a/src/Makefile.am b/src/Makefile.am index 05b1dedd1..ee42b33b9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -13,8 +13,6 @@ bin_SCRIPTS = gnome-shell gnome-shell-clock-preferences gnome-shell: gnome-shell.in $(AM_V_GEN) sed -e "s|@MUTTER_BIN_DIR[@]|$(MUTTER_BIN_DIR)|" \ -e "s|@datadir[@]|$(datadir)|" \ - -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)|" \ diff --git a/src/gnome-shell.in b/src/gnome-shell.in index c855c0180..2abd7d5cc 100755 --- a/src/gnome-shell.in +++ b/src/gnome-shell.in @@ -220,7 +220,7 @@ def start_shell(perf_output=None): # Set up environment env = dict(os.environ) - env.update({'GNOME_SHELL_JS' : '@GJS_JS_DIR@:@GJS_JS_NATIVE_DIR@:' + js_dir, + env.update({'GNOME_SHELL_JS' : js_dir, 'PATH' : '@MUTTER_BIN_DIR@:' + os.environ.get('PATH', ''), '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'), diff --git a/tests/Makefile.am b/tests/Makefile.am index 42a92a3a1..4c6b92188 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,8 +24,6 @@ EXTRA_DIST += $(TEST_MISC) run-test.sh: run-test.sh.in $(AM_V_GEN) sed \ - -e "s|@GJS_JS_DIR[@]|$(GJS_JS_DIR)|" \ - -e "s|@GJS_JS_NATIVE_DIR[@]|$(GJS_JS_NATIVE_DIR)|" \ -e "s|@MUTTER_LIB_DIR[@]|$(MUTTER_LIB_DIR)|" \ -e "s|@srcdir[@]|$(srcdir)|" \ $< > $@ && chmod a+x $@ diff --git a/tests/run-test.sh.in b/tests/run-test.sh.in index af905cbc8..300ca2baf 100644 --- a/tests/run-test.sh.in +++ b/tests/run-test.sh.in @@ -31,17 +31,13 @@ srcdir=$builddir/@srcdir@ srcdir=`cd $srcdir && pwd` GI_TYPELIB_PATH="@MUTTER_LIB_DIR@/mutter:$builddir/../src" +GJS_PATH="$srcdir:$srcdir/../js" GJS_DEBUG_OUTPUT=stderr $verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG" GNOME_SHELL_TESTSDIR="$srcdir/" -export GI_TYPELIB_PATH GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS GNOME_SHELL_JS GNOME_SHELL_TESTSDIR LD_PRELOAD - -run_js_test_args= -for i in $srcdir $srcdir/../js @GJS_JS_DIR@ @GJS_JS_NATIVE_DIR@ ; do - run_js_test_args="$run_js_test_args -I $i" -done +export GI_TYPELIB_PATH GJS_PATH GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS GNOME_SHELL_JS GNOME_SHELL_TESTSDIR LD_PRELOAD for test in $tests ; do - $debug $builddir/../src/run-js-test $run_js_test_args $test || exit $? + $debug $builddir/../src/run-js-test $test || exit $? done