From: "Nirbheek Chauhan" <nirbheek@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gnome:master commit in: dev-libs/gjs/, dev-libs/gjs/files/
Date: Thu, 17 Mar 2011 03:49:18 +0000 (UTC) [thread overview]
Message-ID: <f9d267a212328149be1e2894bfbce02dbe27d9b1.nirbheek@gentoo> (raw)
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=proj/gnome.git;a=commit;h=f9d267a2
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/files/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 cruft
+
+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 spidermonkey
+---
+ 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 = \
+ $(AM_CFLAGS) \
+ $(GOBJECT_CFLAGS)
+ gjs_console_LDADD = \
++ $(JS_LIBS) \
+ $(GOBJECT_LIBS) \
+ libgjs.la
+ gjs_console_LDFLAGS = -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)
+
+-# 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=mozilla-js],)
++PKG_CHECK_MODULES(JS, $JS_PACKAGE)
+
+-AC_ARG_VAR([JS_CONFIG], [The js-config program to use])
+-if test "$ac_cv_env_JS_CONFIG_set" != "set"; then
+- AC_PATH_PROG([JS_CONFIG], [js-config], [])
+-fi
+-
+-if test -n "$JS_CONFIG"; then
+- JS_CFLAGS="$($JS_CONFIG --cflags)"
+- JS_LIBS="$($JS_CONFIG --libs)"
+- FIREFOX_JS_LIBDIR="$($JS_CONFIG --libdir)"
+- JS_PACKAGE=
++## some flavors of Firefox .pc only set sdkdir, not libdir
++FIREFOX_JS_SDKDIR=`$PKG_CONFIG --variable=sdkdir $JS_PACKAGE`
++FIREFOX_JS_LIBDIR=`$PKG_CONFIG --variable=libdir $JS_PACKAGE`
+
+- # js-config gives almost usable CFLAGS, we must define one of XP_BEOS,
+- # XP_OS2, XP_WIN or XP_UNIX
+- JS_CFLAGS="$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 version
+- ## of spidermonkey.
+- PKG_CHECK_EXISTS([mozilla-js], [JS_PACKAGE=mozilla-js],
+- [PKG_CHECK_EXISTS([xulrunner-js], [JS_PACKAGE=xulrunner-js], [JS_PACKAGE=firefox-js])])
+-
+- PKG_CHECK_MODULES(JS, $JS_PACKAGE)
+-
+- ## some flavors of Firefox .pc only set sdkdir, not libdir
+- FIREFOX_JS_SDKDIR=`$PKG_CONFIG --variable=sdkdir $JS_PACKAGE`
+- FIREFOX_JS_LIBDIR=`$PKG_CONFIG --variable=libdir $JS_PACKAGE`
+-
+- ## Ubuntu does not set libdir in mozilla-js.pc
+- if test x"$FIREFOX_JS_LIBDIR" = 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=`echo "$FIREFOX_JS_SDKDIR" | sed -e 's/-devel//g'`
+-
+- if ! test -d "$FIREFOX_JS_LIBDIR" ; then
+- FIREFOX_JS_LIBDIR=
+- fi
+- fi
++## Ubuntu does not set libdir in mozilla-js.pc
++if test x"$FIREFOX_JS_LIBDIR" = 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=`echo "$FIREFOX_JS_SDKDIR" | sed -e 's/-devel//g'`
++
++ if ! test -d "$FIREFOX_JS_LIBDIR" ; then
++ FIREFOX_JS_LIBDIR=
++ fi
+ fi
+
+ if test x"$FIREFOX_JS_LIBDIR" = x ; then
+@@ -179,35 +151,6 @@ else
+ AC_MSG_RESULT([no])
+ fi
+
+-## 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="$CFLAGS"
+-CFLAGS="$CFLAGS $JS_CFLAGS"
+-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <jsapi.h>]])],
+- [js_extra_cflags_needed=no],
+- [js_extra_cflags_needed=yes])
+-CFLAGS="$save_CFLAGS"
+-AC_MSG_RESULT([$js_extra_cflags_needed])
+-
+-JS_EXTRA_CFLAGS=
+-if test "$js_extra_cflags_needed" = yes; then
+- try_cflags="-I`$PKG_CONFIG --variable=includedir $JS_PACKAGE`/unstable"
+- AC_MSG_CHECKING([if $try_cflags works])
+- save_CFLAGS="$CFLAGS"
+- CFLAGS="$CFLAGS $JS_CFLAGS $try_cflags"
+- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <jsapi.h>]])],
+- [AC_MSG_RESULT([yes])
+- JS_EXTRA_CFLAGS="$try_cflags"],
+- [AC_MSG_RESULT([no])])
+- CFLAGS="$save_CFLAGS"
+-
+- if test x"$JS_EXTRA_CFLAGS" = 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="$CFLAGS"
+ CFLAGS="$CFLAGS $JS_CFLAGS -Wno-unused -Werror"
+@@ -258,27 +201,6 @@ PKG_CHECK_MODULES([GJSTESTS], [$gjstests_packages])
+ GI_DATADIR=$($PKG_CONFIG --variable=gidatadir gobject-introspection-1.0)
+ AC_SUBST(GI_DATADIR)
+
+-if test x"$JS_PACKAGE" = x; then
+- # if JS_PACKAGE is undefined, pkg-config modules don't include
+- # SpiderMonkey and we need to deal with it ourselves
+- GJS_CFLAGS="$GJS_CFLAGS $JS_CFLAGS"
+- GJS_LIBS="$GJS_LIBS $JS_LIBS"
+- GJS_GI_CFLAGS="$GJS_GI_CFLAGS $JS_CFLAGS"
+- GJS_GI_LIBS="$GJS_GI_LIBS $JS_LIBS"
+- GJS_CAIRO_CFLAGS="$GJS_CAIRO_CFLAGS $JS_CFLAGS"
+- GJS_CAIRO_LIBS="$GJS_CAIRO_LIBS $JS_LIBS"
+- GJS_DBUS_CFLAGS="$GJS_DBUS_CFLAGS $JS_CFLAGS"
+- GJS_DBUS_LIBS="$GJS_DBUS_LIBS $JS_LIBS"
+- GJSTESTS_CFLAGS="$GJSTESTS_CFLAGS $JS_CFLAGS"
+- GJSTESTS_LIBS="$GJSTEST_LIBS $JS_LIBS"
+-fi
+-
+-GJS_CFLAGS="$GJS_CFLAGS $JS_EXTRA_CFLAGS"
+-GJS_GI_CFLAGS="$GJS_GI_CFLAGS $JS_EXTRA_CFLAGS"
+-GJS_CAIRO_CFLAGS="$GJS_CAIRO_CFLAGS $JS_EXTRA_CFLAGS"
+-GJS_DBUS_CFLAGS="$GJS_DBUS_CFLAGS $JS_EXTRA_CFLAGS"
+-GJSTESTS_CFLAGS="$GJSTESTS_CFLAGS $JS_EXTRA_CFLAGS"
+-
+ # readline
+ LIBS_no_readline=$LIBS
+
+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=@gjsjsdir@
+ jsnativedir=@gjsnativedir@
+ mozjslibdir=@FIREFOX_JS_LIBDIR@
+
+-Cflags: -I${includedir}/gjs-1.0 @JS_EXTRA_CFLAGS@
++Cflags: -I${includedir}/gjs-1.0
+ Libs: -Wl,--rpath=${mozjslibdir}
+ Requires: gjs-1.0 gobject-introspection-1.0 @JS_PACKAGE@
+
+--
+1.7.3.4
+
diff --git a/dev-libs/gjs/gjs-0.7.13.ebuild b/dev-libs/gjs/gjs-0.7.13.ebuild
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="no"
GNOME2_LA_PUNT="yes"
PYTHON_DEPEND="2"
-inherit gnome2 python
+inherit autotools eutils gnome2 python virtualx
DESCRIPTION="Javascript bindings for GNOME"
HOMEPAGE="http://live.gnome.org/Gjs"
LICENSE="MIT MPL-1.1 LGPL-2 GPL-2"
SLOT="0"
-IUSE="coverage examples"
+IUSE="coverage examples test"
if [[ ${PV} == 9999 ]]; then
inherit gnome2-live
@@ -23,22 +23,20 @@ else
KEYWORDS="~amd64 ~x86"
fi
-# || ( xulrunner spidermonkey ): configure prefers spidermonkey over xulrunner
-# Hence, having older spidermonkey installed will result in bug 353941
RDEPEND=">=dev-libs/glib-2.18:2
>=dev-libs/gobject-introspection-0.10.1
dev-libs/dbus-glib
x11-libs/cairo
- || ( >=net-libs/xulrunner-1.9.2:1.9
- >=dev-lang/spidermonkey-1.9.2 )
- !<dev-lang/spidermonkey-1.9.2"
+ >=net-libs/xulrunner-1.9.2:1.9"
DEPEND="${RDEPEND}
sys-devel/gettext
>=dev-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 installed
src_prepare() {
# AUTHORS, ChangeLog are empty
@@ -46,21 +44,20 @@ src_prepare() {
G2CONF="${G2CONF}
$(use_enable coverage)"
- # If spidermonkey & xulrunner are installed configure prefers spidermonkey.
- # 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} != 9999 ]] && 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
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="no"
GNOME2_LA_PUNT="yes"
PYTHON_DEPEND="2"
-inherit gnome2 python
+inherit autotools eutils gnome2 python virtualx
DESCRIPTION="Javascript bindings for GNOME"
HOMEPAGE="http://live.gnome.org/Gjs"
LICENSE="MIT MPL-1.1 LGPL-2 GPL-2"
SLOT="0"
-IUSE="coverage examples"
+IUSE="coverage examples test"
if [[ ${PV} == 9999 ]]; then
inherit gnome2-live
@@ -23,22 +23,20 @@ else
KEYWORDS="~amd64 ~x86"
fi
-# || ( xulrunner spidermonkey ): configure prefers spidermonkey over xulrunner
-# Hence, having older spidermonkey installed will result in bug 353941
RDEPEND=">=dev-libs/glib-2.18:2
>=dev-libs/gobject-introspection-0.10.1
dev-libs/dbus-glib
x11-libs/cairo
- || ( >=net-libs/xulrunner-1.9.2:1.9
- >=dev-lang/spidermonkey-1.9.2 )
- !<dev-lang/spidermonkey-1.9.2"
+ >=net-libs/xulrunner-1.9.2:1.9"
DEPEND="${RDEPEND}
sys-devel/gettext
>=dev-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 installed
src_prepare() {
# AUTHORS, ChangeLog are empty
@@ -46,21 +44,20 @@ src_prepare() {
G2CONF="${G2CONF}
$(use_enable coverage)"
- # If spidermonkey & xulrunner are installed configure prefers spidermonkey.
- # 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} != 9999 ]] && 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
next reply other threads:[~2011-03-17 3:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-17 3:49 Nirbheek Chauhan [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-05-18 15:36 [gentoo-commits] proj/gnome:master commit in: dev-libs/gjs/, dev-libs/gjs/files/ Nirbheek Chauhan
2011-07-30 4:21 Alexandre Restovtsev
2012-08-27 10:41 Priit Laes
2012-09-15 5:08 Alexandre Rostovtsev
2013-11-24 21:38 Gilles Dartiguelongue
2015-05-10 17:20 Gilles Dartiguelongue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f9d267a212328149be1e2894bfbce02dbe27d9b1.nirbheek@gentoo \
--to=nirbheek@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox