Gentoo Archives: gentoo-commits

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