Gentoo Archives: gentoo-commits

From: "Lars Wendler (polynomial-c)" <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-client/firefox: ChangeLog firefox-27.0.ebuild firefox-24.3.0.ebuild
Date: Sun, 09 Feb 2014 10:49:14
Message-Id: 20140209104911.A43782004C@flycatcher.gentoo.org
1 polynomial-c 14/02/09 10:49:11
2
3 Modified: ChangeLog
4 Added: firefox-27.0.ebuild firefox-24.3.0.ebuild
5 Log:
6 Security bump (bug #500320)
7
8 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0x981CA6FC)
9
10 Revision Changes Path
11 1.298 www-client/firefox/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/ChangeLog?rev=1.298&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/ChangeLog?rev=1.298&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/ChangeLog?r1=1.297&r2=1.298
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/www-client/firefox/ChangeLog,v
20 retrieving revision 1.297
21 retrieving revision 1.298
22 diff -u -r1.297 -r1.298
23 --- ChangeLog 16 Dec 2013 20:17:58 -0000 1.297
24 +++ ChangeLog 9 Feb 2014 10:49:11 -0000 1.298
25 @@ -1,6 +1,13 @@
26 # ChangeLog for www-client/firefox
27 -# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/www-client/firefox/ChangeLog,v 1.297 2013/12/16 20:17:58 anarchy Exp $
29 +# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
30 +# $Header: /var/cvsroot/gentoo-x86/www-client/firefox/ChangeLog,v 1.298 2014/02/09 10:49:11 polynomial-c Exp $
31 +
32 +*firefox-27.0 (09 Feb 2014)
33 +*firefox-24.3.0 (09 Feb 2014)
34 +
35 + 09 Feb 2014; Lars Wendler <polynomial-c@g.o> +firefox-24.3.0.ebuild,
36 + +firefox-27.0.ebuild:
37 + Security bump (bug #500320).
38
39 16 Dec 2013; Jory A. Pratt <anarchy@g.o> firefox-26.0.ebuild:
40 Address bug #494162,494164
41
42
43
44 1.1 www-client/firefox/firefox-27.0.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/firefox-27.0.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/firefox-27.0.ebuild?rev=1.1&content-type=text/plain
48
49 Index: firefox-27.0.ebuild
50 ===================================================================
51 # Copyright 1999-2014 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/www-client/firefox/firefox-27.0.ebuild,v 1.1 2014/02/09 10:49:11 polynomial-c Exp $
54
55 EAPI="3"
56 VIRTUALX_REQUIRED="pgo"
57 WANT_AUTOCONF="2.1"
58 MOZ_ESR=""
59
60 # This list can be updated with scripts/get_langs.sh from the mozilla overlay
61 MOZ_LANGS=( af ar as ast be bg bn-BD bn-IN br bs ca cs csb cy da de el en
62 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
63 gl gu-IN he hi-IN hr hu hy-AM id is it ja kk km kn ko ku lt lv mai mk ml mr
64 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
65 th tr uk vi xh zh-CN zh-TW zu )
66
67 # Convert the ebuild version to the upstream mozilla version, used by mozlinguas
68 MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
69 MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
70 MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
71
72 if [[ ${MOZ_ESR} == 1 ]]; then
73 # ESR releases have slightly version numbers
74 MOZ_PV="${MOZ_PV}esr"
75 fi
76
77 # Patch version
78 PATCH="${PN}-26.0-patches-0.3"
79 # Upstream ftp release URI that's used by mozlinguas.eclass
80 # We don't use the http mirror because it deletes old tarballs.
81 MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases/"
82 MOZ_HTTP_URI="http://ftp.mozilla.org/pub/${PN}/releases/"
83
84 inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-3 multilib pax-utils fdo-mime autotools virtualx mozlinguas
85
86 DESCRIPTION="Firefox Web Browser"
87 HOMEPAGE="http://www.mozilla.com/firefox"
88
89 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
90 SLOT="0"
91 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
92 IUSE="bindist gstreamer +jit +minimal pgo pulseaudio selinux system-cairo system-icu system-jpeg system-sqlite"
93 RESTRICT="mirror"
94
95 # More URIs appended below...
96 SRC_URI="${SRC_URI}
97 http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
98 http://dev.gentoo.org/~nirbheek/mozilla/patchsets/${PATCH}.tar.xz"
99
100 ASM_DEPEND=">=dev-lang/yasm-1.1"
101
102 # Mesa 7.10 needed for WebGL + bugfixes
103 RDEPEND="
104 >=dev-libs/nss-3.15.3
105 >=dev-libs/nspr-4.10.2
106 >=dev-libs/glib-2.26:2
107 >=media-libs/mesa-7.10
108 >=media-libs/libpng-1.5.17[apng]
109 virtual/libffi
110 gstreamer? ( media-plugins/gst-plugins-meta:0.10[ffmpeg] )
111 pulseaudio? ( media-sound/pulseaudio )
112 system-cairo? ( >=x11-libs/cairo-1.12[X] )
113 system-icu? ( >=dev-libs/icu-0.51.1 )
114 system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
115 system-sqlite? ( >=dev-db/sqlite-3.7.17:3[secure-delete,debug=] )
116 >=media-libs/libvpx-1.0.0
117 kernel_linux? ( media-libs/alsa-lib )
118 selinux? ( sec-policy/selinux-mozilla )"
119
120 DEPEND="${RDEPEND}
121 >=sys-devel/binutils-2.16.1
122 virtual/pkgconfig
123 pgo? (
124 >=sys-devel/gcc-4.5 )
125 amd64? ( ${ASM_DEPEND}
126 virtual/opengl )
127 x86? ( ${ASM_DEPEND}
128 virtual/opengl )"
129
130 # No source releases for alpha|beta
131 if [[ ${PV} =~ alpha ]]; then
132 CHANGESET="8a3042764de7"
133 SRC_URI="${SRC_URI}
134 http://dev.gentoo.org/~nirbheek/mozilla/firefox/firefox-${MOZ_PV}_${CHANGESET}.source.tar.bz2"
135 S="${WORKDIR}/mozilla-aurora-${CHANGESET}"
136 elif [[ ${PV} =~ beta ]]; then
137 S="${WORKDIR}/mozilla-beta"
138 SRC_URI="${SRC_URI}
139 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
140 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
141 else
142 SRC_URI="${SRC_URI}
143 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
144 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
145 if [[ ${MOZ_ESR} == 1 ]]; then
146 S="${WORKDIR}/mozilla-esr${PV%%.*}"
147 else
148 S="${WORKDIR}/mozilla-release"
149 fi
150 fi
151
152 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
153
154 pkg_setup() {
155 moz_pkgsetup
156
157 # Avoid PGO profiling problems due to enviroment leakage
158 # These should *always* be cleaned up anyway
159 unset DBUS_SESSION_BUS_ADDRESS \
160 DISPLAY \
161 ORBIT_SOCKETDIR \
162 SESSION_MANAGER \
163 XDG_SESSION_COOKIE \
164 XAUTHORITY
165
166 if ! use bindist; then
167 einfo
168 elog "You are enabling official branding. You may not redistribute this build"
169 elog "to any users on your network or the internet. Doing so puts yourself into"
170 elog "a legal problem with Mozilla Foundation"
171 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
172 fi
173
174 if use pgo; then
175 einfo
176 ewarn "You will do a double build for profile guided optimization."
177 ewarn "This will result in your build taking at least twice as long as before."
178 fi
179
180 # Ensure we have enough disk space to compile
181 if use pgo || use debug || use test ; then
182 CHECKREQS_DISK_BUILD="8G"
183 else
184 CHECKREQS_DISK_BUILD="4G"
185 fi
186 check-reqs_pkg_setup
187 }
188
189 src_unpack() {
190 unpack ${A}
191
192 # Unpack language packs
193 mozlinguas_src_unpack
194 }
195
196 src_prepare() {
197 # Apply our patches
198 EPATCH_EXCLUDE="7007_fix_missing_strings.patch" \
199 EPATCH_SUFFIX="patch" \
200 EPATCH_FORCE="yes" \
201 epatch "${WORKDIR}/firefox"
202
203 # Allow user to apply any additional patches without modifing ebuild
204 epatch_user
205
206 # Enable gnomebreakpad
207 if use debug ; then
208 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
209 "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
210 fi
211
212 # Ensure that our plugins dir is enabled as default
213 sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
214 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
215 sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
216 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
217
218 # Fix sandbox violations during make clean, bug 372817
219 sed -e "s:\(/no-such-file\):${T}\1:g" \
220 -i "${S}"/config/rules.mk \
221 -i "${S}"/js/src/config/rules.mk \
222 -i "${S}"/nsprpub/configure{.in,} \
223 || die
224
225 # Don't exit with error when some libs are missing which we have in
226 # system.
227 sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
228 -i "${S}"/browser/installer/Makefile.in || die
229
230 # Don't error out when there's no files to be removed:
231 sed 's@\(xargs rm\)$@\1 -f@' \
232 -i "${S}"/toolkit/mozapps/installer/packager.mk || die
233
234 eautoreconf
235
236 # Must run autoconf in js/src
237 cd "${S}"/js/src
238 eautoconf
239 }
240
241 src_configure() {
242 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
243 MEXTENSIONS="default"
244
245 ####################################
246 #
247 # mozconfig, CFLAGS and CXXFLAGS setup
248 #
249 ####################################
250
251 mozconfig_init
252 mozconfig_config
253
254 # It doesn't compile on alpha without this LDFLAGS
255 use alpha && append-ldflags "-Wl,--no-relax"
256
257 # We must force enable jemalloc 3 threw .mozconfig
258 echo "export MOZ_JEMALLOC=1" >> ${S}/.mozconfig
259
260 mozconfig_annotate '' --enable-jemalloc
261 mozconfig_annotate '' --enable-replace-malloc
262 mozconfig_annotate '' --prefix="${EPREFIX}"/usr
263 mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
264 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
265 mozconfig_annotate '' --disable-gconf
266 mozconfig_annotate '' --disable-mailnews
267 mozconfig_annotate '' --with-system-png
268 mozconfig_annotate '' --enable-system-ffi
269
270 # Other ff-specific settings
271 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
272 mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
273 mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
274
275 mozconfig_use_enable gstreamer
276 mozconfig_use_enable pulseaudio
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 # Feature is know to cause problems on hardened
283 mozconfig_use_enable jit ion
284
285 # Allow for a proper pgo build
286 if use pgo; then
287 echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
288 fi
289
290 # Finalize and report settings
291 mozconfig_final
292
293 if [[ $(gcc-major-version) -lt 4 ]]; then
294 append-cxxflags -fno-stack-protector
295 elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]]; then
296 if use amd64 || use x86; then
297 append-flags -mno-avx
298 fi
299 fi
300 }
301
302 src_compile() {
303 if use pgo; then
304 addpredict /root
305 addpredict /etc/gconf
306 # Reset and cleanup environment variables used by GNOME/XDG
307 gnome2_environment_reset
308
309 # Firefox tries to use dri stuff when it's run, see bug 380283
310 shopt -s nullglob
311 cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
312 if test -z "${cards}"; then
313 cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
314 if test -n "${cards}"; then
315 # Binary drivers seem to cause access violations anyway, so
316 # let's use indirect rendering so that the device files aren't
317 # touched at all. See bug 394715.
318 export LIBGL_ALWAYS_INDIRECT=1
319 fi
320 fi
321 shopt -u nullglob
322 addpredict "${cards}"
323
324 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
325 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
326 Xemake -f client.mk profiledbuild || die "Xemake failed"
327 else
328 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
329 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
330 emake -f client.mk || die "emake failed"
331 fi
332
333 }
334
335 src_install() {
336 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
337 DICTPATH="\"${EPREFIX}/usr/share/myspell\""
338
339 # MOZ_BUILD_ROOT, and hence OBJ_DIR change depending on arch, compiler, pgo, etc.
340 local obj_dir="$(echo */config.log)"
341 obj_dir="${obj_dir%/*}"
342 cd "${S}/${obj_dir}"
343
344 # Pax mark xpcshell for hardened support, only used for startupcache creation.
345 pax-mark m "${S}/${obj_dir}"/dist/bin/xpcshell
346
347 # Add our default prefs for firefox
348 cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
349 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
350
351 # Set default path to search for dictionaries.
352 echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
353 >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
354
355 if ! use libnotify; then
356 echo "pref(\"browser.download.manager.showAlertOnComplete\", false);" \
357 >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
358 fi
359
360 echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
361 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
362
363 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
364 emake DESTDIR="${D}" install || die "emake install failed"
365
366 # Install language packs
367 mozlinguas_src_install
368
369 local size sizes icon_path icon name
370 if use bindist; then
371 sizes="16 32 48"
372 icon_path="${S}/browser/branding/aurora"
373 # Firefox's new rapid release cycle means no more codenames
374 # Let's just stick with this one...
375 icon="aurora"
376 name="Aurora"
377 else
378 sizes="16 22 24 32 256"
379 icon_path="${S}/browser/branding/official"
380 icon="${PN}"
381 name="Mozilla Firefox"
382 fi
383
384 # Install icons and .desktop for menu entry
385 for size in ${sizes}; do
386 insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
387 newins "${icon_path}/default${size}.png" "${icon}.png" || die
388 done
389 # The 128x128 icon has a different name
390 insinto "/usr/share/icons/hicolor/128x128/apps"
391 newins "${icon_path}/mozicon128.png" "${icon}.png" || die
392 # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
393 newicon "${icon_path}/content/icon48.png" "${icon}.png" || die
394 newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop" || die
395 sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
396 "${ED}/usr/share/applications/${PN}.desktop" || die
397
398 # Add StartupNotify=true bug 237317
399 if use startup-notification ; then
400 echo "StartupNotify=true" >> "${ED}/usr/share/applications/${PN}.desktop"
401 fi
402
403 # Required in order to use plugins and even run firefox on hardened.
404 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin,plugin-container}
405
406 if use minimal; then
407 rm -rf "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} || \
408 die "Failed to remove sdk and headers"
409 fi
410
411 # very ugly hack to make firefox not sigbus on sparc
412 # FIXME: is this still needed??
413 use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
414 -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" || \
415 die "sparc sed failed"; }
416 }
417
418 pkg_preinst() {
419 gnome2_icon_savelist
420 }
421
422 pkg_postinst() {
423 # Update mimedb for the new .desktop file
424 fdo-mime_desktop_database_update
425 gnome2_icon_cache_update
426 }
427
428 pkg_postrm() {
429 gnome2_icon_cache_update
430 }
431
432
433
434 1.1 www-client/firefox/firefox-24.3.0.ebuild
435
436 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/firefox-24.3.0.ebuild?rev=1.1&view=markup
437 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/firefox-24.3.0.ebuild?rev=1.1&content-type=text/plain
438
439 Index: firefox-24.3.0.ebuild
440 ===================================================================
441 # Copyright 1999-2014 Gentoo Foundation
442 # Distributed under the terms of the GNU General Public License v2
443 # $Header: /var/cvsroot/gentoo-x86/www-client/firefox/firefox-24.3.0.ebuild,v 1.1 2014/02/09 10:49:11 polynomial-c Exp $
444
445 EAPI="3"
446 VIRTUALX_REQUIRED="pgo"
447 WANT_AUTOCONF="2.1"
448 MOZ_ESR="1"
449
450 # This list can be updated with scripts/get_langs.sh from the mozilla overlay
451 MOZ_LANGS=(af ak ar as ast be bg bn-BD bn-IN br bs ca cs csb cy da de
452 el en en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa fi fr
453 fy-NL ga-IE gd gl gu-IN he hi-IN hr hu hy-AM id is it ja kk km kn ko ku
454 lg lt lv mai mk ml mr nb-NO nl nn-NO nso or pa-IN pl pt-BR pt-PT rm ro
455 ru si sk sl son sq sr sv-SE ta ta-LK te th tr uk vi zh-CN zh-TW zu )
456
457 # Convert the ebuild version to the upstream mozilla version, used by mozlinguas
458 MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
459 MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
460 MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
461
462 if [[ ${MOZ_ESR} == 1 ]]; then
463 # ESR releases have slightly version numbers
464 MOZ_PV="${MOZ_PV}esr"
465 fi
466
467 # Patch version
468 PATCH="${PN}-24.0-patches-0.9"
469 # Upstream ftp release URI that's used by mozlinguas.eclass
470 # We don't use the http mirror because it deletes old tarballs.
471 MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases/"
472 MOZ_HTTP_URI="http://ftp.mozilla.org/pub/${PN}/releases/"
473
474 inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-3 multilib pax-utils fdo-mime autotools virtualx mozlinguas
475
476 DESCRIPTION="Firefox Web Browser"
477 HOMEPAGE="http://www.mozilla.com/firefox"
478
479 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
480 SLOT="0"
481 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
482 IUSE="bindist gstreamer +jit +minimal pgo pulseaudio selinux system-cairo system-icu system-jpeg system-sqlite"
483
484 # More URIs appended below...
485 SRC_URI="${SRC_URI}
486 http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
487 http://dev.gentoo.org/~nirbheek/mozilla/patchsets/${PATCH}.tar.xz"
488
489 ASM_DEPEND=">=dev-lang/yasm-1.1"
490
491 # Mesa 7.10 needed for WebGL + bugfixes
492 RDEPEND="
493 >=dev-libs/nss-3.15.3
494 >=dev-libs/nspr-4.10.2
495 >=dev-libs/glib-2.26:2
496 >=media-libs/mesa-7.10
497 >=media-libs/libpng-1.5.13[apng]
498 virtual/libffi
499 gstreamer? ( media-plugins/gst-plugins-meta:0.10[ffmpeg] )
500 pulseaudio? ( media-sound/pulseaudio )
501 system-cairo? ( >=x11-libs/cairo-1.12[X] )
502 system-icu? ( >=dev-libs/icu-0.51.1 )
503 system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
504 system-sqlite? ( >=dev-db/sqlite-3.7.17:3[secure-delete,debug=] )
505 >=media-libs/libvpx-1.0.0
506 kernel_linux? ( media-libs/alsa-lib )
507 selinux? ( sec-policy/selinux-mozilla )"
508
509 DEPEND="${RDEPEND}
510 >=sys-devel/binutils-2.16.1
511 virtual/pkgconfig
512 pgo? (
513 >=sys-devel/gcc-4.5 )
514 amd64? ( ${ASM_DEPEND}
515 virtual/opengl )
516 x86? ( ${ASM_DEPEND}
517 virtual/opengl )"
518
519 # No source releases for alpha|beta
520 if [[ ${PV} =~ alpha ]]; then
521 CHANGESET="8a3042764de7"
522 SRC_URI="${SRC_URI}
523 http://dev.gentoo.org/~nirbheek/mozilla/firefox/firefox-${MOZ_PV}_${CHANGESET}.source.tar.bz2"
524 S="${WORKDIR}/mozilla-aurora-${CHANGESET}"
525 elif [[ ${PV} =~ beta ]]; then
526 S="${WORKDIR}/mozilla-beta"
527 SRC_URI="${SRC_URI}
528 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
529 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
530 else
531 SRC_URI="${SRC_URI}
532 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
533 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
534 if [[ ${MOZ_ESR} == 1 ]]; then
535 S="${WORKDIR}/mozilla-esr${PV%%.*}"
536 else
537 S="${WORKDIR}/mozilla-release"
538 fi
539 fi
540
541 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
542
543 pkg_setup() {
544 moz_pkgsetup
545
546 # Avoid PGO profiling problems due to enviroment leakage
547 # These should *always* be cleaned up anyway
548 unset DBUS_SESSION_BUS_ADDRESS \
549 DISPLAY \
550 ORBIT_SOCKETDIR \
551 SESSION_MANAGER \
552 XDG_SESSION_COOKIE \
553 XAUTHORITY
554
555 if ! use bindist; then
556 einfo
557 elog "You are enabling official branding. You may not redistribute this build"
558 elog "to any users on your network or the internet. Doing so puts yourself into"
559 elog "a legal problem with Mozilla Foundation"
560 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
561 fi
562
563 if use pgo; then
564 einfo
565 ewarn "You will do a double build for profile guided optimization."
566 ewarn "This will result in your build taking at least twice as long as before."
567 fi
568
569 # Ensure we have enough disk space to compile
570 if use pgo || use debug || use test ; then
571 CHECKREQS_DISK_BUILD="8G"
572 else
573 CHECKREQS_DISK_BUILD="4G"
574 fi
575 check-reqs_pkg_setup
576 }
577
578 src_unpack() {
579 unpack ${A}
580
581 # Unpack language packs
582 mozlinguas_src_unpack
583 }
584
585 src_prepare() {
586 # Apply our patches
587 EPATCH_SUFFIX="patch" \
588 EPATCH_FORCE="yes" \
589 epatch "${WORKDIR}/firefox"
590
591 # Allow user to apply any additional patches without modifing ebuild
592 epatch_user
593
594 # Enable gnomebreakpad
595 if use debug ; then
596 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
597 "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
598 fi
599
600 # Ensure that our plugins dir is enabled as default
601 sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
602 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
603 sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
604 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
605
606 # Fix sandbox violations during make clean, bug 372817
607 sed -e "s:\(/no-such-file\):${T}\1:g" \
608 -i "${S}"/config/rules.mk \
609 -i "${S}"/js/src/config/rules.mk \
610 -i "${S}"/nsprpub/configure{.in,} \
611 || die
612
613 # Don't exit with error when some libs are missing which we have in
614 # system.
615 sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
616 -i "${S}"/browser/installer/Makefile.in || die
617
618 # Don't error out when there's no files to be removed:
619 sed 's@\(xargs rm\)$@\1 -f@' \
620 -i "${S}"/toolkit/mozapps/installer/packager.mk || die
621
622 eautoreconf
623
624 # Must run autoconf in js/src
625 cd "${S}"/js/src
626 eautoconf
627 }
628
629 src_configure() {
630 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
631 MEXTENSIONS="default"
632
633 ####################################
634 #
635 # mozconfig, CFLAGS and CXXFLAGS setup
636 #
637 ####################################
638
639 mozconfig_init
640 mozconfig_config
641
642 # It doesn't compile on alpha without this LDFLAGS
643 use alpha && append-ldflags "-Wl,--no-relax"
644
645 # We must force enable jemalloc 3 threw .mozconfig
646 echo "export MOZ_JEMALLOC=1" >> ${S}/.mozconfig
647
648 mozconfig_annotate '' --enable-jemalloc
649 mozconfig_annotate '' --enable-replace-malloc
650 mozconfig_annotate '' --prefix="${EPREFIX}"/usr
651 mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
652 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
653 mozconfig_annotate '' --disable-gconf
654 mozconfig_annotate '' --disable-mailnews
655 mozconfig_annotate '' --with-system-png
656 mozconfig_annotate '' --enable-system-ffi
657
658 # Other ff-specific settings
659 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
660 mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
661 mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
662
663 mozconfig_use_enable gstreamer
664 mozconfig_use_enable pulseaudio
665 mozconfig_use_enable system-cairo
666 mozconfig_use_enable system-sqlite
667 mozconfig_use_with system-jpeg
668 mozconfig_use_with system-icu
669 mozconfig_use_enable system-icu intl-api
670 # Feature is know to cause problems on hardened
671 mozconfig_use_enable jit ion
672
673 # Allow for a proper pgo build
674 if use pgo; then
675 echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
676 fi
677
678 # Finalize and report settings
679 mozconfig_final
680
681 if [[ $(gcc-major-version) -lt 4 ]]; then
682 append-cxxflags -fno-stack-protector
683 elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]]; then
684 if use amd64 || use x86; then
685 append-flags -mno-avx
686 fi
687 fi
688 }
689
690 src_compile() {
691 if use pgo; then
692 addpredict /root
693 addpredict /etc/gconf
694 # Reset and cleanup environment variables used by GNOME/XDG
695 gnome2_environment_reset
696
697 # Firefox tries to use dri stuff when it's run, see bug 380283
698 shopt -s nullglob
699 cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
700 if test -z "${cards}"; then
701 cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
702 if test -n "${cards}"; then
703 # Binary drivers seem to cause access violations anyway, so
704 # let's use indirect rendering so that the device files aren't
705 # touched at all. See bug 394715.
706 export LIBGL_ALWAYS_INDIRECT=1
707 fi
708 fi
709 shopt -u nullglob
710 addpredict "${cards}"
711
712 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
713 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
714 Xemake -f client.mk profiledbuild || die "Xemake failed"
715 else
716 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
717 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
718 emake -f client.mk || die "emake failed"
719 fi
720
721 }
722
723 src_install() {
724 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
725 DICTPATH="\"${EPREFIX}/usr/share/myspell\""
726
727 # MOZ_BUILD_ROOT, and hence OBJ_DIR change depending on arch, compiler, pgo, etc.
728 local obj_dir="$(echo */config.log)"
729 obj_dir="${obj_dir%/*}"
730 cd "${S}/${obj_dir}"
731
732 # Pax mark xpcshell for hardened support, only used for startupcache creation.
733 pax-mark m "${S}/${obj_dir}"/dist/bin/xpcshell
734
735 # Add our default prefs for firefox
736 cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
737 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
738
739 # Set default path to search for dictionaries.
740 echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
741 >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
742
743 if ! use libnotify; then
744 echo "pref(\"browser.download.manager.showAlertOnComplete\", false);" \
745 >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
746 fi
747
748 echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
749 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
750
751 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
752 emake DESTDIR="${D}" install || die "emake install failed"
753
754 # Install language packs
755 mozlinguas_src_install
756
757 local size sizes icon_path icon name
758 if use bindist; then
759 sizes="16 32 48"
760 icon_path="${S}/browser/branding/aurora"
761 # Firefox's new rapid release cycle means no more codenames
762 # Let's just stick with this one...
763 icon="aurora"
764 name="Aurora"
765 else
766 sizes="16 22 24 32 256"
767 icon_path="${S}/browser/branding/official"
768 icon="${PN}"
769 name="Mozilla Firefox"
770 fi
771
772 # Install icons and .desktop for menu entry
773 for size in ${sizes}; do
774 insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
775 newins "${icon_path}/default${size}.png" "${icon}.png" || die
776 done
777 # The 128x128 icon has a different name
778 insinto "/usr/share/icons/hicolor/128x128/apps"
779 newins "${icon_path}/mozicon128.png" "${icon}.png" || die
780 # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
781 newicon "${icon_path}/content/icon48.png" "${icon}.png" || die
782 newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop" || die
783 sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
784 "${ED}/usr/share/applications/${PN}.desktop" || die
785
786 # Add StartupNotify=true bug 237317
787 if use startup-notification ; then
788 echo "StartupNotify=true" >> "${ED}/usr/share/applications/${PN}.desktop"
789 fi
790
791 # Required in order to use plugins and even run firefox on hardened.
792 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin,plugin-container}
793
794 if use minimal; then
795 rm -rf "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} || \
796 die "Failed to remove sdk and headers"
797 fi
798
799 # very ugly hack to make firefox not sigbus on sparc
800 # FIXME: is this still needed??
801 use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
802 -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" || \
803 die "sparc sed failed"; }
804 }
805
806 pkg_preinst() {
807 gnome2_icon_savelist
808 }
809
810 pkg_postinst() {
811 # Update mimedb for the new .desktop file
812 fdo-mime_desktop_database_update
813 gnome2_icon_cache_update
814 }
815
816 pkg_postrm() {
817 gnome2_icon_cache_update
818 }