Gentoo Archives: gentoo-commits

From: Ian Stakenvicius <axs@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/mozilla:master commit in: www-client/firefox/, eclass/
Date: Thu, 23 Jul 2015 16:05:50
Message-Id: 1437667533.230613586cd9faaee7e7af9036448173b51a48ed.axs@gentoo
1 commit: 230613586cd9faaee7e7af9036448173b51a48ed
2 Author: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jul 23 16:05:33 2015 +0000
4 Commit: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 23 16:05:33 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=23061358
7
8 Added option of IUSE=gtk3 to mozconfig, and a firefox-40 beta with the GTK3 use flag option enabled
9
10 eclass/mozconfig-v6.40.eclass | 263 ++++++++++++++++++
11 www-client/firefox/Manifest | 12 +-
12 www-client/firefox/firefox-40.0_beta6.ebuild | 402 +++++++++++++++++++++++++++
13 3 files changed, 667 insertions(+), 10 deletions(-)
14
15 diff --git a/eclass/mozconfig-v6.40.eclass b/eclass/mozconfig-v6.40.eclass
16 new file mode 100644
17 index 0000000..c305db2
18 --- /dev/null
19 +++ b/eclass/mozconfig-v6.40.eclass
20 @@ -0,0 +1,263 @@
21 +# Copyright 1999-2015 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +# $Header: /var/cvsroot/gentoo-x86/eclass/mozconfig-v5.38.eclass,v 1.1 2015/05/27 19:00:31 axs Exp $
24 +#
25 +# @ECLASS: mozconfig-v5.33.eclass
26 +# @MAINTAINER:
27 +# mozilla team <mozilla@g.o>
28 +# @BLURB: the new mozilla common configuration eclass for FF33 and newer, v5
29 +# @DESCRIPTION:
30 +# This eclass is used in mozilla ebuilds (firefox, thunderbird, seamonkey)
31 +# to provide a single common place for the common mozilla engine compoments.
32 +#
33 +# The eclass provides all common dependencies as well as common use flags.
34 +#
35 +# Some use flags which may be optional in particular mozilla packages can be
36 +# supported through setting eclass variables.
37 +#
38 +# This eclass inherits mozconfig helper functions as defined in mozcoreconf-v3,
39 +# and so ebuilds inheriting this eclass do not need to inherit that.
40 +
41 +inherit multilib flag-o-matic toolchain-funcs mozcoreconf-v3
42 +
43 +case ${EAPI} in
44 + 0|1|2|3|4) die "EAPI=${EAPI} not supported"
45 +esac
46 +
47 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_WIFI
48 +# @DESCRIPTION:
49 +# Set this variable before the inherit line, when an ebuild needs to provide
50 +# optional necko-wifi support via IUSE="wifi". Currently this would include
51 +# ebuilds for firefox, and potentially seamonkey.
52 +#
53 +# Leave the variable UNSET if necko-wifi support should not be available.
54 +# Set the variable to "enabled" if the use flag should be enabled by default.
55 +# Set the variable to any value if the use flag should exist but not be default-enabled.
56 +
57 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_JIT
58 +# @DESCRIPTION:
59 +# Set this variable before the inherit line, when an ebuild needs to provide
60 +# optional necko-wifi support via IUSE="jit". Currently this would include
61 +# ebuilds for firefox, and potentially seamonkey.
62 +#
63 +# Leave the variable UNSET if optional jit support should not be available.
64 +# Set the variable to "enabled" if the use flag should be enabled by default.
65 +# Set the variable to any value if the use flag should exist but not be default-enabled.
66 +
67 +# @ECLASS-VARIABLE: MOZCONFIG_OPTIONAL_GTK3
68 +# @DESCRIPTION:
69 +# Set this variable before the inherit line, when an ebuild can provide
70 +# optional gtk3 support via IUSE="gtk3". Currently this would include
71 +# ebuilds for firefox, but thunderbird and seamonkey could follow in the future.
72 +#
73 +# Leave the variable UNSET if gtk3 support should not be available.
74 +# Set the variable to "enabled" if the use flag should be enabled by default.
75 +# Set the variable to any value if the use flag should exist but not be default-enabled.
76 +
77 +# use-flags common among all mozilla ebuilds
78 +IUSE="${IUSE} dbus debug gstreamer gstreamer-0 +jemalloc3 pulseaudio selinux startup-notification system-cairo system-icu system-jpeg system-sqlite system-libvpx"
79 +
80 +# some notes on deps:
81 +# gtk:2 minimum is technically 2.10 but gio support (enabled by default) needs 2.14
82 +# media-libs/mesa needs to be 10.2 or above due to a bug with flash+vdpau
83 +
84 +RDEPEND=">=app-text/hunspell-1.2
85 + dev-libs/atk
86 + dev-libs/expat
87 + >=dev-libs/libevent-1.4.7
88 + >=x11-libs/cairo-1.10[X]
89 + >=x11-libs/gtk+-2.18:2
90 + x11-libs/gdk-pixbuf
91 + >=x11-libs/pango-1.22.0
92 + >=media-libs/libpng-1.6.17:0=[apng]
93 + >=media-libs/mesa-10.2:*
94 + media-libs/fontconfig
95 + >=media-libs/freetype-2.4.10
96 + kernel_linux? ( media-libs/alsa-lib )
97 + pulseaudio? ( media-sound/pulseaudio )
98 + virtual/freedesktop-icon-theme
99 + dbus? ( >=sys-apps/dbus-0.60
100 + >=dev-libs/dbus-glib-0.72 )
101 + startup-notification? ( >=x11-libs/startup-notification-0.8 )
102 + >=dev-libs/glib-2.26:2
103 + >=sys-libs/zlib-1.2.3
104 + >=virtual/libffi-3.0.10
105 + gstreamer? (
106 + >=media-libs/gstreamer-1.4.5:1.0
107 + >=media-libs/gst-plugins-base-1.4.5:1.0
108 + >=media-libs/gst-plugins-good-1.4.5:1.0
109 + >=media-plugins/gst-plugins-libav-1.4.5:1.0
110 + )
111 + gstreamer-0? (
112 + >=media-libs/gstreamer-0.10.25:0.10
113 + media-plugins/gst-plugins-meta:0.10[ffmpeg]
114 + )
115 + x11-libs/libX11
116 + x11-libs/libXcomposite
117 + x11-libs/libXdamage
118 + x11-libs/libXext
119 + x11-libs/libXfixes
120 + x11-libs/libXrender
121 + x11-libs/libXt
122 + system-cairo? ( >=x11-libs/cairo-1.12[X] >=x11-libs/pixman-0.19.2 )
123 + system-icu? ( >=dev-libs/icu-51.1:= )
124 + system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
125 + system-sqlite? ( >=dev-db/sqlite-3.8.9:3[secure-delete,debug=] )
126 + system-libvpx? ( >=media-libs/libvpx-1.3.0[postproc] )
127 +"
128 +
129 +if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
130 + if [[ ${MOZCONFIG_OPTIONAL_GTK3} = "enabled" ]]; then
131 + IUSE+=" +gtk3"
132 + else
133 + IUSE+=" gtk3"
134 + fi
135 + RDEPEND+="
136 + gtk3? ( >=x11-libs/gtk+-3.14.0:3 )"
137 +fi
138 +if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]]; then
139 + if [[ ${MOZCONFIG_OPTIONAL_WIFI} = "enabled" ]]; then
140 + IUSE+=" +wifi"
141 + else
142 + IUSE+=" wifi"
143 + fi
144 + RDEPEND+="
145 + wifi? ( >=sys-apps/dbus-0.60
146 + >=dev-libs/dbus-glib-0.72
147 + net-wireless/wireless-tools )"
148 +fi
149 +if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
150 + if [[ ${MOZCONFIG_OPTIONAL_JIT} = "enabled" ]]; then
151 + IUSE+=" +jit"
152 + else
153 + IUSE+=" jit"
154 + fi
155 +fi
156 +
157 +DEPEND="app-arch/zip
158 + app-arch/unzip
159 + >=sys-devel/binutils-2.16.1
160 + ${RDEPEND}"
161 +
162 +RDEPEND+="
163 + selinux? ( sec-policy/selinux-mozilla )"
164 +
165 +# only one of gstreamer and gstreamer-0 can be enabled at a time, so set REQUIRED_USE to signify this
166 +REQUIRED_USE="?? ( gstreamer gstreamer-0 )"
167 +
168 +# @FUNCTION: mozconfig_config
169 +# @DESCRIPTION:
170 +# Set common configure options for mozilla packages.
171 +# Call this within src_configure() phase, after mozconfig_init
172 +#
173 +# Example:
174 +#
175 +# inherit mozconfig-v5.33
176 +#
177 +# src_configure() {
178 +# mozconfig_init
179 +# mozconfig_config
180 +# # ... misc ebuild-unique settings via calls to
181 +# # ... mozconfig_{annotate,use_with,use_enable}
182 +# mozconfig_final
183 +# }
184 +
185 +mozconfig_config() {
186 + # Migrated from mozcoreconf-2
187 + mozconfig_annotate 'system_libs' \
188 + --with-system-zlib \
189 + --enable-pango \
190 + --enable-svg \
191 + --with-system-bz2
192 +
193 + if [[ -n ${MOZCONFIG_OPTIONAL_GTK3} ]]; then
194 + mozconfig_annotate 'gtk3 use flag' --enable-default-toolkit=$(usex gtk3 cairo-gtk3 cairo-gtk2)
195 + else
196 + mozconfig_annotate '' --enable-default-toolkit=cairo-gtk2
197 + fi
198 +
199 + if has bindist ${IUSE}; then
200 + mozconfig_use_enable !bindist official-branding
201 + if [[ ${PN} == firefox ]] && use bindist ; then
202 + mozconfig_annotate '' --with-branding=browser/branding/aurora
203 + fi
204 + fi
205 +
206 + mozconfig_use_enable debug
207 + mozconfig_use_enable debug tests
208 +
209 + if ! use debug ; then
210 + mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
211 + else
212 + mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
213 + fi
214 +
215 + mozconfig_use_enable startup-notification
216 +
217 + if [[ -n ${MOZCONFIG_OPTIONAL_WIFI} ]] ; then
218 + # wifi pulls in dbus so manage both here
219 + mozconfig_use_enable wifi necko-wifi
220 + if use wifi && ! use dbus; then
221 + echo "Enabling dbus support due to wifi request"
222 + mozconfig_annotate 'dbus required by necko-wifi' --enable-dbus
223 + else
224 + mozconfig_use_enable dbus
225 + fi
226 + else
227 + mozconfig_use_enable dbus
228 + mozconfig_annotate 'disabled' --disable-necko-wifi
229 + fi
230 +
231 + # These are forced-on for webm support
232 + mozconfig_annotate 'required' --enable-ogg
233 + mozconfig_annotate 'required' --enable-wave
234 +
235 + if [[ -n ${MOZCONFIG_OPTIONAL_JIT} ]]; then
236 + mozconfig_use_enable jit ion
237 + fi
238 +
239 + # These are enabled by default in all mozilla applications
240 + mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
241 + mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
242 + mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
243 + mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
244 + mozconfig_annotate '' --prefix="${EPREFIX}"/usr
245 + mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
246 + mozconfig_annotate 'Gentoo default' --enable-system-hunspell
247 + mozconfig_annotate '' --disable-gnomevfs
248 + mozconfig_annotate '' --disable-gnomeui
249 + mozconfig_annotate '' --enable-gio
250 + mozconfig_annotate '' --disable-crashreporter
251 + mozconfig_annotate 'Gentoo default' --with-system-png
252 + mozconfig_annotate '' --enable-system-ffi
253 + mozconfig_annotate 'Gentoo default to honor system linker' --disable-gold
254 + mozconfig_annotate '' --disable-gconf
255 +
256 + # Use jemalloc unless libc is not glibc >= 2.4
257 + # at this time the minimum glibc in the tree is 2.9 so we should be safe.
258 + if use elibc_glibc && use jemalloc3; then
259 + # We must force-enable jemalloc 3 via .mozconfig
260 + echo "export MOZ_JEMALLOC3=1" >> "${S}"/.mozconfig || die
261 + mozconfig_annotate '' --enable-jemalloc
262 + mozconfig_annotate '' --enable-replace-malloc
263 + fi
264 +
265 + mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
266 + mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
267 +
268 + if use gstreamer ; then
269 + mozconfig_annotate '+gstreamer' --enable-gstreamer=1.0
270 + elif use gstreamer-0 ; then
271 + mozconfig_annotate '+gstreamer-0' --enable-gstreamer=0.10
272 + else
273 + mozconfig_annotate '' --disable-gstreamer
274 + fi
275 + mozconfig_use_enable pulseaudio
276 +
277 + mozconfig_use_enable system-cairo
278 + mozconfig_use_enable system-sqlite
279 + mozconfig_use_with system-jpeg
280 + mozconfig_use_with system-icu
281 + mozconfig_use_enable system-icu intl-api
282 + mozconfig_use_with system-libvpx
283 +}
284
285 diff --git a/www-client/firefox/Manifest b/www-client/firefox/Manifest
286 index 8a37bc6..66f8d7b 100644
287 --- a/www-client/firefox/Manifest
288 +++ b/www-client/firefox/Manifest
289 @@ -1,6 +1,3 @@
290 ------BEGIN PGP SIGNED MESSAGE-----
291 -Hash: SHA256
292 -
293 DIST firefox-38.0-patches-0.3.tar.xz 4796 SHA256 bfbef81748f76f5f80c3ce6e6b810b65f6266f71da02722b1e8c9fad865b02bd SHA512 a974e33759246153db7d83488f1326275efd12c44a6c8c539cbc35709b4dbd27e848bda32f302ac2baa5d8729ba20579ebc7f643419757f542972ca1a264d520 WHIRLPOOL 3549239db380c02a1575ff407ea684a14827f2250d991b5eb6c8a341ceebaca57cd2cc422e160f00dfab933385d677574cd84947da07bd282c68bb84c40fa42b
294 DIST firefox-38.1.0esr-af.xpi 483325 SHA256 1a4c6835db2ba384767f6ceddf021a30b61c1d29f17577cf2f7330e3358c9ff7 SHA512 44c08b31c3c1c3160c4e992a01bb2eeb30c8177956b29d09be336970521a7671f1847dd88122973236f34bd5559a9d69bdefc271386f6cda8edf90be520f34e1 WHIRLPOOL a104dfcfd811424d53e1bb4d85d20b7a4d56dff6275d94ac180073f5abc770bf81e0cfa6fa7a6a98f29bc76b687e58071a4c7dbea51a638019a3e6fb5295864f
295 DIST firefox-38.1.0esr-ar.xpi 516495 SHA256 47eef2d1bfa6e5594cd8835bddca7bfd5019aac1553b54b05c1c749fad659dda SHA512 156891397a303d80833bcfdb459ff79f252257c5b9a7d9af5df334772b855f3c19d82af8daf3b6a1c205d63cc508fc57a75b85c756e22813b7a680784cf5289d WHIRLPOOL 2d8ab97d91087bafeeea01174da694d8de9e12fb0854e5b770f80822f1b72246c65ae7d6f7c993908883bf138fc6732f6aa62f40263b42f609506001a3dd39b1
296 @@ -162,10 +159,5 @@ DIST firefox-39.0-xh.xpi 454916 SHA256 8d66c08160c6a2e3860bca6cc7d9c87b653c97c70
297 DIST firefox-39.0-zh-CN.xpi 492380 SHA256 a7e959d6aba6f67b880b9ebcc1d1c2e253f01e079475191dc3eef978a9d9b2b5 SHA512 cb4e8c6f813692b66d2f86c454b25b129308ccf68e830f0b7c104340858f0b2fc7472a7e0ba1fbe093a05ac0c07e2d5cedf390abf4b1b4b74b68d45b43ca6ec7 WHIRLPOOL dc5a3f3e80712986203a9d6e8883378e3de72f1a365649e601526a4b36286f9fbe29e181ea55bd6b221bbf5a53951ce0818888a886654d5147591bacd3b5dcaa
298 DIST firefox-39.0-zh-TW.xpi 471887 SHA256 ec30c554c57aa27835723253f4c0dfc4fc75ca591f9a64fbd65f7622d7b212dd SHA512 6f247e71d3b6d232972a538517a9d148d30ecfd24efa4a4851b52a3db7a079ef039473be8596e09236009b785f84f98c82a01c7013cfc0e2333ff4dbfdff0a1f WHIRLPOOL 735fde774086000d85e9718b498aad5fbbc5e7df6105c34d33a67210a119aae748dcb3dbe11039057b0cea242640f257883131a341895dc4acfbfdacf4681736
299 DIST firefox-39.0.source.tar.bz2 182881881 SHA256 7e25014deb926df9220c3ab40ac6816c13a04c4cf7bd89b08fc1743307df1096 SHA512 963dbf48c077659edd49868e2e11600ba232a7cbf35e4acb20f10b878f2d2278e3d33c9eaa9272a07b7b6e2e565e4b40ebc269a128935ee4e044857c828dbc50 WHIRLPOOL 7c67f401c4fb1c5f194f4c9c90af3583622eea36ed14840ea24ec2c4f007407bb984488e6fddc161b399de30511bed70f93000de4c94f837c23e822a67e72ec7
300 ------BEGIN PGP SIGNATURE-----
301 -Version: GnuPG v2
302 -
303 -iF4EAREIAAYFAlWarpsACgkQAJxUfCtlWe2J4gEAioxOLNbMyBnyPrvAyvTNGrxx
304 -TNhZjn+yPD//oPpFpQkBAKNaEeny1l6UhCpGjN+2B8KUSY9Ggc7Jmv2ylJ3yVSFo
305 -=fKlR
306 ------END PGP SIGNATURE-----
307 +DIST firefox-40.0-patches-0.01.tar.xz 5144 SHA256 072c44c79ba82d04958b3fc3d1c6e90805cf71797a03b96961fd3a16bd14c3a7 SHA512 bb9ca395ee380e6ec21fefadc5c5052ce8490039577ac0245bcee309686e802a654a999b3aeeaf8d97573f102fba3620c9995ec145ddcdded2ee9487490f87f9 WHIRLPOOL e74ed6af06e61baaf0991d23849739fb8c1cb33c800467e76d1c15ae22360c18c757ac9f19d274ca9cc54a6f9a0d17f365bd815b4a35c94766b29980638e8c91
308 +DIST firefox-40.0b6.source.tar.bz2 178418614 SHA256 2f6db263842ccfb06b249d60f9aaba0885a253e70977a20fa895c700537f6340 SHA512 13326495f5887de17e346aa9591e9c60343909601e89a5863ccddbc551fd68d21352d3dd67f41a7e68341a8e9ce769f21ac3c67f8e081014b10e60ec52e948fe WHIRLPOOL f5810c6bf96a99a5c93fbaa4983e5a7fb390910e23c1ab8271c86e00e4586776badee83db452494de78bb9f425f4bf76cffb21df17055638b2b34dea542b876e
309
310 diff --git a/www-client/firefox/firefox-40.0_beta6.ebuild b/www-client/firefox/firefox-40.0_beta6.ebuild
311 new file mode 100644
312 index 0000000..45e21ca
313 --- /dev/null
314 +++ b/www-client/firefox/firefox-40.0_beta6.ebuild
315 @@ -0,0 +1,402 @@
316 +# Copyright 1999-2015 Gentoo Foundation
317 +# Distributed under the terms of the GNU General Public License v2
318 +# $Header: $
319 +
320 +EAPI="5"
321 +VIRTUALX_REQUIRED="pgo"
322 +WANT_AUTOCONF="2.1"
323 +MOZ_ESR=""
324 +
325 +# This list can be updated with scripts/get_langs.sh from the mozilla overlay
326 +# No official support as of fetch time
327 +# csb
328 +MOZ_LANGS=( af ar as ast be bg bn-BD bn-IN br bs ca cs cy da de el en
329 +en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa fi fr fy-NL ga-IE gd
330 +gl gu-IN he hi-IN hr hu hy-AM id is it ja kk km kn ko lt lv mai mk ml mr
331 +nb-NO nl nn-NO or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta te
332 +th tr uk vi xh zh-CN zh-TW )
333 +
334 +# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
335 +MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
336 +MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
337 +MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
338 +
339 +if [[ ${MOZ_ESR} == 1 ]]; then
340 + # ESR releases have slightly version numbers
341 + MOZ_PV="${MOZ_PV}esr"
342 +fi
343 +
344 +# Patch version
345 +PATCH="${PN}-40.0-patches-0.01"
346 +# Upstream ftp release URI that's used by mozlinguas.eclass
347 +# We don't use the http mirror because it deletes old tarballs.
348 +MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases"
349 +MOZ_HTTP_URI="http://ftp.mozilla.org/pub/${PN}/releases"
350 +
351 +MOZCONFIG_OPTIONAL_GTK3=1
352 +MOZCONFIG_OPTIONAL_WIFI=1
353 +MOZCONFIG_OPTIONAL_JIT="enabled"
354 +
355 +inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v6.40 multilib pax-utils fdo-mime autotools virtualx mozlinguas
356 +
357 +DESCRIPTION="Firefox Web Browser"
358 +HOMEPAGE="http://www.mozilla.com/firefox"
359 +
360 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
361 +
362 +SLOT="0"
363 +LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
364 +IUSE="bindist egl hardened +minimal neon pgo selinux +gmp-autoupdate test"
365 +RESTRICT="!bindist? ( bindist )"
366 +
367 +# More URIs appended below...
368 +SRC_URI="${SRC_URI}
369 + http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
370 + http://dev.gentoo.org/~axs/distfiles/${PATCH}.tar.xz
371 + http://dev.gentoo.org/~polynomial-c/mozilla/patchsets/${PATCH}.tar.xz"
372 +
373 +ASM_DEPEND=">=dev-lang/yasm-1.1"
374 +
375 +# Mesa 7.10 needed for WebGL + bugfixes
376 +RDEPEND="
377 + >=dev-libs/nss-3.19.2
378 + >=dev-libs/nspr-4.10.8
379 + selinux? ( sec-policy/selinux-mozilla )"
380 +
381 +DEPEND="${RDEPEND}
382 + pgo? (
383 + >=sys-devel/gcc-4.5 )
384 + amd64? ( ${ASM_DEPEND}
385 + virtual/opengl )
386 + x86? ( ${ASM_DEPEND}
387 + virtual/opengl )"
388 +
389 +# No source releases for alpha|beta
390 +if [[ ${PV} =~ alpha ]]; then
391 + CHANGESET="8a3042764de7"
392 + SRC_URI="${SRC_URI}
393 + http://dev.gentoo.org/~nirbheek/mozilla/firefox/firefox-${MOZ_PV}_${CHANGESET}.source.tar.bz2"
394 + S="${WORKDIR}/mozilla-aurora-${CHANGESET}"
395 +elif [[ ${PV} =~ beta ]]; then
396 + S="${WORKDIR}/mozilla-beta"
397 + SRC_URI="${SRC_URI}
398 + ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
399 + ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
400 +else
401 + SRC_URI="${SRC_URI}
402 + ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
403 + ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
404 + if [[ ${MOZ_ESR} == 1 ]]; then
405 + S="${WORKDIR}/mozilla-esr${PV%%.*}"
406 + else
407 + S="${WORKDIR}/mozilla-release"
408 + fi
409 +fi
410 +
411 +QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
412 +
413 +BUILD_OBJ_DIR="${S}/ff"
414 +
415 +pkg_setup() {
416 + moz_pkgsetup
417 +
418 + # Avoid PGO profiling problems due to enviroment leakage
419 + # These should *always* be cleaned up anyway
420 + unset DBUS_SESSION_BUS_ADDRESS \
421 + DISPLAY \
422 + ORBIT_SOCKETDIR \
423 + SESSION_MANAGER \
424 + XDG_SESSION_COOKIE \
425 + XAUTHORITY
426 +
427 + if ! use bindist; then
428 + einfo
429 + elog "You are enabling official branding. You may not redistribute this build"
430 + elog "to any users on your network or the internet. Doing so puts yourself into"
431 + elog "a legal problem with Mozilla Foundation"
432 + elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
433 + fi
434 +
435 + if use pgo; then
436 + einfo
437 + ewarn "You will do a double build for profile guided optimization."
438 + ewarn "This will result in your build taking at least twice as long as before."
439 + fi
440 +}
441 +
442 +pkg_pretend() {
443 + # Ensure we have enough disk space to compile
444 + if use pgo || use debug || use test ; then
445 + CHECKREQS_DISK_BUILD="8G"
446 + else
447 + CHECKREQS_DISK_BUILD="4G"
448 + fi
449 + check-reqs_pkg_setup
450 +}
451 +
452 +src_unpack() {
453 + unpack ${A}
454 +
455 + # Unpack language packs
456 + mozlinguas_src_unpack
457 +}
458 +
459 +src_prepare() {
460 + # Apply our patches
461 + EPATCH_SUFFIX="patch" \
462 + EPATCH_FORCE="yes" \
463 + epatch "${WORKDIR}/firefox"
464 +
465 + # Allow user to apply any additional patches without modifing ebuild
466 + epatch_user
467 +
468 + # Enable gnomebreakpad
469 + if use debug ; then
470 + sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
471 + "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
472 + fi
473 +
474 + # Ensure that our plugins dir is enabled as default
475 + sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
476 + "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
477 + sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
478 + "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
479 +
480 + # Fix sandbox violations during make clean, bug 372817
481 + sed -e "s:\(/no-such-file\):${T}\1:g" \
482 + -i "${S}"/config/rules.mk \
483 + -i "${S}"/nsprpub/configure{.in,} \
484 + || die
485 +
486 + # Don't exit with error when some libs are missing which we have in
487 + # system.
488 + sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
489 + -i "${S}"/browser/installer/Makefile.in || die
490 +
491 + # Don't error out when there's no files to be removed:
492 + sed 's@\(xargs rm\)$@\1 -f@' \
493 + -i "${S}"/toolkit/mozapps/installer/packager.mk || die
494 +
495 + eautoreconf
496 +
497 + # Must run autoconf in js/src
498 + cd "${S}"/js/src || die
499 + eautoconf
500 +
501 + # Need to update jemalloc's configure
502 + cd "${S}"/memory/jemalloc/src || die
503 + WANT_AUTOCONF= eautoconf
504 +}
505 +
506 +src_configure() {
507 + MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
508 + MEXTENSIONS="default"
509 + # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
510 + # Note: These are for Gentoo Linux use ONLY. For your own distribution, please
511 + # get your own set of keys.
512 + _google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
513 +
514 + ####################################
515 + #
516 + # mozconfig, CFLAGS and CXXFLAGS setup
517 + #
518 + ####################################
519 +
520 + mozconfig_init
521 + mozconfig_config
522 +
523 + # It doesn't compile on alpha without this LDFLAGS
524 + use alpha && append-ldflags "-Wl,--no-relax"
525 +
526 + # Add full relro support for hardened
527 + use hardened && append-ldflags "-Wl,-z,relro,-z,now"
528 +
529 + if use neon ; then
530 + mozconfig_annotate '' --with-fpu=neon
531 + mozconfig_annotate '' --with-thumb=yes
532 + mozconfig_annotate '' --with-thumb-interwork=no
533 + fi
534 +
535 + if [[ ${CHOST} == armv* ]] ; then
536 + mozconfig_annotate '' --with-float-abi=hard
537 + mozconfig_annotate '' --enable-skia
538 +
539 + if ! use system-libvpx ; then
540 + sed -i -e "s|softfp|hard|" \
541 + "${S}"/media/libvpx/moz.build
542 + fi
543 + fi
544 +
545 + use egl && mozconfig_annotate 'Enable EGL as GL provider' --with-gl-provider=EGL
546 +
547 + # Setup api key for location services
548 + echo -n "${_google_api_key}" > "${S}"/google-api-key
549 + mozconfig_annotate '' --with-google-api-keyfile="${S}/google-api-key"
550 +
551 + mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
552 + mozconfig_annotate '' --disable-mailnews
553 +
554 + # Other ff-specific settings
555 + mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
556 +
557 + # Allow for a proper pgo build
558 + if use pgo; then
559 + echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
560 + fi
561 +
562 + echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
563 +
564 + # Finalize and report settings
565 + mozconfig_final
566 +
567 + if [[ $(gcc-major-version) -lt 4 ]]; then
568 + append-cxxflags -fno-stack-protector
569 + fi
570 +
571 + # workaround for funky/broken upstream configure...
572 + emake -f client.mk configure
573 +}
574 +
575 +src_compile() {
576 + if use pgo; then
577 + addpredict /root
578 + addpredict /etc/gconf
579 + # Reset and cleanup environment variables used by GNOME/XDG
580 + gnome2_environment_reset
581 +
582 + # Firefox tries to use dri stuff when it's run, see bug 380283
583 + shopt -s nullglob
584 + cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
585 + if test -z "${cards}"; then
586 + cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
587 + if test -n "${cards}"; then
588 + # Binary drivers seem to cause access violations anyway, so
589 + # let's use indirect rendering so that the device files aren't
590 + # touched at all. See bug 394715.
591 + export LIBGL_ALWAYS_INDIRECT=1
592 + fi
593 + fi
594 + shopt -u nullglob
595 + addpredict "${cards}"
596 +
597 + CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
598 + MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
599 + Xemake -f client.mk profiledbuild || die "Xemake failed"
600 + else
601 + CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
602 + MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
603 + emake -f client.mk realbuild
604 + fi
605 +
606 +}
607 +
608 +src_install() {
609 + MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
610 + DICTPATH="\"${EPREFIX}/usr/share/myspell\""
611 +
612 + cd "${BUILD_OBJ_DIR}" || die
613 +
614 + # Pax mark xpcshell for hardened support, only used for startupcache creation.
615 + pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
616 +
617 + # Add our default prefs for firefox
618 + cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
619 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
620 + || die
621 +
622 + # Set default path to search for dictionaries.
623 + echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
624 + >> "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
625 + || die
626 +
627 + echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
628 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
629 + || die
630 +
631 + local plugin
632 + use gmp-autoupdate || for plugin in \
633 + gmp-gmpopenh264 ; do
634 + echo "pref(\"media.${plugin}.autoupdate\", false);" >> \
635 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
636 + || die
637 + done
638 +
639 + MOZ_MAKE_FLAGS="${MAKEOPTS}" \
640 + emake DESTDIR="${D}" install
641 +
642 + # Install language packs
643 + mozlinguas_src_install
644 +
645 + local size sizes icon_path icon name
646 + if use bindist; then
647 + sizes="16 32 48"
648 + icon_path="${S}/browser/branding/aurora"
649 + # Firefox's new rapid release cycle means no more codenames
650 + # Let's just stick with this one...
651 + icon="aurora"
652 + name="Aurora"
653 + else
654 + sizes="16 22 24 32 256"
655 + icon_path="${S}/browser/branding/official"
656 + icon="${PN}"
657 + name="Mozilla Firefox"
658 + fi
659 +
660 + # Install icons and .desktop for menu entry
661 + for size in ${sizes}; do
662 + insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
663 + newins "${icon_path}/default${size}.png" "${icon}.png"
664 + done
665 + # The 128x128 icon has a different name
666 + insinto "/usr/share/icons/hicolor/128x128/apps"
667 + newins "${icon_path}/mozicon128.png" "${icon}.png"
668 + # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
669 + newicon "${icon_path}/content/icon48.png" "${icon}.png"
670 + newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
671 + sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
672 + "${ED}/usr/share/applications/${PN}.desktop" || die
673 +
674 + # Add StartupNotify=true bug 237317
675 + if use startup-notification ; then
676 + echo "StartupNotify=true"\
677 + >> "${ED}/usr/share/applications/${PN}.desktop" \
678 + || die
679 + fi
680 +
681 + # Required in order to use plugins and even run firefox on hardened.
682 + if use jit; then
683 + pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin,plugin-container}
684 + else
685 + pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/plugin-container
686 + fi
687 +
688 + if use minimal; then
689 + rm -r "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} \
690 + || die "Failed to remove sdk and headers"
691 + fi
692 +
693 + # very ugly hack to make firefox not sigbus on sparc
694 + # FIXME: is this still needed??
695 + use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
696 + -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" \
697 + || die "sparc sed failed"; }
698 +
699 + # revdep-rebuild entry
700 + insinto /etc/revdep-rebuild
701 + echo "SEARCH_DIRS_MASK=${MOZILLA_FIVE_HOME}" >> ${T}/10firefox
702 + doins "${T}"/10${PN} || die
703 +}
704 +
705 +pkg_preinst() {
706 + gnome2_icon_savelist
707 +}
708 +
709 +pkg_postinst() {
710 + # Update mimedb for the new .desktop file
711 + fdo-mime_desktop_database_update
712 + gnome2_icon_cache_update
713 +}
714 +
715 +pkg_postrm() {
716 + gnome2_icon_cache_update
717 +}