Gentoo Archives: gentoo-commits

From: Alexandre Restovtsev <tetromino@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gnome:gnome-next commit in: dev-libs/gjs/, dev-libs/gjs/files/
Date: Thu, 28 Jul 2011 09:05:45
Message-Id: 554bfda7290919564752566ac567df952c8c2a6a.tetromino@gentoo
1 commit: 554bfda7290919564752566ac567df952c8c2a6a
2 Author: Alexandre Rostovtsev <tetromino <AT> gmail <DOT> com>
3 AuthorDate: Thu Jul 28 08:11:32 2011 +0000
4 Commit: Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
5 CommitDate: Thu Jul 28 08:11:32 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=554bfda7
7
8 dev-libs/gjs: add 1.29.15 with optional spidermonkey support
9
10 Add new gnome-3.1.x version, now with optional support for building
11 against spidermonkey-1.8.5 instead of xulrunner. Requires a patch to
12 make the choice of javascript engine non-automagic (see
13 https://bugzilla.gnome.org/show_bug.cgi?id=655479).
14
15 gjs-1.29.15 passes tests with either choice of javascript engine.
16
17 Note: --enable-systemtap installs things in ${D}/${D}, leading to QA
18 failures. Need to figure out what's going on there.
19
20 ---
21 .../files/gjs-1.29.15-automagic-spidermonkey.patch | 126 ++++++++++++++++++++
22 .../gjs/{gjs-9999.ebuild => gjs-1.29.15.ebuild} | 31 ++++--
23 dev-libs/gjs/gjs-9999.ebuild | 31 ++++--
24 3 files changed, 170 insertions(+), 18 deletions(-)
25
26 diff --git a/dev-libs/gjs/files/gjs-1.29.15-automagic-spidermonkey.patch b/dev-libs/gjs/files/gjs-1.29.15-automagic-spidermonkey.patch
27 new file mode 100644
28 index 0000000..5dd4321
29 --- /dev/null
30 +++ b/dev-libs/gjs/files/gjs-1.29.15-automagic-spidermonkey.patch
31 @@ -0,0 +1,126 @@
32 +From 57e3cd2303f8d36ae232ec3df986d986f1457361 Mon Sep 17 00:00:00 2001
33 +From: Alexandre Rostovtsev <tetromino@×××××.com>
34 +Date: Thu, 28 Jul 2011 03:40:49 -0400
35 +Subject: [PATCH] Make choice of javascript package non-automagic
36 +
37 +Add a --with-js-package configure flag to allow selecting which
38 +javascript package to build against, e.g. to force building against
39 +xulrunner on a system that happens to have spidermonkey installed.
40 +
41 +By default, the behavior is the same as before (first check for
42 +mozjs185, then for mozilla-js).
43 +
44 +Addresses bug
45 +---
46 + configure.ac | 84 +++++++++++++++++++++++++++++++++------------------------
47 + 1 files changed, 49 insertions(+), 35 deletions(-)
48 +
49 +diff --git a/configure.ac b/configure.ac
50 +index 3b74bc6..38213e3 100644
51 +--- a/configure.ac
52 ++++ b/configure.ac
53 +@@ -91,52 +91,66 @@ m4_define(gobject_required_version, 2.18.0)
54 + AC_CHECK_HEADERS([malloc.h])
55 + AC_CHECK_FUNCS(mallinfo)
56 +
57 +-# First, try separate mozjs185 release
58 +-AC_MSG_CHECKING([for standalone mozjs185])
59 +-PKG_CHECK_EXISTS([mozjs185], JS_PACKAGE=mozjs185,)
60 +-if test x$JS_PACKAGE != x; then
61 +- FIREFOX_JS_LIBDIR=
62 +- MOZJS_IS_STANDALONE=yes
63 +- AC_MSG_RESULT([yes])
64 +- PKG_CHECK_MODULES(JS, $JS_PACKAGE)
65 +-else
66 +- AC_MSG_RESULT([no])
67 +-fi
68 ++AC_ARG_WITH([js-package],
69 ++ AS_HELP_STRING([--with-js-package[=@<:@auto/mozjs185/mozilla-js@:>@]],
70 ++ [Choose JavaScript package: 'mozjs185' (i.e. spidermonkey), 'mozilla-js' (i.e. xulrunner or firefox), or 'auto' (detect automatically)]),
71 ++ [with_js_package=$withval],
72 ++ [with_js_package="auto"])
73 +
74 +-# If we didn't find mozjs185 (the standalone spidermonkey), look for mozilla-js
75 +-if test x$JS_PACKAGE = x; then
76 +- AC_MSG_CHECKING([for mozilla-js 1.9.2])
77 +- PKG_CHECK_EXISTS([mozilla-js >= 1.9.2], JS_PACKAGE=mozilla-js,)
78 ++# First, try separate mozjs185 release
79 ++if test $with_js_package = mozjs185 -o $with_js_package = auto; then
80 ++ AC_MSG_CHECKING([for standalone mozjs185])
81 ++ PKG_CHECK_EXISTS([mozjs185], JS_PACKAGE=mozjs185,)
82 + if test x$JS_PACKAGE != x; then
83 ++ FIREFOX_JS_LIBDIR=
84 ++ MOZJS_IS_STANDALONE=yes
85 + AC_MSG_RESULT([yes])
86 ++ PKG_CHECK_MODULES(JS, $JS_PACKAGE)
87 + else
88 +- AC_MSG_ERROR([Could not find mozilla-js 1.9.2])
89 ++ AC_MSG_RESULT([no])
90 + fi
91 ++fi
92 +
93 +- PKG_CHECK_MODULES(JS, $JS_PACKAGE)
94 +-
95 +- ## some flavors of Firefox .pc only set sdkdir, not libdir
96 +- FIREFOX_JS_SDKDIR=`$PKG_CONFIG --variable=sdkdir $JS_PACKAGE`
97 +- FIREFOX_JS_LIBDIR=`$PKG_CONFIG --variable=libdir $JS_PACKAGE`
98 +-
99 +- ## Ubuntu does not set libdir in mozilla-js.pc
100 +- if test x"$FIREFOX_JS_LIBDIR" = x; then
101 +- ## Ubuntu returns xulrunner-devel as the sdkdir, but for the
102 +- ## libdir we want the runtime location on the target system,
103 +- ## so can't use -devel.
104 +- ## The library is in the non-devel directory also.
105 +- ## Don't ask me why it's in two places.
106 +- FIREFOX_JS_LIBDIR=`echo "$FIREFOX_JS_SDKDIR" | sed -e 's/-devel//g'`
107 +- if ! test -d "$FIREFOX_JS_LIBDIR"; then
108 +- FIREFOX_JS_LIBDIR=
109 ++if test $with_js_package = mozilla-js -o $with_js_package = auto; then
110 ++ # If we didn't find mozjs185 (the standalone spidermonkey), look for mozilla-js
111 ++ if test x$JS_PACKAGE = x; then
112 ++ AC_MSG_CHECKING([for mozilla-js 1.9.2])
113 ++ PKG_CHECK_EXISTS([mozilla-js >= 1.9.2], JS_PACKAGE=mozilla-js,)
114 ++ if test x$JS_PACKAGE != x; then
115 ++ AC_MSG_RESULT([yes])
116 ++ else
117 ++ AC_MSG_ERROR([Could not find mozilla-js 1.9.2])
118 ++ fi
119 ++
120 ++ PKG_CHECK_MODULES(JS, $JS_PACKAGE)
121 ++
122 ++ ## some flavors of Firefox .pc only set sdkdir, not libdir
123 ++ FIREFOX_JS_SDKDIR=`$PKG_CONFIG --variable=sdkdir $JS_PACKAGE`
124 ++ FIREFOX_JS_LIBDIR=`$PKG_CONFIG --variable=libdir $JS_PACKAGE`
125 ++
126 ++ ## Ubuntu does not set libdir in mozilla-js.pc
127 ++ if test x"$FIREFOX_JS_LIBDIR" = x; then
128 ++ ## Ubuntu returns xulrunner-devel as the sdkdir, but for the
129 ++ ## libdir we want the runtime location on the target system,
130 ++ ## so can't use -devel.
131 ++ ## The library is in the non-devel directory also.
132 ++ ## Don't ask me why it's in two places.
133 ++ FIREFOX_JS_LIBDIR=`echo "$FIREFOX_JS_SDKDIR" | sed -e 's/-devel//g'`
134 ++ if ! test -d "$FIREFOX_JS_LIBDIR"; then
135 ++ FIREFOX_JS_LIBDIR=
136 ++ fi
137 + fi
138 +- fi
139 +
140 +- if test x"$FIREFOX_JS_LIBDIR" = x; then
141 +- AC_MSG_ERROR([Could not figure out where the Firefox JavaScript library lives])
142 ++ if test x"$FIREFOX_JS_LIBDIR" = x; then
143 ++ AC_MSG_ERROR([Could not figure out where the Firefox JavaScript library lives])
144 ++ fi
145 + fi
146 + fi
147 +
148 ++if test x$JS_PACKAGE = x; then
149 ++ AC_MSG_ERROR([No appropriate JavaScript package found])
150 ++fi
151 ++
152 + echo "Using JS_PACKAGE: $JS_PACKAGE"
153 + echo "Using JS_CFLAGS: $JS_CFLAGS"
154 + echo "Using JS_LIBS: $JS_LIBS"
155 +--
156 +1.7.6
157 +
158
159 diff --git a/dev-libs/gjs/gjs-9999.ebuild b/dev-libs/gjs/gjs-1.29.15.ebuild
160 similarity index 60%
161 copy from dev-libs/gjs/gjs-9999.ebuild
162 copy to dev-libs/gjs/gjs-1.29.15.ebuild
163 index 184e21c..93f6ece 100644
164 --- a/dev-libs/gjs/gjs-9999.ebuild
165 +++ b/dev-libs/gjs/gjs-1.29.15.ebuild
166 @@ -1,9 +1,10 @@
167 # Copyright 1999-2011 Gentoo Foundation
168 # Distributed under the terms of the GNU General Public License v2
169 -# $Header: $
170 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/gjs/gjs-1.29.0.ebuild,v 1.1 2011/06/14 13:19:59 nirbheek Exp $
171
172 EAPI="3"
173 GCONF_DEBUG="no"
174 +GNOME_TARBALL_SUFFIX="xz"
175 GNOME2_LA_PUNT="yes"
176 PYTHON_DEPEND="2"
177
178 @@ -17,38 +18,50 @@ HOMEPAGE="http://live.gnome.org/Gjs"
179
180 LICENSE="MIT MPL-1.1 LGPL-2 GPL-2"
181 SLOT="0"
182 -IUSE="examples test"
183 -
184 -if [[ ${PV} == 9999 ]]; then
185 +IUSE="examples spidermonkey test"
186 +if [[ ${PV} = 9999 ]]; then
187 KEYWORDS=""
188 else
189 KEYWORDS="~amd64 ~x86"
190 fi
191
192 # Things are untested and broken with anything other than xulrunner-2.0
193 +# or spidermonkey-1.8.5
194 RDEPEND=">=dev-libs/glib-2.18:2
195 - >=dev-libs/gobject-introspection-0.10.1
196 + >=dev-libs/gobject-introspection-1.29.15
197
198 dev-libs/dbus-glib
199 sys-libs/readline
200 x11-libs/cairo
201 - >=net-libs/xulrunner-2.0:1.9"
202 + spidermonkey? ( =dev-lang/spidermonkey-1.8.5* )
203 + !spidermonkey? ( >=net-libs/xulrunner-2.0:1.9 )"
204 DEPEND="${RDEPEND}
205 sys-devel/gettext
206 >=dev-util/pkgconfig-0.9
207 - !dev-lang/spidermonkey"
208 -# HACK HACK: gjs-tests picks up /usr/lib/libmozjs.so with spidermonkey installed
209 + !<dev-lang/spidermonkey-1.8.5"
210 +# HACK HACK: gjs-tests picks up /usr/lib/libmozjs.so with old spidermonkey installed
211
212 -src_prepare() {
213 +pkg_setup() {
214 # AUTHORS, ChangeLog are empty
215 DOCS="NEWS README"
216 # FIXME: add systemtap/dtrace support, like in glib:2
217 + # FIXME: --enable-systemtap installs files in ${D}/${D} for some reason
218 # XXX: Do NOT enable coverage, completely useless for portage installs
219 G2CONF="${G2CONF}
220 --disable-systemtap
221 --disable-dtrace
222 --disable-coverage"
223 + if use spidermonkey; then
224 + G2CONF="${G2CONF} --with-js-package=mozjs185"
225 + else
226 + G2CONF="${G2CONF} --with-js-package=mozilla-js"
227 + fi
228 +}
229
230 +src_prepare() {
231 + # Make spidermonkey detection non-automagic
232 + # https://bugzilla.gnome.org/show_bug.cgi?id=655479
233 + epatch "${FILESDIR}/${PN}-1.29.15-automagic-spidermonkey.patch"
234 [[ ${PV} != 9999 ]] && eautoreconf
235
236 gnome2_src_prepare
237
238 diff --git a/dev-libs/gjs/gjs-9999.ebuild b/dev-libs/gjs/gjs-9999.ebuild
239 index 184e21c..93f6ece 100644
240 --- a/dev-libs/gjs/gjs-9999.ebuild
241 +++ b/dev-libs/gjs/gjs-9999.ebuild
242 @@ -1,9 +1,10 @@
243 # Copyright 1999-2011 Gentoo Foundation
244 # Distributed under the terms of the GNU General Public License v2
245 -# $Header: $
246 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/gjs/gjs-1.29.0.ebuild,v 1.1 2011/06/14 13:19:59 nirbheek Exp $
247
248 EAPI="3"
249 GCONF_DEBUG="no"
250 +GNOME_TARBALL_SUFFIX="xz"
251 GNOME2_LA_PUNT="yes"
252 PYTHON_DEPEND="2"
253
254 @@ -17,38 +18,50 @@ HOMEPAGE="http://live.gnome.org/Gjs"
255
256 LICENSE="MIT MPL-1.1 LGPL-2 GPL-2"
257 SLOT="0"
258 -IUSE="examples test"
259 -
260 -if [[ ${PV} == 9999 ]]; then
261 +IUSE="examples spidermonkey test"
262 +if [[ ${PV} = 9999 ]]; then
263 KEYWORDS=""
264 else
265 KEYWORDS="~amd64 ~x86"
266 fi
267
268 # Things are untested and broken with anything other than xulrunner-2.0
269 +# or spidermonkey-1.8.5
270 RDEPEND=">=dev-libs/glib-2.18:2
271 - >=dev-libs/gobject-introspection-0.10.1
272 + >=dev-libs/gobject-introspection-1.29.15
273
274 dev-libs/dbus-glib
275 sys-libs/readline
276 x11-libs/cairo
277 - >=net-libs/xulrunner-2.0:1.9"
278 + spidermonkey? ( =dev-lang/spidermonkey-1.8.5* )
279 + !spidermonkey? ( >=net-libs/xulrunner-2.0:1.9 )"
280 DEPEND="${RDEPEND}
281 sys-devel/gettext
282 >=dev-util/pkgconfig-0.9
283 - !dev-lang/spidermonkey"
284 -# HACK HACK: gjs-tests picks up /usr/lib/libmozjs.so with spidermonkey installed
285 + !<dev-lang/spidermonkey-1.8.5"
286 +# HACK HACK: gjs-tests picks up /usr/lib/libmozjs.so with old spidermonkey installed
287
288 -src_prepare() {
289 +pkg_setup() {
290 # AUTHORS, ChangeLog are empty
291 DOCS="NEWS README"
292 # FIXME: add systemtap/dtrace support, like in glib:2
293 + # FIXME: --enable-systemtap installs files in ${D}/${D} for some reason
294 # XXX: Do NOT enable coverage, completely useless for portage installs
295 G2CONF="${G2CONF}
296 --disable-systemtap
297 --disable-dtrace
298 --disable-coverage"
299 + if use spidermonkey; then
300 + G2CONF="${G2CONF} --with-js-package=mozjs185"
301 + else
302 + G2CONF="${G2CONF} --with-js-package=mozilla-js"
303 + fi
304 +}
305
306 +src_prepare() {
307 + # Make spidermonkey detection non-automagic
308 + # https://bugzilla.gnome.org/show_bug.cgi?id=655479
309 + epatch "${FILESDIR}/${PN}-1.29.15-automagic-spidermonkey.patch"
310 [[ ${PV} != 9999 ]] && eautoreconf
311
312 gnome2_src_prepare