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