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 <gentoo-commits+bounces-326214-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1Q04DG-0007HT-Iq
	for garchives@archives.gentoo.org; Thu, 17 Mar 2011 03:49:26 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id DF2461C010;
	Thu, 17 Mar 2011 03:49:19 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id 902E01C010
	for <gentoo-commits@lists.gentoo.org>; Thu, 17 Mar 2011 03:49:19 +0000 (UTC)
Received: from pelican.gentoo.org (unknown [66.219.59.40])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 18D381B4007
	for <gentoo-commits@lists.gentoo.org>; Thu, 17 Mar 2011 03:49:19 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 7F8FA8006A
	for <gentoo-commits@lists.gentoo.org>; Thu, 17 Mar 2011 03:49:18 +0000 (UTC)
From: "Nirbheek Chauhan" <nirbheek@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Nirbheek Chauhan" <nirbheek@gentoo.org>
Message-ID: <f9d267a212328149be1e2894bfbce02dbe27d9b1.nirbheek@gentoo>
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-drop-js-config.patch dev-libs/gjs/gjs-0.7.13.ebuild dev-libs/gjs/gjs-9999.ebuild
X-VCS-Directories: dev-libs/gjs/ dev-libs/gjs/files/
X-VCS-Committer: nirbheek
X-VCS-Committer-Name: Nirbheek Chauhan
X-VCS-Revision: f9d267a212328149be1e2894bfbce02dbe27d9b1
Date: Thu, 17 Mar 2011 03:49:18 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 
X-Archives-Hash: f53c27c3898754ca9d2c4b4355fcfe9f

commit:     f9d267a212328149be1e2894bfbce02dbe27d9b1
Author:     Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 02:39:41 2011 +0000
Commit:     Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org>
CommitDate: Thu Mar 17 02:42:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gnome.git;a=3D=
commit;h=3Df9d267a2

dev-libs/gjs: fix bug 353941

---
 dev-libs/gjs/files/gjs-drop-js-config.patch |  183 +++++++++++++++++++++=
++++++
 dev-libs/gjs/gjs-0.7.13.ebuild              |   33 +++---
 dev-libs/gjs/gjs-9999.ebuild                |   33 +++---
 3 files changed, 213 insertions(+), 36 deletions(-)

