From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qn13u-0005Ah-Vw for garchives@archives.gentoo.org; Sat, 30 Jul 2011 04:22:07 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7F05E21C05B; Sat, 30 Jul 2011 04:21:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1E40E21C05B for ; Sat, 30 Jul 2011 04:21:56 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 23F331BC013 for ; Sat, 30 Jul 2011 04:21:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 6945D8003D for ; Sat, 30 Jul 2011 04:21:55 +0000 (UTC) From: "Alexandre Restovtsev" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alexandre Restovtsev" Message-ID: Subject: [gentoo-commits] proj/gnome:master commit in: dev-libs/gjs/, dev-libs/gjs/files/ X-VCS-Repository: proj/gnome X-VCS-Files: dev-libs/gjs/files/gjs-0.7.14-sanity.patch dev-libs/gjs/gjs-0.7.14-r1.ebuild X-VCS-Directories: dev-libs/gjs/ dev-libs/gjs/files/ X-VCS-Committer: tetromino X-VCS-Committer-Name: Alexandre Restovtsev X-VCS-Revision: ef78f21676c04c5d86b962071eba1f84b0a30883 Date: Sat, 30 Jul 2011 04:21:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: c209e554f980718b86bccf425e3773e1 commit: ef78f21676c04c5d86b962071eba1f84b0a30883 Author: Alexandre Rostovtsev gmail com> AuthorDate: Sat Jul 30 01:04:32 2011 +0000 Commit: Alexandre Restovtsev gmail com> CommitDate: Sat Jul 30 04:13:45 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gnome.git;a=3D= commit;h=3Def78f216 dev-libs/gjs: add gjs-0.7.14-r1 with optional spidermonkey support Port the changes from gnome-next branch to enable gjs to build with either xulrunner-2 or spidermonkey-1.8.5. Required creating a patch that backports the relevant improvements that exist in upstream git master's configure. Builds and passes tests with either choice of javascript engine. Note: the commits taken from upstream git keep on rewriting the same region of configure script, removing or altering the effect of previous changes. Therefore, the patch is provided in squashed form, both to use less space, and to make it much easier for an outsider to see what it has actually changed in the 0.7.14 code. --- dev-libs/gjs/files/gjs-0.7.14-sanity.patch | 485 ++++++++++++++++++++++= ++++++ dev-libs/gjs/gjs-0.7.14-r1.ebuild | 77 +++++ 2 files changed, 562 insertions(+), 0 deletions(-) diff --git a/dev-libs/gjs/files/gjs-0.7.14-sanity.patch b/dev-libs/gjs/fi= les/gjs-0.7.14-sanity.patch new file mode 100644 index 0000000..7b37d64 --- /dev/null +++ b/dev-libs/gjs/files/gjs-0.7.14-sanity.patch @@ -0,0 +1,485 @@ +This is a combination of 9 squashed commits (squashed to save space, sin= ce +the patches keep on modifying the same region of code) and a bit of manu= al +backporting work, bringing sanity wrt xulrunner and spidermonkey handlin= g to +gjs-0.7.14's configure, and allowing gjs-0.7.14 to correctly build again= st +spidermonkey-1.8.5. + +The patches squashed (along with their commit messages) are the followin= g: + +1. Marc-Antoine Perennou 2011-04-01 14:55:4= 3 +Conditionally adapt to JS_CLASS_TRACE removal + +Upstream removed it in http://hg.mozilla.org/mozilla-central/rev/a7784d1= 1c59b + +https://bugzilla.gnome.org/show_bug.cgi?id=3D646471 + +2. Marc-Antoine Perennou 2011-04-01 15:04:5= 7 +Conditionally adapt to JS_DestroyScript removal + +Upstream changed the behaviour of several things about JSScripts in +http://hg.mozilla.org/mozilla-central/rev/c919a7271ac1 + +We now have to use a JSObject instead of a JSScript in certain circumsta= nces, +and we no longer have to call JS_DestroyScript which no longer exists + +https://bugzilla.gnome.org/show_bug.cgi?id=3D646471 + +3. Marc-Antoine Perennou 2011-04-28 19:01:0= 3 +conditonally adapt to JS_BufferIsCompilableUnit changes + +Upstream added an argument to JS_BufferIsCompilableUnit in commit +http://hg.mozilla.org/mozilla-central/rev/a773890b676f +We now have to tell if the bytes are utf8 or not. + +https://bugzilla.gnome.org/show_bug.cgi?id=3D646471 + +4. Colin Walters 2011-05-04 14:14:18 +Support compilation with standalone mozjs185 release + +Adjust the detection logic so that we look for mozjs-185.pc first. If +we have this, we can skip all kinds of insanity. + +See https://bugzilla.mozilla.org/show_bug.cgi?id=3D628723 +for the discussion about creating this release. + +https://bugzilla.gnome.org/show_bug.cgi?id=3D646369 + +5. Colin Walters 2011-05-05 12:49:09 +JS_CLASS_TRACE is a preprocessor macro, can't use AC_CHECK_LIB + +6. Nirbheek Chauhan 2011-05-05 19:23:27 +build: drop js-config support, xulrunner-1.8/1.9 cruft, etc + +* The last working version of mozjs/xulrunner is 1.9.2.x, so drop suppor= t for + everything before that. +* Spidermonkey got a pkg-config file (gnome bug 646369), so we can get r= id of + js-config script support. +* Use AC_CHECK_FUNC instead of AC_CHECK_LIB, which avoids having to gues= s the + spidermonkey library name, and is the "preferred" way according to + gnome bug 646369#c3. + +https://bugzilla.gnome.org/show_bug.cgi?id=3D644971 + +7. Nirbheek Chauhan 2011-05-16 17:44:30 +build: pick up the JS library from pkg-config instead of the system one + +Add JS_LIBS to gjs_console_LDADD so that the JS library in libdir from +pkg-config is picked up first instead of the library in /usr/lib which m= ay be +from a system install of an older spidermonkey. + +https://bugzilla.gnome.org/show_bug.cgi?id=3D644971 + +8. Colin Walters 2011-06-09 13:41:14 +Don't set rpath if we're using the standalone libmozjs185 + +If we set an rpath to $prefix/lib, this causes us to prefer installed +libraries over the just-built ones, effectively subverting the ability +to run uninstalled. + +9. Alexandre Rostovtsev 2011-07-28 03:40:49 +Make choice of javascript package non-automagic + +Add a --with-js-package configure flag to allow selecting which +javascript package to build against, e.g. to force building against +xulrunner on a system that happens to have spidermonkey installed. + +By default, the behavior is the same as before (first check for +mozjs185, then for mozilla-js). + +https://bugzilla.gnome.org/show_bug.cgi?id=3D655479 +--- + Makefile.am | 15 +++- + configure.ac | 228 +++++++++++++++++++++-------------------= ------ + gi/keep-alive.c | 10 ++- + gjs-internals-1.0.pc.in | 5 +- + modules/console.c | 10 ++ + 5 files changed, 135 insertions(+), 133 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index a7ecd84..5d340dd 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -69,7 +69,10 @@ libgjs_la_CFLAGS =3D \ + libgjs_la_LDFLAGS =3D \ + -export-symbols-regex "^[^_]" -version-info 0:0:0 \ + -no-undefined \ +- -R $(FIREFOX_JS_LIBDIR) -rdynamic ++ -rdynamic ++if HAVE_FIREFOX_JS_LIBDIR ++libgjs_la_LDFLAGS +=3D -R $(FIREFOX_JS_LIBDIR)=20 ++endif + libgjs_la_LIBADD =3D \ + $(GJS_LIBS) +=20 +@@ -121,9 +124,13 @@ gjs_console_CFLAGS =3D \ + $(AM_CFLAGS) \ + $(GOBJECT_CFLAGS) + gjs_console_LDADD =3D \ +- $(GOBJECT_LIBS) \ +- libgjs.la +-gjs_console_LDFLAGS =3D -R $(FIREFOX_JS_LIBDIR) -rdynamic ++ $(JS_LIBS) \ ++ $(GOBJECT_LIBS) \ ++ libgjs.la ++gjs_console_LDFLAGS =3D -rdynamic ++if HAVE_FIREFOX_JS_LIBDIR ++gjs_console_LDFLAGS +=3D -R $(FIREFOX_JS_LIBDIR) ++endif + gjs_console_SOURCES =3D gjs/console.c +=20 + install-exec-hook: +diff --git a/configure.ac b/configure.ac +index d185ba1..3d41ecd 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -91,123 +91,100 @@ m4_define(gobject_required_version, 2.18.0) + AC_CHECK_HEADERS([malloc.h]) + AC_CHECK_FUNCS(mallinfo) +=20 +-# Look for Spidermonkey. If js-config exists, use that; +-# otherwise we try some pkgconfig files from various distributions. +- +-AC_ARG_VAR([JS_CONFIG], [The js-config program to use]) +-if test "$ac_cv_env_JS_CONFIG_set" !=3D "set"; then +- AC_PATH_PROG([JS_CONFIG], [js-config], []) ++AC_ARG_WITH([js-package], ++ AS_HELP_STRING([--with-js-package[=3D@<:@auto/mozjs185/mozilla-js@:= >@]], ++ [Choose JavaScript package: 'mozjs185' (i.e. spiderm= onkey), 'mozilla-js' (i.e. xulrunner or firefox), or 'auto' (detect autom= atically)]), ++ [with_js_package=3D$withval], ++ [with_js_package=3D"auto"]) ++ ++# First, try separate mozjs185 release ++if test $with_js_package =3D mozjs185 -o $with_js_package =3D auto; the= n ++ AC_MSG_CHECKING([for standalone mozjs185]) ++ PKG_CHECK_EXISTS([mozjs185], JS_PACKAGE=3Dmozjs185,) ++ if test x$JS_PACKAGE !=3D x; then ++ FIREFOX_JS_LIBDIR=3D ++ MOZJS_IS_STANDALONE=3Dyes ++ AC_MSG_RESULT([yes]) ++ PKG_CHECK_MODULES(JS, $JS_PACKAGE) ++ else ++ AC_MSG_RESULT([no]) ++ fi + fi +=20 +-if test -n "$JS_CONFIG"; then +- JS_CFLAGS=3D"$($JS_CONFIG --cflags)" +- JS_LIBS=3D"$($JS_CONFIG --libs)" +- FIREFOX_JS_LIBDIR=3D"$($JS_CONFIG --libdir)" +- JS_PACKAGE=3D +- +- # js-config gives almost usable CFLAGS, we must define one of XP_BE= OS, +- # XP_OS2, XP_WIN or XP_UNIX +- JS_CFLAGS=3D"$JS_CFLAGS -DXP_UNIX" +-else +- ## spidermonkey .pc file name varies across distributions and Gecko= version +- ## +- ## mozilla-js: Gecko 1.9, all distributions +- ## xulrunner-js: Gecko 1.8 (and earlier?) Debian/Ubuntu +- ## firefox-js: ??? +- ## +- ## Checking for mozilla-js first will hopefully get us the newest v= ersion +- ## of spidermonkey. +- PKG_CHECK_EXISTS([mozilla-js], [JS_PACKAGE=3Dmozilla-js], +- [PKG_CHECK_EXISTS([xulrunner-js], [JS_PACKAGE=3Dxu= lrunner-js], [JS_PACKAGE=3Dfirefox-js])]) +- +- PKG_CHECK_MODULES(JS, $JS_PACKAGE) +- +- ## some flavors of Firefox .pc only set sdkdir, not libdir +- FIREFOX_JS_SDKDIR=3D`$PKG_CONFIG --variable=3Dsdkdir $JS_PACKAGE` +- FIREFOX_JS_LIBDIR=3D`$PKG_CONFIG --variable=3Dlibdir $JS_PACKAGE` +- +- ## Ubuntu does not set libdir in mozilla-js.pc +- if test x"$FIREFOX_JS_LIBDIR" =3D x ; then +- ## Ubuntu returns xulrunner-devel as the sdkdir, but for the +- ## libdir we want the runtime location on the target system, +- ## so can't use -devel. +- ## The library is in the non-devel directory also. +- ## Don't ask me why it's in two places. +- FIREFOX_JS_LIBDIR=3D`echo "$FIREFOX_JS_SDKDIR" | sed -e 's/-deve= l//g'` +- +- if ! test -d "$FIREFOX_JS_LIBDIR" ; then +- FIREFOX_JS_LIBDIR=3D +- fi ++if test $with_js_package =3D mozilla-js -o $with_js_package =3D auto; t= hen ++ # If we didn't find mozjs185 (the standalone spidermonkey), look fo= r mozilla-js ++ if test x$JS_PACKAGE =3D x; then ++ AC_MSG_CHECKING([for mozilla-js 1.9.2]) ++ PKG_CHECK_EXISTS([mozilla-js >=3D 1.9.2], JS_PACKAGE=3Dmozilla-= js,) ++ if test x$JS_PACKAGE !=3D x; then ++ AC_MSG_RESULT([yes]) ++ else ++ AC_MSG_ERROR([Could not find mozilla-js 1.9.2]) ++ fi ++ ++ PKG_CHECK_MODULES(JS, $JS_PACKAGE) ++ ++ ## some flavors of Firefox .pc only set sdkdir, not libdir ++ FIREFOX_JS_SDKDIR=3D`$PKG_CONFIG --variable=3Dsdkdir $JS_PACKAG= E` ++ FIREFOX_JS_LIBDIR=3D`$PKG_CONFIG --variable=3Dlibdir $JS_PACKAG= E` ++ ++ ## Ubuntu does not set libdir in mozilla-js.pc ++ if test x"$FIREFOX_JS_LIBDIR" =3D x; then ++ ## Ubuntu returns xulrunner-devel as the sdkdir, but for th= e ++ ## libdir we want the runtime location on the target system= , ++ ## so can't use -devel. ++ ## The library is in the non-devel directory also. ++ ## Don't ask me why it's in two places. ++ FIREFOX_JS_LIBDIR=3D`echo "$FIREFOX_JS_SDKDIR" | sed -e 's/= -devel//g'` ++ if ! test -d "$FIREFOX_JS_LIBDIR"; then ++ FIREFOX_JS_LIBDIR=3D ++ fi ++ fi ++ ++ if test x"$FIREFOX_JS_LIBDIR" =3D x; then ++ AC_MSG_ERROR([Could not figure out where the Firefox JavaSc= ript library lives]) ++ fi + fi + fi +=20 +-if test x"$FIREFOX_JS_LIBDIR" =3D x ; then +- AC_MSG_ERROR([Could not figure out where Firefox JavaScript library = lives]) ++if test x$JS_PACKAGE =3D x; then ++ AC_MSG_ERROR([No appropriate JavaScript package found]) + fi +=20 +-AC_SUBST(JS_PACKAGE) +-AC_SUBST(FIREFOX_JS_LIBDIR) ++echo "Using JS_PACKAGE: $JS_PACKAGE" ++echo "Using JS_CFLAGS: $JS_CFLAGS" ++echo "Using JS_LIBS: $JS_LIBS" +=20 +-AC_MSG_CHECKING([for mozilla-js >=3D 1.9.2 ]) +-if `$PKG_CONFIG --exists $JS_PACKAGE '>=3D' 1.9.2`; then +- AC_MSG_RESULT([yes]) +-else +- AC_MSG_ERROR([$JS_PACKAGE >=3D 1.9.2 is required]) ++AC_SUBST(JS_PACKAGE) ++AM_CONDITIONAL(HAVE_FIREFOX_JS_LIBDIR, test x$FIREFOX_JS_LIBDIR !=3D x) ++if test x$FIREFOX_JS_LIBDIR !=3D x; then ++ GJS_INTERNALS_LIBS=3D"-Wl,--rpath=3D$FIREFOX_JS_LIBDIR" + fi ++AC_SUBST(GJS_INTERNALS_LIBS) ++AC_SUBST(FIREFOX_JS_LIBDIR) +=20 +-AC_CHECK_LIB([mozjs], [JS_GetStringBytes], AC_DEFINE([HAVE_JS_GETSTRING= BYTES], [1], [Define if we still have JS_GetStringBytes]),, [$JS_LIBS]) +-AC_CHECK_LIB([mozjs], [JS_GetFunctionName], AC_DEFINE([HAVE_JS_GETFUNCT= IONNAME], [1], [Define if we still have JS_GetFunctionName]),, [$JS_LIBS]= ) +-AC_CHECK_LIB([mozjs], [JS_GetStringChars], AC_DEFINE([HAVE_JS_GETSTRING= CHARS], [1], [Define if we still have JS_GetStringChars]),, [$JS_LIBS]) +-AC_CHECK_LIB([mozjs], [JS_StrictPropertyStub], AC_DEFINE([HAVE_JS_STRIC= TPROPERTYSTUB], [1], [Define if we have JS_StrictPropertyStub]),, [$JS_LI= BS]) +-AC_CHECK_LIB([mozjs], [JS_GetGlobalForScopeChain], AC_DEFINE([HAVE_JS_G= ETGLOBALFORSCOPECHAIN], [1], [Define if we have JS_GetGlobalForScopeChain= ]),, [$JS_LIBS]) ++saved_CFLAGS=3D$CFLAGS ++saved_LIBS=3D$LIBS ++CFLAGS=3D$JS_CFLAGS ++LIBS=3D$JS_LIBS ++AC_CHECK_FUNC([JS_GetStringBytes], AC_DEFINE([HAVE_JS_GETSTRINGBYTES], = [1], [Define if we still have JS_GetStringBytes]),) ++AC_CHECK_FUNC([JS_GetFunctionName], AC_DEFINE([HAVE_JS_GETFUNCTIONNAME]= , [1], [Define if we still have JS_GetFunctionName]),) ++AC_CHECK_FUNC([JS_GetStringChars], AC_DEFINE([HAVE_JS_GETSTRINGCHARS], = [1], [Define if we still have JS_GetStringChars]),) ++AC_CHECK_FUNC([JS_StrictPropertyStub], AC_DEFINE([HAVE_JS_STRICTPROPERT= YSTUB], [1], [Define if we have JS_StrictPropertyStub]),) ++AC_CHECK_FUNC([JS_GetGlobalForScopeChain], AC_DEFINE([HAVE_JS_GETGLOBAL= FORSCOPECHAIN], [1], [Define if we have JS_GetGlobalForScopeChain]),) ++AC_CHECK_FUNC([JS_DestroyScript], AC_DEFINE([HAVE_JS_DESTROYSCRIPT], [1= ], [Define if we still have JS_DestroyScript]),) ++AC_CHECK_FUNC([JS_DecodeUTF8], AC_DEFINE([HAVE_JS_DECODEUTF8], [1], [De= fine if we have JS_DecodeUTF8]),) ++AC_CHECK_FUNC([JS_FreezeObject], AC_DEFINE([HAVE_JS_FREEZEOBJECT], [1],= [Define if we have JS_FreezeObject]),) ++AC_CHECK_FUNC([JS_IsScriptFrame], AC_DEFINE([HAVE_JS_ISSCRIPTFRAME], [1= ], [Define if we have JS_IsScriptFrame]),) ++AC_CHECK_FUNC([JS_EndPC], AC_DEFINE([HAVE_JS_ENDPC], [1], [Define if we= have JS_EndPC]),) ++AC_CHECK_FUNC([JS_NewCompartmentAndGlobalObject], AC_DEFINE([HAVE_JS_NE= WCOMPARTMENTANDGLOBALOBJECT], [1], [Define if we have JS_NewCompartmentAn= dGlobalObject]),) ++CFLAGS=3D$saved_CFLAGS ++LIBS=3D$saved_LIBS +=20 +-AC_MSG_CHECKING([for mozilla-js >=3D 2 ]) +-if `$PKG_CONFIG --exists $JS_PACKAGE '>=3D' 2`; then +- AC_MSG_RESULT([yes]) ++if test x$MOZJS_IS_STANDALONE =3D xyes || `$PKG_CONFIG --exists $JS_PAC= KAGE '>=3D' 2`; then + AC_DEFINE(HAVE_MOZJS_2, [1], [Define if mozilla-js is at least 2]) +- AC_CHECK_LIB([mozjs], [JS_FreezeObject], AC_DEFINE([HAVE_JS_FREEZEOBJ= ECT], [1], [Define if we have JS_FreezeObject]), +- , [$JS_LIBS]) +- AC_CHECK_LIB([mozjs], [JS_IsScriptFrame], AC_DEFINE([HAVE_JS_ISSCRIPT= FRAME], [1], [Define if we have JS_IsScriptFrame]), +- , [$JS_LIBS]) +- AC_CHECK_LIB([mozjs], [JS_EndPC], AC_DEFINE([HAVE_JS_ENDPC], [1], [De= fine if we have JS_EndPC]), +- , [$JS_LIBS]) +- AC_CHECK_LIB([mozjs], [JS_NewCompartmentAndGlobalObject], +- AC_DEFINE([HAVE_JS_NEWCOMPARTMENTANDGLOBALOBJECT], [1], [= Define if we have JS_NewCompartmentAndGlobalObject]), +- , [$JS_LIBS]) +- +-else +- AC_MSG_RESULT([no]) + fi +=20 +-## workaround for Ubuntu Hardy bug where mozilla-js.pc gives CFLAGS +-## -I.../stable while jsapi.h is in .../unstable +-AC_MSG_CHECKING([if SpiderMonkey needs extra compiler flags]) +-save_CFLAGS=3D"$CFLAGS" +-CFLAGS=3D"$CFLAGS $JS_CFLAGS" +-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]])], +- [js_extra_cflags_needed=3Dno], +- [js_extra_cflags_needed=3Dyes]) +-CFLAGS=3D"$save_CFLAGS" +-AC_MSG_RESULT([$js_extra_cflags_needed]) +- +-JS_EXTRA_CFLAGS=3D +-if test "$js_extra_cflags_needed" =3D yes; then +- try_cflags=3D"-I`$PKG_CONFIG --variable=3Dincludedir $JS_PACKAGE`/u= nstable" +- AC_MSG_CHECKING([if $try_cflags works]) +- save_CFLAGS=3D"$CFLAGS" +- CFLAGS=3D"$CFLAGS $JS_CFLAGS $try_cflags" +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]])], +- [AC_MSG_RESULT([yes]) +- JS_EXTRA_CFLAGS=3D"$try_cflags"], +- [AC_MSG_RESULT([no])]) +- CFLAGS=3D"$save_CFLAGS" +- +- if test x"$JS_EXTRA_CFLAGS" =3D x; then +- AC_MSG_ERROR([Unable to determine extra compiler flags needed]) +- fi +-fi +-AC_SUBST([JS_EXTRA_CFLAGS]) +- + AC_MSG_CHECKING([whether JSLocaleToUnicode takes a const char*]) + save_CFLAGS=3D"$CFLAGS" + CFLAGS=3D"$CFLAGS $JS_CFLAGS -Wno-unused -Werror" +@@ -228,6 +205,30 @@ if test "$have_jslocale_to_unicode_const" =3D yes; = then + AC_DEFINE([JS_LOCALETOUNICODE_NEEDS_CONST_CHAR], [1], [Define if J= SLocaleToUnicode takes a const char* for its src]) + fi +=20 ++save_CFLAGS=3D"$CFLAGS" ++CFLAGS=3D"$CFLAGS $JS_CFLAGS" ++AC_MSG_CHECKING([for JS_CLASS_TRACE macro]) ++AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[ ++ #include ++ #ifndef JS_CLASS_TRACE ++ #error "No JS_CLASS_TRACE" ++ #endif ++ ]], ++ [[(void) 0;]] ++ )], ++ [have_js_class_trace=3Dyes], ++ [have_js_class_trace=3Dno]) ++ ++if test "x$have_js_class_trace" =3D xyes; then ++ AC_MSG_RESULT([yes]) ++ AC_DEFINE([HAVE_JS_CLASS_TRACE], [1], [Define if we still have JS_C= LASS_TRACE]) ++else ++ AC_MSG_RESULT([no]) ++fi ++CFLAGS=3D"$save_CFLAGS" ++ + common_packages=3D"gobject-2.0 >=3D gobject_required_version $JS_PACKAG= E" + gjs_packages=3D"gmodule-2.0 gthread-2.0 $common_packages" + gjs_gi_packages=3D"gobject-introspection-1.0 >=3D 0.10.1 $common_packag= es" +@@ -258,27 +259,6 @@ PKG_CHECK_MODULES([GJSTESTS], [$gjstests_packages]) + GI_DATADIR=3D$($PKG_CONFIG --variable=3Dgidatadir gobject-introspection= -1.0) + AC_SUBST(GI_DATADIR) +=20 +-if test x"$JS_PACKAGE" =3D x; then +- # if JS_PACKAGE is undefined, pkg-config modules don't include +- # SpiderMonkey and we need to deal with it ourselves +- GJS_CFLAGS=3D"$GJS_CFLAGS $JS_CFLAGS" +- GJS_LIBS=3D"$GJS_LIBS $JS_LIBS" +- GJS_GI_CFLAGS=3D"$GJS_GI_CFLAGS $JS_CFLAGS" +- GJS_GI_LIBS=3D"$GJS_GI_LIBS $JS_LIBS" +- GJS_CAIRO_CFLAGS=3D"$GJS_CAIRO_CFLAGS $JS_CFLAGS" +- GJS_CAIRO_LIBS=3D"$GJS_CAIRO_LIBS $JS_LIBS" +- GJS_DBUS_CFLAGS=3D"$GJS_DBUS_CFLAGS $JS_CFLAGS" +- GJS_DBUS_LIBS=3D"$GJS_DBUS_LIBS $JS_LIBS" +- GJSTESTS_CFLAGS=3D"$GJSTESTS_CFLAGS $JS_CFLAGS" +- GJSTESTS_LIBS=3D"$GJSTEST_LIBS $JS_LIBS" +-fi +- +-GJS_CFLAGS=3D"$GJS_CFLAGS $JS_EXTRA_CFLAGS" +-GJS_GI_CFLAGS=3D"$GJS_GI_CFLAGS $JS_EXTRA_CFLAGS" +-GJS_CAIRO_CFLAGS=3D"$GJS_CAIRO_CFLAGS $JS_EXTRA_CFLAGS" +-GJS_DBUS_CFLAGS=3D"$GJS_DBUS_CFLAGS $JS_EXTRA_CFLAGS" +-GJSTESTS_CFLAGS=3D"$GJSTESTS_CFLAGS $JS_EXTRA_CFLAGS" +- + # readline + LIBS_no_readline=3D$LIBS +=20 +diff --git a/gi/keep-alive.c b/gi/keep-alive.c +index c7149ac..e268eaf 100644 +--- a/gi/keep-alive.c ++++ b/gi/keep-alive.c +@@ -184,8 +184,10 @@ keep_alive_trace(JSTracer *tracer, + */ + static struct JSClass gjs_keep_alive_class =3D { + "__private_GjsKeepAlive", /* means "new __private_GjsKeepAlive()" w= orks */ +- JSCLASS_HAS_PRIVATE | +- JSCLASS_MARK_IS_TRACE, /* TraceOp not MarkOp */ ++#ifdef HAVE_JS_CLASS_TRACE ++ JSCLASS_MARK_IS_TRACE | /* TraceOp not MarkOp */ ++#endif ++ JSCLASS_HAS_PRIVATE, + JS_PropertyStub, + JS_PropertyStub, + JS_PropertyStub, +@@ -200,7 +202,11 @@ static struct JSClass gjs_keep_alive_class =3D { + NULL, + NULL, + NULL, ++#ifdef HAVE_JS_CLASS_TRACE + JS_CLASS_TRACE(keep_alive_trace), ++#else ++ keep_alive_trace, ++#endif + NULL + }; +=20 +diff --git a/gjs-internals-1.0.pc.in b/gjs-internals-1.0.pc.in +index 701dd42..f4feb19 100644 +--- a/gjs-internals-1.0.pc.in ++++ b/gjs-internals-1.0.pc.in +@@ -8,10 +8,9 @@ datadir=3D@datadir@ +=20 + jsdir=3D@gjsjsdir@ + jsnativedir=3D@gjsnativedir@ +-mozjslibdir=3D@FIREFOX_JS_LIBDIR@ +=20 +-Cflags: -I${includedir}/gjs-1.0 @JS_EXTRA_CFLAGS@ +-Libs: -Wl,--rpath=3D${mozjslibdir} ++Cflags: -I${includedir}/gjs-1.0 ++Libs: @GJS_INTERNALS_LIBS@ + Requires: gjs-1.0 gobject-introspection-1.0 @JS_PACKAGE@ +=20 + Name: gjs-internals-1.0 +diff --git a/modules/console.c b/modules/console.c +index 49f891b..8e20db3 100644 +--- a/modules/console.c ++++ b/modules/console.c +@@ -161,7 +161,11 @@ gjs_console_interact(JSContext *context, + { + JSObject *object =3D JS_THIS_OBJECT(context, vp); + gboolean eof =3D FALSE; ++#ifdef HAVE_JS_DESTROYSCRIPT + JSScript *script =3D NULL; ++#else ++ JSObject *script =3D NULL; ++#endif + jsval result; + JSString *str; + GString *buffer =3D NULL; +@@ -192,7 +196,11 @@ gjs_console_interact(JSContext *context, + g_string_append(buffer, temp_buf); + g_free(temp_buf); + lineno++; ++#ifdef HAVE_JS_DECODEUTF8 ++ } while (!JS_BufferIsCompilableUnit(context, JS_TRUE, object, b= uffer->str, buffer->len)); ++#else + } while (!JS_BufferIsCompilableUnit(context, object, buffer->st= r, buffer->len)); ++#endif +=20 + script =3D JS_CompileScript(context, object, buffer->str, buffe= r->len, "typein", + startline); +@@ -219,8 +227,10 @@ gjs_console_interact(JSContext *context, + } +=20 + next: ++#ifdef HAVE_JS_DESTROYSCRIPT + if (script) + JS_DestroyScript(context, script); ++#endif + g_string_free(buffer, TRUE); + } while (!eof); +=20 +--=20 +1.7.6 + diff --git a/dev-libs/gjs/gjs-0.7.14-r1.ebuild b/dev-libs/gjs/gjs-0.7.14-= r1.ebuild new file mode 100644 index 0000000..75c4e04 --- /dev/null +++ b/dev-libs/gjs/gjs-0.7.14-r1.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/gjs/gjs-0.7.14.ebuild,v 1.2 = 2011/05/01 15:42:03 nirbheek Exp $ + +EAPI=3D"3" +GCONF_DEBUG=3D"no" +GNOME2_LA_PUNT=3D"yes" +PYTHON_DEPEND=3D"2" + +inherit autotools eutils gnome2 python virtualx + +DESCRIPTION=3D"Javascript bindings for GNOME" +HOMEPAGE=3D"http://live.gnome.org/Gjs" + +LICENSE=3D"MIT MPL-1.1 LGPL-2 GPL-2" +SLOT=3D"0" +IUSE=3D"examples test +xulrunner" +KEYWORDS=3D"~amd64 ~x86" + +# Things are untested and broken with anything other than xulrunner-2.0 +# FIXME: https://bugzilla.mozilla.org/show_bug.cgi?id=3D628723 instead o= f libxul +RDEPEND=3D">=3Ddev-libs/glib-2.18:2 + >=3Ddev-libs/gobject-introspection-0.10.1 + >=3Dnet-libs/xulrunner-2.0:1.9 + + dev-libs/dbus-glib + sys-libs/readline + x11-libs/cairo + xulrunner? ( + >=3Dnet-libs/xulrunner-2.0:1.9 + !=3Ddev-lang/spidermonkey-1.8.2* ) + !xulrunner? ( =3Ddev-lang/spidermonkey-1.8.5* )" +DEPEND=3D"${RDEPEND} + sys-devel/gettext + >=3Ddev-util/pkgconfig-0.9" +# HACK HACK: gjs-tests picks up /usr/lib/libmozjs.so with spidermonkey i= nstalled + +src_prepare() { + # AUTHORS, ChangeLog are empty + DOCS=3D"NEWS README" + # FIXME: add systemtap/dtrace support, like in glib:2 + # XXX: Do NOT enable coverage, completely useless for portage installs + G2CONF=3D"${G2CONF} + --disable-systemtap + --disable-dtrace + --disable-coverage" + if use xulrunner; then + G2CONF=3D"${G2CONF} --with-js-package=3Dmozilla-js" + else + G2CONF=3D"${G2CONF} --with-js-package=3Dmozjs185" + fi + + # https://bugzilla.gnome.org/show_bug.cgi?id=3D646369 + # https://bugs.gentoo.org/353941 + # https://bugzilla.gnome.org/show_bug.cgi?id=3D655479 + epatch "${FILESDIR}/${P}-sanity.patch" + + eautoreconf + + gnome2_src_prepare + python_convert_shebangs 2 "${S}"/scripts/make-tests +} + +src_test() { + # Tests need dbus + Xemake check || die +} + +src_install() { + # installation sometimes fails in parallel + gnome2_src_install -j1 + + if use examples; then + insinto /usr/share/doc/${PF}/examples + doins "${S}"/examples/* || die "doins examples failed!" + fi +}