Gentoo Archives: gentoo-commits

From: "Ian Stakenvicius (axs)" <axs@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-client/firefox: firefox-32.0.ebuild firefox-31.1.0.ebuild firefox-24.8.0.ebuild ChangeLog firefox-31.0.ebuild firefox-24.5.0.ebuild firefox-24.6.0.ebuild firefox-29.0.1.ebuild
Date: Wed, 03 Sep 2014 22:09:14
Message-Id: 20140903220911.5900D4A25@oystercatcher.gentoo.org
1 axs 14/09/03 22:09:11
2
3 Modified: ChangeLog
4 Added: firefox-32.0.ebuild firefox-31.1.0.ebuild
5 firefox-24.8.0.ebuild
6 Removed: firefox-31.0.ebuild firefox-24.5.0.ebuild
7 firefox-24.6.0.ebuild firefox-29.0.1.ebuild
8 Log:
9 version bump, cheanup of some old ebuilds
10
11 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 2B6559ED)
12
13 Revision Changes Path
14 1.352 www-client/firefox/ChangeLog
15
16 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/ChangeLog?rev=1.352&view=markup
17 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/ChangeLog?rev=1.352&content-type=text/plain
18 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/ChangeLog?r1=1.351&r2=1.352
19
20 Index: ChangeLog
21 ===================================================================
22 RCS file: /var/cvsroot/gentoo-x86/www-client/firefox/ChangeLog,v
23 retrieving revision 1.351
24 retrieving revision 1.352
25 diff -u -r1.351 -r1.352
26 --- ChangeLog 10 Aug 2014 18:37:42 -0000 1.351
27 +++ ChangeLog 3 Sep 2014 22:09:11 -0000 1.352
28 @@ -1,6 +1,15 @@
29 # ChangeLog for www-client/firefox
30 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
31 -# $Header: /var/cvsroot/gentoo-x86/www-client/firefox/ChangeLog,v 1.351 2014/08/10 18:37:42 ago Exp $
32 +# $Header: /var/cvsroot/gentoo-x86/www-client/firefox/ChangeLog,v 1.352 2014/09/03 22:09:11 axs Exp $
33 +
34 +*firefox-32.0 (03 Sep 2014)
35 +*firefox-24.8.0 (03 Sep 2014)
36 +*firefox-31.1.0 (03 Sep 2014)
37 +
38 + 03 Sep 2014; Ian Stakenvicius (_AxS_) <axs@g.o> +firefox-24.8.0.ebuild,
39 + +firefox-31.1.0.ebuild, +firefox-32.0.ebuild, -firefox-24.5.0.ebuild,
40 + -firefox-24.6.0.ebuild, -firefox-29.0.1.ebuild, -firefox-31.0.ebuild:
41 + version bump, cheanup of some old ebuilds
42
43 10 Aug 2014; Agostino Sarubbo <ago@g.o> firefox-24.7.0.ebuild:
44 Stable for ppc64, wrt bug #517876
45
46
47
48 1.1 www-client/firefox/firefox-32.0.ebuild
49
50 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/firefox-32.0.ebuild?rev=1.1&view=markup
51 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/firefox-32.0.ebuild?rev=1.1&content-type=text/plain
52
53 Index: firefox-32.0.ebuild
54 ===================================================================
55 # Copyright 1999-2014 Gentoo Foundation
56 # Distributed under the terms of the GNU General Public License v2
57 # $Header: /var/cvsroot/gentoo-x86/www-client/firefox/firefox-32.0.ebuild,v 1.1 2014/09/03 22:09:11 axs Exp $
58
59 EAPI="5"
60 VIRTUALX_REQUIRED="pgo"
61 WANT_AUTOCONF="2.1"
62 MOZ_ESR=""
63
64 # This list can be updated with scripts/get_langs.sh from the mozilla overlay
65 MOZ_LANGS=( af ar as ast be bg bn-BD bn-IN br bs ca cs csb cy da de el en
66 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
67 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
68 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
69 th tr uk vi xh zh-CN zh-TW zu )
70
71 # Convert the ebuild version to the upstream mozilla version, used by mozlinguas
72 MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
73 MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
74 MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
75
76 if [[ ${MOZ_ESR} == 1 ]]; then
77 # ESR releases have slightly version numbers
78 MOZ_PV="${MOZ_PV}esr"
79 fi
80
81 # Patch version
82 PATCH="${PN}-31.0-patches-0.2"
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 MOZ_HTTP_URI="http://ftp.mozilla.org/pub/${PN}/releases/"
87
88 MOZCONFIG_OPTIONAL_WIFI=1
89 MOZCONFIG_OPTIONAL_JIT="enabled"
90
91 inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v4.1 multilib pax-utils fdo-mime autotools virtualx mozlinguas
92
93 DESCRIPTION="Firefox Web Browser"
94 HOMEPAGE="http://www.mozilla.com/firefox"
95
96 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
97 SLOT="0"
98 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
99 IUSE="bindist gstreamer hardened +minimal pgo pulseaudio selinux system-cairo system-icu system-jpeg system-sqlite test"
100
101 # More URIs appended below...
102 SRC_URI="${SRC_URI}
103 http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
104 http://dev.gentoo.org/~axs/distfiles/${PATCH}.tar.xz"
105
106 ASM_DEPEND=">=dev-lang/yasm-1.1"
107
108 # Mesa 7.10 needed for WebGL + bugfixes
109 RDEPEND="
110 >=dev-libs/nss-3.16.4
111 >=dev-libs/nspr-4.10.6
112 >=media-libs/mesa-10.2
113 >=media-libs/libpng-1.6.7[apng]
114 virtual/libffi
115 gstreamer? ( media-plugins/gst-plugins-meta:1.0[ffmpeg] )
116 pulseaudio? ( media-sound/pulseaudio )
117 system-cairo? ( >=x11-libs/cairo-1.12[X] )
118 system-icu? ( >=dev-libs/icu-51.1 )
119 system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
120 system-sqlite? ( >=dev-db/sqlite-3.8.3.1:3[secure-delete,debug=] )
121 >=media-libs/libvpx-1.3.0
122 kernel_linux? ( media-libs/alsa-lib )
123 selinux? ( sec-policy/selinux-mozilla )"
124
125 DEPEND="${RDEPEND}
126 >=sys-devel/binutils-2.16.1
127 virtual/pkgconfig
128 pgo? (
129 >=sys-devel/gcc-4.5 )
130 amd64? ( ${ASM_DEPEND}
131 virtual/opengl )
132 x86? ( ${ASM_DEPEND}
133 virtual/opengl )"
134
135 # No source releases for alpha|beta
136 if [[ ${PV} =~ alpha ]]; then
137 CHANGESET="8a3042764de7"
138 SRC_URI="${SRC_URI}
139 http://dev.gentoo.org/~nirbheek/mozilla/firefox/firefox-${MOZ_PV}_${CHANGESET}.source.tar.bz2"
140 S="${WORKDIR}/mozilla-aurora-${CHANGESET}"
141 elif [[ ${PV} =~ beta ]]; then
142 S="${WORKDIR}/mozilla-beta"
143 SRC_URI="${SRC_URI}
144 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
145 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
146 else
147 SRC_URI="${SRC_URI}
148 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
149 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
150 if [[ ${MOZ_ESR} == 1 ]]; then
151 S="${WORKDIR}/mozilla-esr${PV%%.*}"
152 else
153 S="${WORKDIR}/mozilla-release"
154 fi
155 fi
156
157 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
158
159 pkg_setup() {
160 moz_pkgsetup
161
162 # Avoid PGO profiling problems due to enviroment leakage
163 # These should *always* be cleaned up anyway
164 unset DBUS_SESSION_BUS_ADDRESS \
165 DISPLAY \
166 ORBIT_SOCKETDIR \
167 SESSION_MANAGER \
168 XDG_SESSION_COOKIE \
169 XAUTHORITY
170
171 if ! use bindist; then
172 einfo
173 elog "You are enabling official branding. You may not redistribute this build"
174 elog "to any users on your network or the internet. Doing so puts yourself into"
175 elog "a legal problem with Mozilla Foundation"
176 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
177 fi
178
179 if use pgo; then
180 einfo
181 ewarn "You will do a double build for profile guided optimization."
182 ewarn "This will result in your build taking at least twice as long as before."
183 fi
184 }
185
186 pkg_pretend() {
187 # Ensure we have enough disk space to compile
188 if use pgo || use debug || use test ; then
189 CHECKREQS_DISK_BUILD="8G"
190 else
191 CHECKREQS_DISK_BUILD="4G"
192 fi
193 check-reqs_pkg_setup
194
195 if use jit && [[ -n ${PROFILE_IS_HARDENED} ]]; then
196 ewarn "You are emerging this package on a hardened profile with USE=jit enabled."
197 ewarn "This is horribly insecure as it disables all PAGEEXEC restrictions."
198 ewarn "Please ensure you know what you are doing. If you don't, please consider"
199 ewarn "emerging the package with USE=-jit"
200 fi
201 }
202
203 src_unpack() {
204 unpack ${A}
205
206 # Unpack language packs
207 mozlinguas_src_unpack
208 }
209
210 src_prepare() {
211 # Apply our patches
212 EPATCH_SUFFIX="patch" \
213 EPATCH_FORCE="yes" \
214 EPATCH_EXCLUDE="8000_gcc49_mozbug999496_ff31.patch" \
215 epatch "${WORKDIR}/firefox"
216
217 # Allow user to apply any additional patches without modifing ebuild
218 epatch_user
219
220 # Enable gnomebreakpad
221 if use debug ; then
222 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
223 "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
224 fi
225
226 # Ensure that our plugins dir is enabled as default
227 sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
228 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
229 sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
230 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
231
232 # Fix sandbox violations during make clean, bug 372817
233 sed -e "s:\(/no-such-file\):${T}\1:g" \
234 -i "${S}"/config/rules.mk \
235 -i "${S}"/nsprpub/configure{.in,} \
236 || die
237
238 # Don't exit with error when some libs are missing which we have in
239 # system.
240 sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
241 -i "${S}"/browser/installer/Makefile.in || die
242
243 # Don't error out when there's no files to be removed:
244 sed 's@\(xargs rm\)$@\1 -f@' \
245 -i "${S}"/toolkit/mozapps/installer/packager.mk || die
246
247 eautoreconf
248
249 # Must run autoconf in js/src
250 cd "${S}"/js/src || die
251 eautoconf
252 }
253
254 src_configure() {
255 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
256 MEXTENSIONS="default"
257 # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
258 # Note: These are for Gentoo Linux use ONLY. For your own distribution, please
259 # get your own set of keys.
260 _google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
261
262 ####################################
263 #
264 # mozconfig, CFLAGS and CXXFLAGS setup
265 #
266 ####################################
267
268 mozconfig_init
269 mozconfig_config
270
271 # It doesn't compile on alpha without this LDFLAGS
272 use alpha && append-ldflags "-Wl,--no-relax"
273
274 # Add full relro support for hardened
275 use hardened && append-ldflags "-Wl,-z,relro,-z,now"
276
277 # We must force enable jemalloc 3 threw .mozconfig
278 echo "export MOZ_JEMALLOC=1" >> "${S}"/.mozconfig || die
279
280 # Setup api key for location services
281 echo -n "${_google_api_key}" > "${S}"/google-api-key
282 mozconfig_annotate '' --with-google-api-keyfile="${S}/google-api-key"
283
284 mozconfig_annotate '' --enable-jemalloc
285 mozconfig_annotate '' --enable-replace-malloc
286 mozconfig_annotate '' --prefix="${EPREFIX}"/usr
287 mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
288 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
289 mozconfig_annotate '' --disable-gconf
290 mozconfig_annotate '' --disable-mailnews
291 mozconfig_annotate '' --with-system-png
292 mozconfig_annotate '' --enable-system-ffi
293 mozconfig_annotate '' --disable-gold
294
295 # Other ff-specific settings
296 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
297 mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
298 mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
299
300 # gstreamer now needs the version specified
301 if use gstreamer; then
302 mozconfig_annotate '' --enable-gstreamer=1.0
303 else
304 mozconfig_annotate '' --disable-gstreamer
305 fi
306 mozconfig_use_enable pulseaudio
307 mozconfig_use_enable system-cairo
308 mozconfig_use_enable system-sqlite
309 mozconfig_use_with system-jpeg
310 mozconfig_use_with system-icu
311 mozconfig_use_enable system-icu intl-api
312
313 # Allow for a proper pgo build
314 if use pgo; then
315 echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
316 fi
317
318 # Finalize and report settings
319 mozconfig_final
320
321 if [[ $(gcc-major-version) -lt 4 ]]; then
322 append-cxxflags -fno-stack-protector
323 elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]]; then
324 if use amd64 || use x86; then
325 append-flags -mno-avx
326 fi
327 fi
328 }
329
330 src_compile() {
331 if use pgo; then
332 addpredict /root
333 addpredict /etc/gconf
334 # Reset and cleanup environment variables used by GNOME/XDG
335 gnome2_environment_reset
336
337 # Firefox tries to use dri stuff when it's run, see bug 380283
338 shopt -s nullglob
339 cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
340 if test -z "${cards}"; then
341 cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
342 if test -n "${cards}"; then
343 # Binary drivers seem to cause access violations anyway, so
344 # let's use indirect rendering so that the device files aren't
345 # touched at all. See bug 394715.
346 export LIBGL_ALWAYS_INDIRECT=1
347 fi
348 fi
349 shopt -u nullglob
350 addpredict "${cards}"
351
352 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
353 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
354 Xemake -f client.mk profiledbuild || die "Xemake failed"
355 else
356 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
357 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
358 emake -f client.mk
359 fi
360
361 }
362
363 src_install() {
364 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
365 DICTPATH="\"${EPREFIX}/usr/share/myspell\""
366
367 # MOZ_BUILD_ROOT, and hence OBJ_DIR change depending on arch, compiler, pgo, etc.
368 local obj_dir="$(echo */config.log)"
369 obj_dir="${obj_dir%/*}"
370 cd "${S}/${obj_dir}" || die
371
372 # Pax mark xpcshell for hardened support, only used for startupcache creation.
373 pax-mark m "${S}/${obj_dir}"/dist/bin/xpcshell
374
375 # Add our default prefs for firefox
376 cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
377 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
378 || die
379
380 # Set default path to search for dictionaries.
381 echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
382 >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
383 || die
384
385 echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
386 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
387 || die
388
389 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
390 emake DESTDIR="${D}" install
391
392 # Install language packs
393 mozlinguas_src_install
394
395 local size sizes icon_path icon name
396 if use bindist; then
397 sizes="16 32 48"
398 icon_path="${S}/browser/branding/aurora"
399 # Firefox's new rapid release cycle means no more codenames
400 # Let's just stick with this one...
401 icon="aurora"
402 name="Aurora"
403 else
404 sizes="16 22 24 32 256"
405 icon_path="${S}/browser/branding/official"
406 icon="${PN}"
407 name="Mozilla Firefox"
408 fi
409
410 # Install icons and .desktop for menu entry
411 for size in ${sizes}; do
412 insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
413 newins "${icon_path}/default${size}.png" "${icon}.png"
414 done
415 # The 128x128 icon has a different name
416 insinto "/usr/share/icons/hicolor/128x128/apps"
417 newins "${icon_path}/mozicon128.png" "${icon}.png"
418 # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
419 newicon "${icon_path}/content/icon48.png" "${icon}.png"
420 newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
421 sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
422 "${ED}/usr/share/applications/${PN}.desktop" || die
423
424 # Add StartupNotify=true bug 237317
425 if use startup-notification ; then
426 echo "StartupNotify=true"\
427 >> "${ED}/usr/share/applications/${PN}.desktop" \
428 || die
429 fi
430
431 # Required in order to use plugins and even run firefox on hardened.
432 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin,plugin-container}
433 # Required in order for jit to work on hardened, as of firefox-31
434 use jit && pax-mark p "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin}
435
436 if use minimal; then
437 rm -r "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} \
438 || die "Failed to remove sdk and headers"
439 fi
440
441 # very ugly hack to make firefox not sigbus on sparc
442 # FIXME: is this still needed??
443 use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
444 -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" \
445 || die "sparc sed failed"; }
446
447 # revdep-rebuild entry
448 insinto /etc/revdep-rebuild
449 echo "SEARCH_DIRS_MASK=${MOZILLA_FIVE_HOME}" >> ${T}/10firefox
450 doins "${T}"/10${PN} || die
451 }
452
453 pkg_preinst() {
454 gnome2_icon_savelist
455 }
456
457 pkg_postinst() {
458 # Update mimedb for the new .desktop file
459 fdo-mime_desktop_database_update
460 gnome2_icon_cache_update
461 }
462
463 pkg_postrm() {
464 gnome2_icon_cache_update
465 }
466
467
468
469 1.1 www-client/firefox/firefox-31.1.0.ebuild
470
471 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/firefox-31.1.0.ebuild?rev=1.1&view=markup
472 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/firefox-31.1.0.ebuild?rev=1.1&content-type=text/plain
473
474 Index: firefox-31.1.0.ebuild
475 ===================================================================
476 # Copyright 1999-2014 Gentoo Foundation
477 # Distributed under the terms of the GNU General Public License v2
478 # $Header: /var/cvsroot/gentoo-x86/www-client/firefox/firefox-31.1.0.ebuild,v 1.1 2014/09/03 22:09:11 axs Exp $
479
480 EAPI="5"
481 VIRTUALX_REQUIRED="pgo"
482 WANT_AUTOCONF="2.1"
483 MOZ_ESR="1"
484
485 # This list can be updated with scripts/get_langs.sh from the mozilla overlay
486 MOZ_LANGS=( af ar as ast be bg bn-BD bn-IN br bs ca cs csb cy da de el en
487 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
488 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
489 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
490 th tr uk vi xh zh-CN zh-TW zu )
491
492 # Convert the ebuild version to the upstream mozilla version, used by mozlinguas
493 MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
494 MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
495 MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
496
497 if [[ ${MOZ_ESR} == 1 ]]; then
498 # ESR releases have slightly version numbers
499 MOZ_PV="${MOZ_PV}esr"
500 fi
501
502 # Patch version
503 PATCH="${PN}-31.0-patches-0.2"
504 # Upstream ftp release URI that's used by mozlinguas.eclass
505 # We don't use the http mirror because it deletes old tarballs.
506 MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases/"
507 MOZ_HTTP_URI="http://ftp.mozilla.org/pub/${PN}/releases/"
508
509 MOZCONFIG_OPTIONAL_WIFI=1
510 MOZCONFIG_OPTIONAL_JIT="enabled"
511
512 inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v4.1 multilib pax-utils fdo-mime autotools virtualx mozlinguas
513
514 DESCRIPTION="Firefox Web Browser"
515 HOMEPAGE="http://www.mozilla.com/firefox"
516
517 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
518 SLOT="0"
519 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
520 IUSE="bindist gstreamer hardened +minimal pgo pulseaudio selinux system-cairo system-icu system-jpeg system-sqlite test"
521
522 # More URIs appended below...
523 SRC_URI="${SRC_URI}
524 http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
525 http://dev.gentoo.org/~axs/distfiles/${PATCH}.tar.xz"
526
527 ASM_DEPEND=">=dev-lang/yasm-1.1"
528
529 # Mesa 10.2 needed due to some flash and plugin-container conflict when running 10.0[vdpau] and nouveau
530 RDEPEND="
531 >=dev-libs/nss-3.16.2
532 >=dev-libs/nspr-4.10.6
533 >=media-libs/mesa-10.2
534 >=media-libs/libpng-1.6.7[apng]
535 virtual/libffi
536 gstreamer? ( media-plugins/gst-plugins-meta:1.0[ffmpeg] )
537 pulseaudio? ( media-sound/pulseaudio )
538 system-cairo? ( >=x11-libs/cairo-1.12[X] )
539 system-icu? ( >=dev-libs/icu-51.1 )
540 system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
541 system-sqlite? ( >=dev-db/sqlite-3.8.3.1:3[secure-delete,debug=] )
542 >=media-libs/libvpx-1.3.0
543 kernel_linux? ( media-libs/alsa-lib )
544 selinux? ( sec-policy/selinux-mozilla )"
545
546 DEPEND="${RDEPEND}
547 >=sys-devel/binutils-2.16.1
548 virtual/pkgconfig
549 pgo? (
550 >=sys-devel/gcc-4.5 )
551 amd64? ( ${ASM_DEPEND}
552 virtual/opengl )
553 x86? ( ${ASM_DEPEND}
554 virtual/opengl )"
555
556 # No source releases for alpha|beta
557 if [[ ${PV} =~ alpha ]]; then
558 CHANGESET="8a3042764de7"
559 SRC_URI="${SRC_URI}
560 http://dev.gentoo.org/~nirbheek/mozilla/firefox/firefox-${MOZ_PV}_${CHANGESET}.source.tar.bz2"
561 S="${WORKDIR}/mozilla-aurora-${CHANGESET}"
562 elif [[ ${PV} =~ beta ]]; then
563 S="${WORKDIR}/mozilla-beta"
564 SRC_URI="${SRC_URI}
565 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
566 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
567 else
568 SRC_URI="${SRC_URI}
569 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
570 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
571 if [[ ${MOZ_ESR} == 1 ]]; then
572 S="${WORKDIR}/mozilla-esr${PV%%.*}"
573 else
574 S="${WORKDIR}/mozilla-release"
575 fi
576 fi
577
578 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
579
580 pkg_setup() {
581 moz_pkgsetup
582
583 # Avoid PGO profiling problems due to enviroment leakage
584 # These should *always* be cleaned up anyway
585 unset DBUS_SESSION_BUS_ADDRESS \
586 DISPLAY \
587 ORBIT_SOCKETDIR \
588 SESSION_MANAGER \
589 XDG_SESSION_COOKIE \
590 XAUTHORITY
591
592 if ! use bindist; then
593 einfo
594 elog "You are enabling official branding. You may not redistribute this build"
595 elog "to any users on your network or the internet. Doing so puts yourself into"
596 elog "a legal problem with Mozilla Foundation"
597 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
598 fi
599
600 if use pgo; then
601 einfo
602 ewarn "You will do a double build for profile guided optimization."
603 ewarn "This will result in your build taking at least twice as long as before."
604 fi
605 }
606
607 pkg_pretend() {
608 # Ensure we have enough disk space to compile
609 if use pgo || use debug || use test ; then
610 CHECKREQS_DISK_BUILD="8G"
611 else
612 CHECKREQS_DISK_BUILD="4G"
613 fi
614 check-reqs_pkg_setup
615 }
616
617 src_unpack() {
618 unpack ${A}
619
620 # Unpack language packs
621 mozlinguas_src_unpack
622 }
623
624 src_prepare() {
625 # Apply our patches
626 EPATCH_SUFFIX="patch" \
627 EPATCH_FORCE="yes" \
628 epatch "${WORKDIR}/firefox"
629
630 # Allow user to apply any additional patches without modifing ebuild
631 epatch_user
632
633 # Enable gnomebreakpad
634 if use debug ; then
635 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
636 "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
637 fi
638
639 # Ensure that our plugins dir is enabled as default
640 sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
641 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
642 sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
643 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
644
645 # Fix sandbox violations during make clean, bug 372817
646 sed -e "s:\(/no-such-file\):${T}\1:g" \
647 -i "${S}"/config/rules.mk \
648 -i "${S}"/nsprpub/configure{.in,} \
649 || die
650
651 # Don't exit with error when some libs are missing which we have in
652 # system.
653 sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
654 -i "${S}"/browser/installer/Makefile.in || die
655
656 # Don't error out when there's no files to be removed:
657 sed 's@\(xargs rm\)$@\1 -f@' \
658 -i "${S}"/toolkit/mozapps/installer/packager.mk || die
659
660 eautoreconf
661
662 # Must run autoconf in js/src
663 cd "${S}"/js/src || die
664 eautoconf
665 }
666
667 src_configure() {
668 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
669 MEXTENSIONS="default"
670 # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
671 # Note: These are for Gentoo Linux use ONLY. For your own distribution, please
672 # get your own set of keys.
673 _google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
674
675 ####################################
676 #
677 # mozconfig, CFLAGS and CXXFLAGS setup
678 #
679 ####################################
680
681 mozconfig_init
682 mozconfig_config
683
684 # It doesn't compile on alpha without this LDFLAGS
685 use alpha && append-ldflags "-Wl,--no-relax"
686
687 # Add full relro support for hardened
688 use hardened && append-ldflags "-Wl,-z,relro,-z,now"
689
690 # We must force enable jemalloc 3 threw .mozconfig
691 echo "export MOZ_JEMALLOC=1" >> "${S}"/.mozconfig || die
692
693 # Setup api key for location services
694 echo -n "${_google_api_key}" > "${S}"/google-api-key
695 mozconfig_annotate '' --with-google-api-keyfile="${S}/google-api-key"
696
697 mozconfig_annotate '' --enable-jemalloc
698 mozconfig_annotate '' --enable-replace-malloc
699 mozconfig_annotate '' --prefix="${EPREFIX}"/usr
700 mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
701 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
702 mozconfig_annotate '' --disable-gconf
703 mozconfig_annotate '' --disable-mailnews
704 mozconfig_annotate '' --with-system-png
705 mozconfig_annotate '' --enable-system-ffi
706 mozconfig_annotate '' --disable-gold
707
708 # Other ff-specific settings
709 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
710 mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
711 mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
712
713 # gstreamer now needs the version specified
714 if use gstreamer; then
715 mozconfig_annotate '' --enable-gstreamer=1.0
716 else
717 mozconfig_annotate '' --disable-gstreamer
718 fi
719 mozconfig_use_enable pulseaudio
720 mozconfig_use_enable system-cairo
721 mozconfig_use_enable system-sqlite
722 mozconfig_use_with system-jpeg
723 mozconfig_use_with system-icu
724 mozconfig_use_enable system-icu intl-api
725
726 # Allow for a proper pgo build
727 if use pgo; then
728 echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
729 fi
730
731 # Finalize and report settings
732 mozconfig_final
733
734 if [[ $(gcc-major-version) -lt 4 ]]; then
735 append-cxxflags -fno-stack-protector
736 elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]]; then
737 if use amd64 || use x86; then
738 append-flags -mno-avx
739 fi
740 fi
741 }
742
743 src_compile() {
744 if use pgo; then
745 addpredict /root
746 addpredict /etc/gconf
747 # Reset and cleanup environment variables used by GNOME/XDG
748 gnome2_environment_reset
749
750 # Firefox tries to use dri stuff when it's run, see bug 380283
751 shopt -s nullglob
752 cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
753 if test -z "${cards}"; then
754 cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
755 if test -n "${cards}"; then
756 # Binary drivers seem to cause access violations anyway, so
757 # let's use indirect rendering so that the device files aren't
758 # touched at all. See bug 394715.
759 export LIBGL_ALWAYS_INDIRECT=1
760 fi
761 fi
762 shopt -u nullglob
763 addpredict "${cards}"
764
765 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
766 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
767 Xemake -f client.mk profiledbuild || die "Xemake failed"
768 else
769 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
770 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
771 emake -f client.mk
772 fi
773
774 }
775
776 src_install() {
777 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
778 DICTPATH="\"${EPREFIX}/usr/share/myspell\""
779
780 # MOZ_BUILD_ROOT, and hence OBJ_DIR change depending on arch, compiler, pgo, etc.
781 local obj_dir="$(echo */config.log)"
782 obj_dir="${obj_dir%/*}"
783 cd "${S}/${obj_dir}" || die
784
785 # Pax mark xpcshell for hardened support, only used for startupcache creation.
786 pax-mark m "${S}/${obj_dir}"/dist/bin/xpcshell
787
788 # Add our default prefs for firefox
789 cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
790 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
791 || die
792
793 # Set default path to search for dictionaries.
794 echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
795 >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
796 || die
797
798 echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
799 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
800 || die
801
802 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
803 emake DESTDIR="${D}" install
804
805 # Install language packs
806 mozlinguas_src_install
807
808 local size sizes icon_path icon name
809 if use bindist; then
810 sizes="16 32 48"
811 icon_path="${S}/browser/branding/aurora"
812 # Firefox's new rapid release cycle means no more codenames
813 # Let's just stick with this one...
814 icon="aurora"
815 name="Aurora"
816 else
817 sizes="16 22 24 32 256"
818 icon_path="${S}/browser/branding/official"
819 icon="${PN}"
820 name="Mozilla Firefox"
821 fi
822
823 # Install icons and .desktop for menu entry
824 for size in ${sizes}; do
825 insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
826 newins "${icon_path}/default${size}.png" "${icon}.png"
827 done
828 # The 128x128 icon has a different name
829 insinto "/usr/share/icons/hicolor/128x128/apps"
830 newins "${icon_path}/mozicon128.png" "${icon}.png"
831 # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
832 newicon "${icon_path}/content/icon48.png" "${icon}.png"
833 newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
834 sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
835 "${ED}/usr/share/applications/${PN}.desktop" || die
836
837 # Add StartupNotify=true bug 237317
838 if use startup-notification ; then
839 echo "StartupNotify=true"\
840 >> "${ED}/usr/share/applications/${PN}.desktop" \
841 || die
842 fi
843
844 # Required in order to use plugins and even run firefox on hardened.
845 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin,plugin-container}
846
847 if use minimal; then
848 rm -r "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} \
849 || die "Failed to remove sdk and headers"
850 fi
851
852 # very ugly hack to make firefox not sigbus on sparc
853 # FIXME: is this still needed??
854 use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
855 -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" \
856 || die "sparc sed failed"; }
857
858 # revdep-rebuild entry
859 insinto /etc/revdep-rebuild
860 echo "SEARCH_DIRS_MASK=${MOZILLA_FIVE_HOME}" >> ${T}/10firefox
861 doins "${T}"/10${PN} || die
862 }
863
864 pkg_preinst() {
865 gnome2_icon_savelist
866 }
867
868 pkg_postinst() {
869 # Update mimedb for the new .desktop file
870 fdo-mime_desktop_database_update
871 gnome2_icon_cache_update
872 }
873
874 pkg_postrm() {
875 gnome2_icon_cache_update
876 }
877
878
879
880 1.1 www-client/firefox/firefox-24.8.0.ebuild
881
882 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/firefox-24.8.0.ebuild?rev=1.1&view=markup
883 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/firefox/firefox-24.8.0.ebuild?rev=1.1&content-type=text/plain
884
885 Index: firefox-24.8.0.ebuild
886 ===================================================================
887 # Copyright 1999-2014 Gentoo Foundation
888 # Distributed under the terms of the GNU General Public License v2
889 # $Header: /var/cvsroot/gentoo-x86/www-client/firefox/firefox-24.8.0.ebuild,v 1.1 2014/09/03 22:09:11 axs Exp $
890
891 EAPI=5
892 VIRTUALX_REQUIRED="pgo"
893 WANT_AUTOCONF="2.1"
894 MOZ_ESR="1"
895
896 # This list can be updated with scripts/get_langs.sh from the mozilla overlay
897 MOZ_LANGS=(af ak ar as ast be bg bn-BD bn-IN br bs ca cs csb cy da de
898 el en en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa fi fr
899 fy-NL ga-IE gd gl gu-IN he hi-IN hr hu hy-AM id is it ja kk km kn ko ku
900 lg lt lv mai mk ml mr nb-NO nl nn-NO nso or pa-IN pl pt-BR pt-PT rm ro
901 ru si sk sl son sq sr sv-SE ta ta-LK te th tr uk vi zh-CN zh-TW zu )
902
903 # Convert the ebuild version to the upstream mozilla version, used by mozlinguas
904 MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
905 MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
906 MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
907
908 if [[ ${MOZ_ESR} == 1 ]]; then
909 # ESR releases have slightly version numbers
910 MOZ_PV="${MOZ_PV}esr"
911 fi
912
913 # Patch version
914 PATCH="${PN}-24.0-patches-0.9"
915 # Upstream ftp release URI that's used by mozlinguas.eclass
916 # We don't use the http mirror because it deletes old tarballs.
917 MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${PN}/releases/"
918 MOZ_HTTP_URI="http://ftp.mozilla.org/pub/${PN}/releases/"
919
920 inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-3 multilib pax-utils fdo-mime autotools virtualx mozlinguas
921
922 DESCRIPTION="Firefox Web Browser"
923 HOMEPAGE="http://www.mozilla.com/firefox"
924
925 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
926 SLOT="0"
927 LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
928 IUSE="bindist gstreamer +jit +minimal pgo pulseaudio selinux system-cairo system-icu system-jpeg system-sqlite test"
929
930 # More URIs appended below...
931 SRC_URI="${SRC_URI}
932 http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
933 http://dev.gentoo.org/~nirbheek/mozilla/patchsets/${PATCH}.tar.xz"
934
935 ASM_DEPEND=">=dev-lang/yasm-1.1"
936
937 # Mesa 7.10 needed for WebGL + bugfixes
938 RDEPEND="
939 >=dev-libs/nss-3.16.2
940 >=dev-libs/nspr-4.10.4
941 >=dev-libs/glib-2.26:2
942 >=media-libs/mesa-7.10
943 >=media-libs/libpng-1.5.13[apng]
944 virtual/libffi
945 gstreamer? ( media-plugins/gst-plugins-meta:0.10[ffmpeg] )
946 pulseaudio? ( media-sound/pulseaudio )
947 system-cairo? ( >=x11-libs/cairo-1.12[X] )
948 system-icu? ( >=dev-libs/icu-51.1 )
949 system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
950 system-sqlite? ( >=dev-db/sqlite-3.7.17:3[secure-delete,debug=] )
951 >=media-libs/libvpx-1.0.0
952 kernel_linux? ( media-libs/alsa-lib )
953 selinux? ( sec-policy/selinux-mozilla )"
954
955 DEPEND="${RDEPEND}
956 >=sys-devel/binutils-2.16.1
957 virtual/pkgconfig
958 pgo? (
959 >=sys-devel/gcc-4.5 )
960 amd64? ( ${ASM_DEPEND}
961 virtual/opengl )
962 x86? ( ${ASM_DEPEND}
963 virtual/opengl )"
964
965 # No source releases for alpha|beta
966 if [[ ${PV} =~ alpha ]]; then
967 CHANGESET="8a3042764de7"
968 SRC_URI="${SRC_URI}
969 http://dev.gentoo.org/~nirbheek/mozilla/firefox/firefox-${MOZ_PV}_${CHANGESET}.source.tar.bz2"
970 S="${WORKDIR}/mozilla-aurora-${CHANGESET}"
971 elif [[ ${PV} =~ beta ]]; then
972 S="${WORKDIR}/mozilla-beta"
973 SRC_URI="${SRC_URI}
974 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
975 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
976 else
977 SRC_URI="${SRC_URI}
978 ${MOZ_FTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2
979 ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.bz2"
980 if [[ ${MOZ_ESR} == 1 ]]; then
981 S="${WORKDIR}/mozilla-esr${PV%%.*}"
982 else
983 S="${WORKDIR}/mozilla-release"
984 fi
985 fi
986
987 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/firefox"
988
989 pkg_setup() {
990 moz_pkgsetup
991
992 # Avoid PGO profiling problems due to enviroment leakage
993 # These should *always* be cleaned up anyway
994 unset DBUS_SESSION_BUS_ADDRESS \
995 DISPLAY \
996 ORBIT_SOCKETDIR \
997 SESSION_MANAGER \
998 XDG_SESSION_COOKIE \
999 XAUTHORITY
1000
1001 if ! use bindist; then
1002 einfo
1003 elog "You are enabling official branding. You may not redistribute this build"
1004 elog "to any users on your network or the internet. Doing so puts yourself into"
1005 elog "a legal problem with Mozilla Foundation"
1006 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
1007 fi
1008
1009 if use pgo; then
1010 einfo
1011 ewarn "You will do a double build for profile guided optimization."
1012 ewarn "This will result in your build taking at least twice as long as before."
1013 fi
1014 }
1015
1016 pkg_pretend() {
1017 # Ensure we have enough disk space to compile
1018 if use pgo || use debug || use test ; then
1019 CHECKREQS_DISK_BUILD="8G"
1020 else
1021 CHECKREQS_DISK_BUILD="4G"
1022 fi
1023 check-reqs_pkg_setup
1024 }
1025
1026 src_unpack() {
1027 unpack ${A}
1028
1029 # Unpack language packs
1030 mozlinguas_src_unpack
1031 }
1032
1033 src_prepare() {
1034 # Apply our patches
1035 EPATCH_SUFFIX="patch" \
1036 EPATCH_FORCE="yes" \
1037 epatch "${WORKDIR}/firefox"
1038
1039 # Allow user to apply any additional patches without modifing ebuild
1040 epatch_user
1041
1042 # Enable gnomebreakpad
1043 if use debug ; then
1044 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
1045 "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
1046 fi
1047
1048 # Ensure that our plugins dir is enabled as default
1049 sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
1050 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
1051 sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
1052 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
1053
1054 # Fix sandbox violations during make clean, bug 372817
1055 sed -e "s:\(/no-such-file\):${T}\1:g" \
1056 -i "${S}"/config/rules.mk \
1057 -i "${S}"/js/src/config/rules.mk \
1058 -i "${S}"/nsprpub/configure{.in,} \
1059 || die
1060
1061 # Don't exit with error when some libs are missing which we have in
1062 # system.
1063 sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
1064 -i "${S}"/browser/installer/Makefile.in || die
1065
1066 # Don't error out when there's no files to be removed:
1067 sed 's@\(xargs rm\)$@\1 -f@' \
1068 -i "${S}"/toolkit/mozapps/installer/packager.mk || die
1069
1070 eautoreconf
1071
1072 # Must run autoconf in js/src
1073 cd "${S}"/js/src || die
1074 eautoconf
1075 }
1076
1077 src_configure() {
1078 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
1079 MEXTENSIONS="default"
1080
1081 ####################################
1082 #
1083 # mozconfig, CFLAGS and CXXFLAGS setup
1084 #
1085 ####################################
1086
1087 mozconfig_init
1088 mozconfig_config
1089
1090 # It doesn't compile on alpha without this LDFLAGS
1091 use alpha && append-ldflags "-Wl,--no-relax"
1092
1093 # We must force enable jemalloc 3 threw .mozconfig
1094 echo "export MOZ_JEMALLOC=1" >> ${S}/.mozconfig
1095
1096 mozconfig_annotate '' --enable-jemalloc
1097 mozconfig_annotate '' --enable-replace-malloc
1098 mozconfig_annotate '' --prefix="${EPREFIX}"/usr
1099 mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
1100 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
1101 mozconfig_annotate '' --disable-gconf
1102 mozconfig_annotate '' --disable-mailnews
1103 mozconfig_annotate '' --with-system-png
1104 mozconfig_annotate '' --enable-system-ffi
1105
1106 # Other ff-specific settings
1107 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
1108 mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
1109 mozconfig_annotate '' --build="${CTARGET:-${CHOST}}"
1110
1111 mozconfig_use_enable gstreamer
1112 mozconfig_use_enable pulseaudio
1113 mozconfig_use_enable system-cairo
1114 mozconfig_use_enable system-sqlite
1115 mozconfig_use_with system-jpeg
1116 mozconfig_use_with system-icu
1117 mozconfig_use_enable system-icu intl-api
1118 # Feature is know to cause problems on hardened
1119 mozconfig_use_enable jit ion
1120
1121 # Allow for a proper pgo build
1122 if use pgo; then
1123 echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
1124 fi
1125
1126 # Finalize and report settings
1127 mozconfig_final
1128
1129 if [[ $(gcc-major-version) -lt 4 ]]; then
1130 append-cxxflags -fno-stack-protector
1131 elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]]; then
1132 if use amd64 || use x86; then
1133 append-flags -mno-avx
1134 fi
1135 fi
1136 }
1137
1138 src_compile() {
1139 if use pgo; then
1140 addpredict /root
1141 addpredict /etc/gconf
1142 # Reset and cleanup environment variables used by GNOME/XDG
1143 gnome2_environment_reset
1144
1145 # Firefox tries to use dri stuff when it's run, see bug 380283
1146 shopt -s nullglob
1147 cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
1148 if test -z "${cards}"; then
1149 cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
1150 if test -n "${cards}"; then
1151 # Binary drivers seem to cause access violations anyway, so
1152 # let's use indirect rendering so that the device files aren't
1153 # touched at all. See bug 394715.
1154 export LIBGL_ALWAYS_INDIRECT=1
1155 fi
1156 fi
1157 shopt -u nullglob
1158 addpredict "${cards}"
1159
1160 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
1161 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
1162 Xemake -f client.mk profiledbuild || die "Xemake failed"
1163 else
1164 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
1165 MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
1166 emake -f client.mk
1167 fi
1168
1169 }
1170
1171 src_install() {
1172 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
1173 DICTPATH="\"${EPREFIX}/usr/share/myspell\""
1174
1175 # MOZ_BUILD_ROOT, and hence OBJ_DIR change depending on arch, compiler, pgo, etc.
1176 local obj_dir="$(echo */config.log)"
1177 obj_dir="${obj_dir%/*}"
1178 cd "${S}/${obj_dir}" || die
1179
1180 # Pax mark xpcshell for hardened support, only used for startupcache creation.
1181 pax-mark m "${S}/${obj_dir}"/dist/bin/xpcshell
1182
1183 # Add our default prefs for firefox
1184 cp "${FILESDIR}"/gentoo-default-prefs.js-1 \
1185 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
1186 || die
1187
1188 # Set default path to search for dictionaries.
1189 echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
1190 >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
1191 || die
1192
1193 if ! use libnotify; then
1194 echo "pref(\"browser.download.manager.showAlertOnComplete\", false);" \
1195 >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
1196 || die
1197 fi
1198
1199 echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
1200 "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
1201 || die
1202
1203 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
1204 emake DESTDIR="${D}" install
1205
1206 # Install language packs
1207 mozlinguas_src_install
1208
1209 local size sizes icon_path icon name
1210 if use bindist; then
1211 sizes="16 32 48"
1212 icon_path="${S}/browser/branding/aurora"
1213 # Firefox's new rapid release cycle means no more codenames
1214 # Let's just stick with this one...
1215 icon="aurora"
1216 name="Aurora"
1217 else
1218 sizes="16 22 24 32 256"
1219 icon_path="${S}/browser/branding/official"
1220 icon="${PN}"
1221 name="Mozilla Firefox"
1222 fi
1223
1224 # Install icons and .desktop for menu entry
1225 for size in ${sizes}; do
1226 insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
1227 newins "${icon_path}/default${size}.png" "${icon}.png"
1228 done
1229 # The 128x128 icon has a different name
1230 insinto "/usr/share/icons/hicolor/128x128/apps"
1231 newins "${icon_path}/mozicon128.png" "${icon}.png"
1232 # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
1233 newicon "${icon_path}/content/icon48.png" "${icon}.png"
1234 newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
1235 sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
1236 "${ED}/usr/share/applications/${PN}.desktop" || die
1237
1238 # Add StartupNotify=true bug 237317
1239 if use startup-notification ; then
1240 echo "StartupNotify=true" \
1241 >> "${ED}/usr/share/applications/${PN}.desktop" \
1242 || die
1243 fi
1244
1245 # Required in order to use plugins and even run firefox on hardened.
1246 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin,plugin-container}
1247
1248 if use minimal; then
1249 rm -r "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} \
1250 || die "Failed to remove sdk and headers"
1251 fi
1252
1253 # very ugly hack to make firefox not sigbus on sparc
1254 # FIXME: is this still needed??
1255 use sparc && { sed -e 's/Firefox/FirefoxGentoo/g' \
1256 -i "${ED}/${MOZILLA_FIVE_HOME}/application.ini" \
1257 || die "sparc sed failed"; }
1258 }
1259
1260 pkg_preinst() {
1261 gnome2_icon_savelist
1262 }
1263
1264 pkg_postinst() {
1265 # Update mimedb for the new .desktop file
1266 fdo-mime_desktop_database_update
1267 gnome2_icon_cache_update
1268 }
1269
1270 pkg_postrm() {
1271 gnome2_icon_cache_update
1272 }