diff --git a/dev-libs/gjs/files/gjs-drop-js-config.patch b/dev-libs/gjs/f=
iles/gjs-drop-js-config.patch
new file mode 100644
index 0000000..0a8609a
--- /dev/null
+++ b/dev-libs/gjs/files/gjs-drop-js-config.patch
@@ -0,0 +1,183 @@
+From 4de63456b411ae2b16cdb813cf021e3f2e19e5f3 Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek@gentoo.org>
+Date: Thu, 17 Mar 2011 05:07:06 +0530
+Subject: [PATCH] build: drop js-config support and xulrunner-1.8/1.9 cru=
ft
+
+In addition, add JS_LIBS to gjs_console_LDADD so that the
+mozjs library in libdir from pkg-config is picked up first instead of
+the library in /usr/lib which may be from a system install of spidermonk=
ey
+---
+ Makefile.am             |    1 +
+ configure.ac            |  114 +++++++---------------------------------=
------
+ gjs-internals-1.0.pc.in |    2 +-
+ 3 files changed, 20 insertions(+), 97 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index b4814d6..3363ff5 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -121,6 +121,7 @@ gjs_console_CFLAGS =3D 		\
+ 	$(AM_CFLAGS)		\
+         $(GOBJECT_CFLAGS)
+ gjs_console_LDADD =3D		\
++         $(JS_LIBS)		\
+          $(GOBJECT_LIBS)           \
+          libgjs.la
+ gjs_console_LDFLAGS =3D -R $(FIREFOX_JS_LIBDIR) -rdynamic
+diff --git a/configure.ac b/configure.ac
+index 715f2c3..1903cc6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -91,54 +91,26 @@ 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.
++## mozilla-js: Gecko 1.9 and 2.0, all distributions
++PKG_CHECK_EXISTS([mozilla-js], [JS_PACKAGE=3Dmozilla-js],)
++PKG_CHECK_MODULES(JS, $JS_PACKAGE)
+=20
+-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], [])
+-fi
+-
+-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
++## 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`
+=20
+-    # 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
+-    fi
++## 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/-devel//g=
'`
++
++   if ! test -d "$FIREFOX_JS_LIBDIR" ; then
++       FIREFOX_JS_LIBDIR=3D
++   fi
+ fi
+=20
+ if test x"$FIREFOX_JS_LIBDIR" =3D x ; then
+@@ -179,35 +151,6 @@ 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 <jsapi.h>]])],
+-    [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 <jsapi.h>]])],
+-        [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"
+@@ -258,27 +201,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/gjs-internals-1.0.pc.in b/gjs-internals-1.0.pc.in
+index 701dd42..e4517cb 100644
+--- a/gjs-internals-1.0.pc.in
++++ b/gjs-internals-1.0.pc.in
+@@ -10,7 +10,7 @@ jsdir=3D@gjsjsdir@
+ jsnativedir=3D@gjsnativedir@
+ mozjslibdir=3D@FIREFOX_JS_LIBDIR@
+=20
+-Cflags: -I${includedir}/gjs-1.0 @JS_EXTRA_CFLAGS@
++Cflags: -I${includedir}/gjs-1.0
+ Libs: -Wl,--rpath=3D${mozjslibdir}
+ Requires: gjs-1.0 gobject-introspection-1.0 @JS_PACKAGE@
+=20
+--=20
+1.7.3.4
+

diff --git a/dev-libs/gjs/gjs-0.7.13.ebuild b/dev-libs/gjs/gjs-0.7.13.ebu=
ild
index 6a2e15a..530dfb5 100644
--- a/dev-libs/gjs/gjs-0.7.13.ebuild
+++ b/dev-libs/gjs/gjs-0.7.13.ebuild
@@ -7,14 +7,14 @@ GCONF_DEBUG=3D"no"
 GNOME2_LA_PUNT=3D"yes"
 PYTHON_DEPEND=3D"2"
=20
-inherit gnome2 python
+inherit autotools eutils gnome2 python virtualx
=20
 DESCRIPTION=3D"Javascript bindings for GNOME"
 HOMEPAGE=3D"http://live.gnome.org/Gjs"
=20
 LICENSE=3D"MIT MPL-1.1 LGPL-2 GPL-2"
 SLOT=3D"0"
-IUSE=3D"coverage examples"
+IUSE=3D"coverage examples test"
=20
 if [[ ${PV} =3D=3D 9999 ]]; then
 	inherit gnome2-live
@@ -23,22 +23,20 @@ else
 	KEYWORDS=3D"~amd64 ~x86"
 fi
=20
-# || ( xulrunner spidermonkey ): configure prefers spidermonkey over xul=
runner
-# Hence, having older spidermonkey installed will result in bug 353941
 RDEPEND=3D">=3Ddev-libs/glib-2.18:2
 	>=3Ddev-libs/gobject-introspection-0.10.1
=20
 	dev-libs/dbus-glib
 	x11-libs/cairo
-	|| ( >=3Dnet-libs/xulrunner-1.9.2:1.9
-		 >=3Ddev-lang/spidermonkey-1.9.2 )
-	!<dev-lang/spidermonkey-1.9.2"
+	>=3Dnet-libs/xulrunner-1.9.2:1.9"
 DEPEND=3D"${RDEPEND}
 	sys-devel/gettext
 	>=3Ddev-util/pkgconfig-0.9
 	coverage? (
 		sys-devel/gcc
-		dev-util/lcov )"
+		dev-util/lcov )
+	test? ( !dev-lang/spidermonkey )"
+# HACK HACK: gjs-tests picks up /usr/lib/libmozjs.so with spidermonkey i=
nstalled
=20
 src_prepare() {
 	# AUTHORS, ChangeLog are empty
@@ -46,21 +44,20 @@ src_prepare() {
 	G2CONF=3D"${G2CONF}
 		$(use_enable coverage)"
=20
-	# If spidermonkey & xulrunner are installed configure prefers spidermon=
key.
-	# This will break gnome-shell if the user removes spidermonkey.
-	# Mozilla wants to move to a split spidermonkey, so this problem should
-	# solve itself in the future. For now, we add an ewarn.
-	if has_version dev-lang/spidermonkey && has_version net-libs/xulrunner;=
 then
-		ewarn "You have both spidermonkey and xulrunner installed,"
-		ewarn "hence gnome-shell will be linked with spidermonkey."
-		ewarn "If you remove spidermonkey, you will need to recompile"
-		ewarn "gnome-shell so that it links with xulrunner."
-	fi
+	# https://bugs.gentoo.org/353941
+	epatch "${FILESDIR}/${PN}-drop-js-config.patch"
+
+	[[ ${PV} !=3D 9999 ]] && eautoreconf
=20
 	gnome2_src_prepare
 	python_convert_shebangs 2 "${S}"/scripts/make-tests
 }
=20
+src_test() {
+	# Tests need dbus
+	Xemake check || die
+}
+
 src_install() {
 	# installation sometimes fails in parallel
 	gnome2_src_install -j1

diff --git a/dev-libs/gjs/gjs-9999.ebuild b/dev-libs/gjs/gjs-9999.ebuild
index 6a2e15a..530dfb5 100644
--- a/dev-libs/gjs/gjs-9999.ebuild
+++ b/dev-libs/gjs/gjs-9999.ebuild
@@ -7,14 +7,14 @@ GCONF_DEBUG=3D"no"
 GNOME2_LA_PUNT=3D"yes"
 PYTHON_DEPEND=3D"2"
=20
-inherit gnome2 python
+inherit autotools eutils gnome2 python virtualx
=20
 DESCRIPTION=3D"Javascript bindings for GNOME"
 HOMEPAGE=3D"http://live.gnome.org/Gjs"
=20
 LICENSE=3D"MIT MPL-1.1 LGPL-2 GPL-2"
 SLOT=3D"0"
-IUSE=3D"coverage examples"
+IUSE=3D"coverage examples test"
=20
 if [[ ${PV} =3D=3D 9999 ]]; then
 	inherit gnome2-live
@@ -23,22 +23,20 @@ else
 	KEYWORDS=3D"~amd64 ~x86"
 fi
=20
-# || ( xulrunner spidermonkey ): configure prefers spidermonkey over xul=
runner
-# Hence, having older spidermonkey installed will result in bug 353941
 RDEPEND=3D">=3Ddev-libs/glib-2.18:2
 	>=3Ddev-libs/gobject-introspection-0.10.1
=20
 	dev-libs/dbus-glib
 	x11-libs/cairo
-	|| ( >=3Dnet-libs/xulrunner-1.9.2:1.9
-		 >=3Ddev-lang/spidermonkey-1.9.2 )
-	!<dev-lang/spidermonkey-1.9.2"
+	>=3Dnet-libs/xulrunner-1.9.2:1.9"
 DEPEND=3D"${RDEPEND}
 	sys-devel/gettext
 	>=3Ddev-util/pkgconfig-0.9
 	coverage? (
 		sys-devel/gcc
-		dev-util/lcov )"
+		dev-util/lcov )
+	test? ( !dev-lang/spidermonkey )"
+# HACK HACK: gjs-tests picks up /usr/lib/libmozjs.so with spidermonkey i=
nstalled
=20
 src_prepare() {
 	# AUTHORS, ChangeLog are empty
@@ -46,21 +44,20 @@ src_prepare() {
 	G2CONF=3D"${G2CONF}
 		$(use_enable coverage)"
=20
-	# If spidermonkey & xulrunner are installed configure prefers spidermon=
key.
-	# This will break gnome-shell if the user removes spidermonkey.
-	# Mozilla wants to move to a split spidermonkey, so this problem should
-	# solve itself in the future. For now, we add an ewarn.
-	if has_version dev-lang/spidermonkey && has_version net-libs/xulrunner;=
 then
-		ewarn "You have both spidermonkey and xulrunner installed,"
-		ewarn "hence gnome-shell will be linked with spidermonkey."
-		ewarn "If you remove spidermonkey, you will need to recompile"
-		ewarn "gnome-shell so that it links with xulrunner."
-	fi
+	# https://bugs.gentoo.org/353941
+	epatch "${FILESDIR}/${PN}-drop-js-config.patch"
+
+	[[ ${PV} !=3D 9999 ]] && eautoreconf
=20
 	gnome2_src_prepare
 	python_convert_shebangs 2 "${S}"/scripts/make-tests
 }
=20
+src_test() {
+	# Tests need dbus
+	Xemake check || die
+}
+
 src_install() {
 	# installation sometimes fails in parallel
 	gnome2_src_install -j1