Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/firefox/
Date: Wed, 13 Mar 2019 01:57:07
Message-Id: 1552442209.1fa559150be4303089772f74ad9956594478233b.whissi@gentoo
1 commit: 1fa559150be4303089772f74ad9956594478233b
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 13 01:48:31 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 13 01:56:49 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fa55915
7
8 www-client/firefox: bump to v66.0 Beta 14
9
10 Package-Manager: Portage-2.3.62, Repoman-2.3.12
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 www-client/firefox/Manifest | 2 +
14 www-client/firefox/firefox-66.0_beta14.ebuild | 759 ++++++++++++++++++++++++++
15 2 files changed, 761 insertions(+)
16
17 diff --git a/www-client/firefox/Manifest b/www-client/firefox/Manifest
18 index bb516979372..e4675227980 100644
19 --- a/www-client/firefox/Manifest
20 +++ b/www-client/firefox/Manifest
21 @@ -277,3 +277,5 @@ DIST firefox-65.0.2-xh.xpi 455426 BLAKE2B 6e8e85cd986e6a7c826b6e3e50db33deecb7d1
22 DIST firefox-65.0.2-zh-CN.xpi 494811 BLAKE2B ce81c30d472eacbf38b793fd3f4e592552cad03b3d9941d7d6a6eec1aea071561a514bd92eecbd57394fb624713df0839bb4d5b498b3d0d1efbcfa27e34892aa SHA512 31f008e4e82c96c258c93ce214deb7af5078e65ab83af4e40ecf8c26e0db60bd29718cc47ba1a3cc93aaa77cc7f69edfdd93bb9eea52f914a787bc955036ce2e
23 DIST firefox-65.0.2-zh-TW.xpi 492982 BLAKE2B 8b3700caaeb9a36465415d3a209b3878fb455975fc5d100b1fe1238521fad0138eff2d6d67e49ee6b931de151ba1aee5fbba0b751e3ed19a214a615eec68d5bf SHA512 2b7e3fc170db97cf261dad2304f2d377f58255e91bd351be02e9f2bbdbfb847968feba801509ed6a5349ee525df992ea7a1342cefdd8ae463aaca7c36912b32d
24 DIST firefox-65.0.2.source.tar.xz 279607324 BLAKE2B 5de98ebbba0fe1ded1a31c4943bb295f1e035c37c1b270f54e653ab89387a98f678bb8ea7971b2a9ebabc93633bb47d3bf65f7df859c72d86498b73654483212 SHA512 880c95f3563c475684be337209b825352de3622caa83322c70b4177010d00c3b0550c7f6156793248433802deab62279eaa2c3b463ece27669c80ba3799ea8b0
25 +DIST firefox-66.0-patches-01.tar.xz 16788 BLAKE2B bec8f5a3429667984fca97a9459872ed191bb6ce5010597f993c8240763e013c9894aa336a3d329a3374677f3a8a254b6d25c95d1cdda56f4b1621860a736940 SHA512 a803ca8a6374a1df380aeeb94d423c3cea3f9b8610397108d6ca209fc762259f1379481d7cfd0f60015359f8a49734c31f0518ea7d845d7db98e2821fef5f173
26 +DIST firefox-66.0b14.source.tar.xz 281596856 BLAKE2B db07ad9692856859d3c65563fda7d3a8f1fa016614da886a8e03266ec1d9eea68f8fafbccf89854b7a211748c2058410837318b1d5f461ed9ce7851ec029a780 SHA512 cc77b09e68f4a55b1e3e3d7eefe158f134f02e446e76b395570d8c2a2d0d201d2075631d459f5769f6ccb5d9e6ff0cf4af9c8b272589975cd887b5bfd565e832
27
28 diff --git a/www-client/firefox/firefox-66.0_beta14.ebuild b/www-client/firefox/firefox-66.0_beta14.ebuild
29 new file mode 100644
30 index 00000000000..27861531604
31 --- /dev/null
32 +++ b/www-client/firefox/firefox-66.0_beta14.ebuild
33 @@ -0,0 +1,759 @@
34 +# Copyright 1999-2019 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI="6"
38 +VIRTUALX_REQUIRED="pgo"
39 +WANT_AUTOCONF="2.1"
40 +MOZ_ESR=""
41 +
42 +PYTHON_COMPAT=( python3_{5,6,7} )
43 +PYTHON_REQ_USE='ncurses,sqlite,ssl,threads(+)'
44 +
45 +# This list can be updated with scripts/get_langs.sh from the mozilla overlay
46 +MOZ_LANGS=( ach af an ar as ast az bg bn-BD bn-IN br bs ca cak cs cy da de dsb
47 +el en en-GB en-US en-ZA eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE
48 +gd gl gn gu-IN he hi-IN hr hsb hu hy-AM id is it ja ka kab kk km kn ko lij lt lv
49 +mai mk ml mr ms nb-NO nl nn-NO or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq
50 +sr sv-SE ta te th tr uk uz vi xh zh-CN zh-TW )
51 +
52 +# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
53 +MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
54 +MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
55 +MOZ_PV="${MOZ_PV/_rc/rc}" # Handle rc for SRC_URI
56 +
57 +if [[ ${MOZ_ESR} == 1 ]] ; then
58 + # ESR releases have slightly different version numbers
59 + MOZ_PV="${MOZ_PV}esr"
60 +fi
61 +
62 +# Patch version
63 +PATCH="${PN}-66.0-patches-01"
64 +MOZ_HTTP_URI="https://archive.mozilla.org/pub/${PN}/releases"
65 +
66 +LLVM_MAX_SLOT=8
67 +
68 +inherit check-reqs eapi7-ver flag-o-matic toolchain-funcs eutils \
69 + gnome2-utils llvm mozcoreconf-v6 pax-utils xdg-utils \
70 + autotools mozlinguas-v2 virtualx
71 +
72 +DESCRIPTION="Firefox Web Browser"
73 +HOMEPAGE="https://www.mozilla.com/firefox"
74 +
75 +KEYWORDS=""
76 +
77 +SLOT="0"
78 +LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
79 +IUSE="bindist clang cpu_flags_x86_avx2 dbus debug eme-free geckodriver
80 + +gmp-autoupdate hardened hwaccel jack lto neon pgo pulseaudio
81 + +screenshot selinux startup-notification +system-harfbuzz
82 + +system-icu +system-jpeg +system-libevent +system-sqlite
83 + +system-libvpx +system-webp test wayland wifi"
84 +RESTRICT="!bindist? ( bindist )"
85 +
86 +PATCH_URIS=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c,whissi}/mozilla/patchsets/${PATCH}.tar.xz )
87 +SRC_URI="${SRC_URI}
88 + ${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.xz
89 + ${PATCH_URIS[@]}"
90 +
91 +CDEPEND="
92 + >=dev-libs/nss-3.42
93 + >=dev-libs/nspr-4.19
94 + >=app-text/hunspell-1.5.4:*
95 + dev-libs/atk
96 + dev-libs/expat
97 + >=x11-libs/cairo-1.10[X]
98 + >=x11-libs/gtk+-2.18:2
99 + >=x11-libs/gtk+-3.4.0:3
100 + x11-libs/gdk-pixbuf
101 + >=x11-libs/pango-1.22.0
102 + >=media-libs/libpng-1.6.35:0=[apng]
103 + >=media-libs/mesa-10.2:*
104 + media-libs/fontconfig
105 + >=media-libs/freetype-2.4.10
106 + kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) )
107 + virtual/freedesktop-icon-theme
108 + dbus? ( >=sys-apps/dbus-0.60
109 + >=dev-libs/dbus-glib-0.72 )
110 + startup-notification? ( >=x11-libs/startup-notification-0.8 )
111 + >=x11-libs/pixman-0.19.2
112 + >=dev-libs/glib-2.26:2
113 + >=sys-libs/zlib-1.2.3
114 + >=virtual/libffi-3.0.10:=
115 + virtual/ffmpeg
116 + x11-libs/libX11
117 + x11-libs/libXcomposite
118 + x11-libs/libXdamage
119 + x11-libs/libXext
120 + x11-libs/libXfixes
121 + x11-libs/libXrender
122 + x11-libs/libXt
123 + system-harfbuzz? ( >=media-libs/harfbuzz-2.3.1:0= >=media-gfx/graphite2-1.3.13 )
124 + system-icu? ( >=dev-libs/icu-63.1:= )
125 + system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
126 + system-libevent? ( >=dev-libs/libevent-2.0:0= )
127 + system-libvpx? (
128 + >=media-libs/libvpx-1.7.0:0=[postproc]
129 + <media-libs/libvpx-1.8:0=[postproc]
130 + )
131 + system-sqlite? ( >=dev-db/sqlite-3.26:3[secure-delete,debug=] )
132 + system-webp? ( >=media-libs/libwebp-1.0.1:0= )
133 + wifi? ( kernel_linux? ( >=sys-apps/dbus-0.60
134 + >=dev-libs/dbus-glib-0.72
135 + net-misc/networkmanager ) )
136 + jack? ( virtual/jack )
137 + selinux? ( sec-policy/selinux-mozilla )"
138 +
139 +RDEPEND="${CDEPEND}
140 + jack? ( virtual/jack )
141 + pulseaudio? ( || ( media-sound/pulseaudio
142 + >=media-sound/apulse-0.1.9 ) )
143 + selinux? ( sec-policy/selinux-mozilla )"
144 +
145 +DEPEND="${CDEPEND}
146 + app-arch/zip
147 + app-arch/unzip
148 + >=dev-util/cbindgen-0.6.8
149 + <dev-util/cbindgen-0.8
150 + >=net-libs/nodejs-8.11.0
151 + >=sys-devel/binutils-2.30
152 + sys-apps/findutils
153 + || (
154 + (
155 + sys-devel/clang:8
156 + !clang? ( sys-devel/llvm:8 )
157 + clang? (
158 + =sys-devel/lld-8*
159 + sys-devel/llvm:8[gold]
160 + pgo? ( =sys-libs/compiler-rt-sanitizers-8*[profile] )
161 + )
162 + )
163 + (
164 + sys-devel/clang:7
165 + !clang? ( sys-devel/llvm:7 )
166 + clang? (
167 + =sys-devel/lld-7*
168 + sys-devel/llvm:7[gold]
169 + pgo? ( =sys-libs/compiler-rt-sanitizers-7*[profile] )
170 + )
171 + )
172 + (
173 + sys-devel/clang:6
174 + !clang? ( sys-devel/llvm:6 )
175 + clang? (
176 + =sys-devel/lld-6*
177 + sys-devel/llvm:6[gold]
178 + pgo? ( =sys-libs/compiler-rt-sanitizers-6*[profile] )
179 + )
180 + )
181 + (
182 + sys-devel/clang:5
183 + !clang? ( sys-devel/llvm:5 )
184 + clang? (
185 + =sys-devel/lld-5*
186 + sys-devel/llvm:5[gold]
187 + pgo? ( =sys-libs/compiler-rt-sanitizers-5*[profile] )
188 + )
189 + )
190 + (
191 + sys-devel/clang:4
192 + !clang? ( sys-devel/llvm:4 )
193 + clang? (
194 + =sys-devel/lld-4*
195 + sys-devel/llvm:4[gold]
196 + pgo? ( =sys-libs/compiler-rt-sanitizers-4*[profile] )
197 + )
198 + )
199 + )
200 + pulseaudio? ( media-sound/pulseaudio )
201 + >=virtual/cargo-1.30.0
202 + >=virtual/rust-1.30.0
203 + wayland? ( >=x11-libs/gtk+-3.11:3[wayland] )
204 + amd64? ( >=dev-lang/yasm-1.1 virtual/opengl )
205 + x86? ( >=dev-lang/yasm-1.1 virtual/opengl )"
206 +
207 +# Due to a bug in GCC, profile guided optimization will produce
208 +# AVX2 instructions, bug #677052
209 +REQUIRED_USE="wifi? ( dbus )
210 + pgo? ( lto )"
211 +
212 +S="${WORKDIR}/firefox-${PV%_*}"
213 +
214 +QA_PRESTRIPPED="usr/lib*/${PN}/firefox"
215 +
216 +BUILD_OBJ_DIR="${S}/ff"
217 +
218 +# allow GMP_PLUGIN_LIST to be set in an eclass or
219 +# overridden in the enviromnent (advanced hackers only)
220 +if [[ -z $GMP_PLUGIN_LIST ]] ; then
221 + GMP_PLUGIN_LIST=( gmp-gmpopenh264 gmp-widevinecdm )
222 +fi
223 +
224 +llvm_check_deps() {
225 + if ! has_version "sys-devel/clang:${LLVM_SLOT}" ; then
226 + ewarn "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..."
227 + return 1
228 + fi
229 +
230 + if use clang ; then
231 + if ! has_version "=sys-devel/lld-${LLVM_SLOT}*" ; then
232 + ewarn "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..."
233 + return 1
234 + fi
235 +
236 + if use pgo ; then
237 + if ! has_version "=sys-libs/compiler-rt-sanitizers-${LLVM_SLOT}*" ; then
238 + ewarn "=sys-libs/compiler-rt-sanitizers-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..."
239 + return 1
240 + fi
241 + fi
242 + fi
243 +
244 + einfo "Will use LLVM slot ${LLVM_SLOT}!"
245 +}
246 +
247 +pkg_setup() {
248 + moz_pkgsetup
249 +
250 + # Avoid PGO profiling problems due to enviroment leakage
251 + # These should *always* be cleaned up anyway
252 + unset DBUS_SESSION_BUS_ADDRESS \
253 + DISPLAY \
254 + ORBIT_SOCKETDIR \
255 + SESSION_MANAGER \
256 + XDG_SESSION_COOKIE \
257 + XAUTHORITY
258 +
259 + if ! use bindist ; then
260 + einfo
261 + elog "You are enabling official branding. You may not redistribute this build"
262 + elog "to any users on your network or the internet. Doing so puts yourself into"
263 + elog "a legal problem with Mozilla Foundation."
264 + elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag."
265 + fi
266 +
267 + addpredict /proc/self/oom_score_adj
268 +
269 + llvm_pkg_setup
270 +}
271 +
272 +pkg_pretend() {
273 + # Ensure we have enough disk space to compile
274 + if use pgo || use debug || use test ; then
275 + CHECKREQS_DISK_BUILD="8G"
276 + else
277 + CHECKREQS_DISK_BUILD="4G"
278 + fi
279 +
280 + check-reqs_pkg_setup
281 +}
282 +
283 +src_unpack() {
284 + unpack ${A}
285 +
286 + # Unpack language packs
287 + mozlinguas_src_unpack
288 +}
289 +
290 +src_prepare() {
291 + # remove for non-beta release
292 + rm "${WORKDIR}"/firefox/3000_use_the_Mozilla_location_service_when_no_Google_key_is_available.patch
293 + eapply "${WORKDIR}/firefox"
294 +
295 + # Allow user to apply any additional patches without modifing ebuild
296 + eapply_user
297 +
298 + # Enable gnomebreakpad
299 + if use debug ; then
300 + sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
301 + "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
302 + fi
303 +
304 + # Drop -Wl,--as-needed related manipulation for ia64 as it causes ld sefgaults, bug #582432
305 + if use ia64 ; then
306 + sed -i \
307 + -e '/^OS_LIBS += no_as_needed/d' \
308 + -e '/^OS_LIBS += as_needed/d' \
309 + "${S}"/widget/gtk/mozgtk/gtk2/moz.build \
310 + "${S}"/widget/gtk/mozgtk/gtk3/moz.build \
311 + || die "sed failed to drop --as-needed for ia64"
312 + fi
313 +
314 + # Ensure that our plugins dir is enabled as default
315 + sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
316 + "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
317 + sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
318 + "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
319 +
320 + # Fix sandbox violations during make clean, bug 372817
321 + sed -e "s:\(/no-such-file\):${T}\1:g" \
322 + -i "${S}"/config/rules.mk \
323 + -i "${S}"/nsprpub/configure{.in,} \
324 + || die
325 +
326 + # Don't exit with error when some libs are missing which we have in
327 + # system.
328 + sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
329 + -i "${S}"/browser/installer/Makefile.in || die
330 +
331 + # Don't error out when there's no files to be removed:
332 + sed 's@\(xargs rm\)$@\1 -f@' \
333 + -i "${S}"/toolkit/mozapps/installer/packager.mk || die
334 +
335 + # Keep codebase the same even if not using official branding
336 + sed '/^MOZ_DEV_EDITION=1/d' \
337 + -i "${S}"/browser/branding/aurora/configure.sh || die
338 +
339 + # rustfmt, a tool to format Rust code, is optional and not required to build Firefox.
340 + # However, when available, an unsupported version can cause problems, bug #669548
341 + sed -i -e "s@check_prog('RUSTFMT', add_rustup_path('rustfmt')@check_prog('RUSTFMT', add_rustup_path('rustfmt_do_not_use')@" \
342 + "${S}"/build/moz.configure/rust.configure || die
343 +
344 + # Autotools configure is now called old-configure.in
345 + # This works because there is still a configure.in that happens to be for the
346 + # shell wrapper configure script
347 + eautoreconf old-configure.in
348 +
349 + # Must run autoconf in js/src
350 + cd "${S}"/js/src || die
351 + eautoconf old-configure.in
352 +}
353 +
354 +src_configure() {
355 + MEXTENSIONS="default"
356 + # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
357 + # Note: These are for Gentoo Linux use ONLY. For your own distribution, please
358 + # get your own set of keys.
359 + _google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
360 +
361 + # Add information about TERM to output (build.log) to aid debugging
362 + # blessings problems
363 + if [[ -n "${TERM}" ]] ; then
364 + einfo "TERM is set to: \"${TERM}\""
365 + else
366 + einfo "TERM is unset."
367 + fi
368 +
369 + if use clang && ! tc-is-clang ; then
370 + # Force clang
371 + einfo "Enforcing the use of clang due to USE=clang ..."
372 + CC=${CHOST}-clang
373 + CXX=${CHOST}-clang++
374 + strip-unsupported-flags
375 + elif ! use clang && ! tc-is-gcc ; then
376 + # Force gcc
377 + einfo "Enforcing the use of gcc due to USE=-clang ..."
378 + CC=${CHOST}-gcc
379 + CXX=${CHOST}-g++
380 + strip-unsupported-flags
381 + fi
382 +
383 + ####################################
384 + #
385 + # mozconfig, CFLAGS and CXXFLAGS setup
386 + #
387 + ####################################
388 +
389 + mozconfig_init
390 + # common config components
391 + mozconfig_annotate 'system_libs' \
392 + --with-system-zlib \
393 + --with-system-bz2
394 +
395 + # Must pass release in order to properly select linker
396 + mozconfig_annotate 'Enable by Gentoo' --enable-release
397 +
398 + # Don't let user's LTO flags clash with upstream's flags
399 + filter-flags -flto*
400 +
401 + if use lto ; then
402 + local show_old_compiler_warning=
403 +
404 + if use clang ; then
405 + # At this stage CC is adjusted and the following check will
406 + # will work
407 + if [[ $(clang-major-version) -lt 7 ]] ; then
408 + show_old_compiler_warning=1
409 + fi
410 +
411 + # Upstream only supports lld when using clang
412 + mozconfig_annotate "forcing ld=lld due to USE=clang and USE=lto" --enable-linker=lld
413 + else
414 + if [[ $(gcc-major-version) -lt 8 ]] ; then
415 + show_old_compiler_warning=1
416 + fi
417 +
418 + if ! use cpu_flags_x86_avx2 ; then
419 + local _gcc_version_with_ipa_cdtor_fix="8.3"
420 + local _current_gcc_version="$(gcc-major-version).$(gcc-minor-version)"
421 +
422 + if ver_test "${_current_gcc_version}" -lt "${_gcc_version_with_ipa_cdtor_fix}" ; then
423 + # due to a GCC bug, GCC will produce AVX2 instructions
424 + # even if the CPU doesn't support AVX2, https://gcc.gnu.org/ml/gcc-patches/2018-12/msg01142.html
425 + einfo "Disable IPA cdtor due to bug in GCC and missing AVX2 support -- triggered by USE=lto"
426 + append-ldflags -fdisable-ipa-cdtor
427 + else
428 + einfo "No GCC workaround required, GCC version is already patched!"
429 + fi
430 + else
431 + einfo "No GCC workaround required, system supports AVX2"
432 + fi
433 +
434 + # Linking only works when using ld.gold when LTO is enabled
435 + mozconfig_annotate "forcing ld=gold due to USE=lto" --enable-linker=gold
436 + fi
437 +
438 + if [[ -n "${show_old_compiler_warning}" ]] ; then
439 + # Checking compiler's major version uses CC variable. Because we allow
440 + # user to control used compiler via USE=clang flag, we cannot use
441 + # initial value. So this is the earliest stage where we can do this check
442 + # because pkg_pretend is not called in the main phase function sequence
443 + # environment saving is not guaranteed so we don't know if we will have
444 + # correct compiler until now.
445 + ewarn ""
446 + ewarn "USE=lto requires up-to-date compiler (>=gcc-8 or >=clang-7)."
447 + ewarn "You are on your own -- expect build failures. Don't file bugs using that unsupported configuration!"
448 + ewarn ""
449 + sleep 5
450 + fi
451 +
452 + mozconfig_annotate '+lto' --enable-lto=thin
453 +
454 + if use pgo ; then
455 + mozconfig_annotate '+pgo' MOZ_PGO=1
456 + fi
457 + else
458 + # Avoid auto-magic on linker
459 + if use clang ; then
460 + # This is upstream's default
461 + mozconfig_annotate "forcing ld=lld due to USE=clang" --enable-linker=lld
462 + elif tc-ld-is-gold ; then
463 + mozconfig_annotate "linker is set to gold" --enable-linker=gold
464 + else
465 + mozconfig_annotate "linker is set to bfd" --enable-linker=bfd
466 + fi
467 + fi
468 +
469 + # It doesn't compile on alpha without this LDFLAGS
470 + use alpha && append-ldflags "-Wl,--no-relax"
471 +
472 + # Add full relro support for hardened
473 + if use hardened ; then
474 + append-ldflags "-Wl,-z,relro,-z,now"
475 + mozconfig_use_enable hardened hardening
476 + fi
477 +
478 + # Modifications to better support ARM, bug 553364
479 + if use neon ; then
480 + mozconfig_annotate '' --with-fpu=neon
481 +
482 + if ! tc-is-clang ; then
483 + # thumb options aren't supported when using clang, bug 666966
484 + mozconfig_annotate '' --with-thumb=yes
485 + mozconfig_annotate '' --with-thumb-interwork=no
486 + fi
487 + fi
488 + if [[ ${CHOST} == armv*h* ]] ; then
489 + mozconfig_annotate '' --with-float-abi=hard
490 + if ! use system-libvpx ; then
491 + sed -i -e "s|softfp|hard|" \
492 + "${S}"/media/libvpx/moz.build
493 + fi
494 + fi
495 +
496 + mozconfig_use_enable !bindist official-branding
497 +
498 + mozconfig_use_enable debug
499 + mozconfig_use_enable debug tests
500 + if ! use debug ; then
501 + mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
502 + else
503 + mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
504 + fi
505 + # These are enabled by default in all mozilla applications
506 + mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
507 + mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
508 + mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include \
509 + --x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
510 + mozconfig_annotate '' --prefix="${EPREFIX}"/usr
511 + mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
512 + mozconfig_annotate '' --disable-crashreporter
513 + mozconfig_annotate 'Gentoo default' --with-system-png
514 + mozconfig_annotate '' --enable-system-ffi
515 + mozconfig_annotate '' --disable-gconf
516 + mozconfig_annotate '' --with-intl-api
517 + mozconfig_annotate '' --enable-system-pixman
518 + # Instead of the standard --build= and --host=, mozilla uses --host instead
519 + # of --build, and --target intstead of --host.
520 + # Note, mozilla also has --build but it does not do what you think it does.
521 + # Set both --target and --host as mozilla uses python to guess values otherwise
522 + mozconfig_annotate '' --target="${CHOST}"
523 + mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
524 + if use system-libevent ; then
525 + mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
526 + fi
527 +
528 + if ! use x86 && [[ ${CHOST} != armv*h* ]] ; then
529 + mozconfig_annotate '' --enable-rust-simd
530 + fi
531 +
532 + # skia has no support for big-endian platforms
533 + if [[ $(tc-endian) == "big" ]] ; then
534 + mozconfig_annotate 'big endian target' --disable-skia
535 + else
536 + mozconfig_annotate '' --enable-skia
537 + fi
538 +
539 + # use the gtk3 toolkit (the only one supported at this point)
540 + # TODO: Will this result in automagic dependency on x11-libs/gtk+[wayland]?
541 + mozconfig_annotate '' --enable-default-toolkit=cairo-gtk3
542 +
543 + mozconfig_use_enable startup-notification
544 + mozconfig_use_enable system-sqlite
545 + mozconfig_use_with system-harfbuzz
546 + mozconfig_use_with system-harfbuzz system-graphite2
547 + mozconfig_use_with system-icu
548 + mozconfig_use_with system-jpeg
549 + mozconfig_use_with system-libvpx
550 + mozconfig_use_with system-webp
551 + mozconfig_use_enable pulseaudio
552 + # force the deprecated alsa sound code if pulseaudio is disabled
553 + if use kernel_linux && ! use pulseaudio ; then
554 + mozconfig_annotate '-pulseaudio' --enable-alsa
555 + fi
556 +
557 + # Disable built-in ccache support to avoid sandbox violation, #665420
558 + # Use FEATURES=ccache instead!
559 + mozconfig_annotate '' --without-ccache
560 + sed -i -e 's/ccache_stats = None/return None/' \
561 + python/mozbuild/mozbuild/controller/building.py || \
562 + die "Failed to disable ccache stats call"
563 +
564 + mozconfig_use_enable dbus
565 +
566 + mozconfig_use_enable wifi necko-wifi
567 +
568 + mozconfig_use_enable geckodriver
569 +
570 + # enable JACK, bug 600002
571 + mozconfig_use_enable jack
572 +
573 + # Enable/Disable eme support
574 + use eme-free && mozconfig_annotate '+eme-free' --disable-eme
575 +
576 + # Setup api key for location services
577 + echo -n "${_google_api_key}" > "${S}"/google-api-key
578 + mozconfig_annotate '' --with-google-api-keyfile="${S}/google-api-key"
579 +
580 + mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
581 +
582 + # disable webrtc for now, bug 667642
583 + use arm && mozconfig_annotate 'broken on arm' --disable-webrtc
584 +
585 + # allow elfhack to work in combination with unstripped binaries
586 + # when they would normally be larger than 2GiB.
587 + append-ldflags "-Wl,--compress-debug-sections=zlib"
588 +
589 + if use clang ; then
590 + # https://bugzilla.mozilla.org/show_bug.cgi?id=1482204
591 + # https://bugzilla.mozilla.org/show_bug.cgi?id=1483822
592 + mozconfig_annotate 'elf-hack is broken when using Clang' --disable-elf-hack
593 + fi
594 +
595 + echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
596 + echo "mk_add_options XARGS=/usr/bin/xargs" >> "${S}"/.mozconfig
597 +
598 + # Finalize and report settings
599 + mozconfig_final
600 +
601 + # workaround for funky/broken upstream configure...
602 + SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
603 + ./mach configure || die
604 +}
605 +
606 +src_compile() {
607 + local _virtx=
608 + if use pgo ; then
609 + _virtx=virtx
610 +
611 + # Reset and cleanup environment variables used by GNOME/XDG
612 + gnome2_environment_reset
613 +
614 + addpredict /root
615 + addpredict /etc/gconf
616 + fi
617 +
618 + MOZ_MAKE_FLAGS="${MAKEOPTS} -O" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 ${_virtx} \
619 + ./mach build --verbose || die
620 +}
621 +
622 +src_install() {
623 + cd "${BUILD_OBJ_DIR}" || die
624 +
625 + # Pax mark xpcshell for hardened support, only used for startupcache creation.
626 + pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
627 +
628 + # Add our default prefs for firefox
629 + cp "${FILESDIR}"/gentoo-default-prefs.js-2 \
630 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
631 + || die
632 +
633 + # set dictionary path, to use system hunspell
634 + echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
635 + >>"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
636 +
637 + # force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
638 + if use system-harfbuzz ; then
639 + echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
640 + >>"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
641 + fi
642 +
643 + # force cairo as the canvas renderer on platforms without skia support
644 + if [[ $(tc-endian) == "big" ]] ; then
645 + echo "sticky_pref(\"gfx.canvas.azure.backends\",\"cairo\");" \
646 + >>"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
647 + echo "sticky_pref(\"gfx.content.azure.backends\",\"cairo\");" \
648 + >>"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
649 + fi
650 +
651 + # Augment this with hwaccel prefs
652 + if use hwaccel ; then
653 + cat "${FILESDIR}"/gentoo-hwaccel-prefs.js-1 >> \
654 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
655 + || die
656 + fi
657 +
658 + if ! use screenshot ; then
659 + echo "pref(\"extensions.screenshots.disabled\", true);" >> \
660 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
661 + || die
662 + fi
663 +
664 + echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
665 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
666 + || die
667 +
668 + local plugin
669 + use gmp-autoupdate || use eme-free || for plugin in "${GMP_PLUGIN_LIST[@]}" ; do
670 + echo "pref(\"media.${plugin}.autoupdate\", false);" >> \
671 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
672 + || die
673 + done
674 +
675 + cd "${S}"
676 + MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
677 + DESTDIR="${D}" ./mach install || die
678 +
679 + if use geckodriver ; then
680 + cp "${BUILD_OBJ_DIR}"/dist/bin/geckodriver "${ED%/}"${MOZILLA_FIVE_HOME} || die
681 + pax-mark m "${ED%/}"${MOZILLA_FIVE_HOME}/geckodriver
682 +
683 + dosym ${MOZILLA_FIVE_HOME}/geckodriver /usr/bin/geckodriver
684 + fi
685 +
686 + # Install language packs
687 + MOZ_INSTALL_L10N_XPIFILE="1" mozlinguas_src_install
688 +
689 + local size sizes icon_path icon name
690 + if use bindist ; then
691 + sizes="16 32 48"
692 + icon_path="${S}/browser/branding/aurora"
693 + # Firefox's new rapid release cycle means no more codenames
694 + # Let's just stick with this one...
695 + icon="aurora"
696 + name="Aurora"
697 +
698 + # Override preferences to set the MOZ_DEV_EDITION defaults, since we
699 + # don't define MOZ_DEV_EDITION to avoid profile debaucles.
700 + # (source: browser/app/profile/firefox.js)
701 + cat >>"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" <<PROFILE_EOF
702 +pref("app.feedback.baseURL", "https://input.mozilla.org/%LOCALE%/feedback/firefoxdev/%VERSION%/");
703 +sticky_pref("lightweightThemes.selectedThemeID", "firefox-devedition@×××××××.org");
704 +sticky_pref("browser.devedition.theme.enabled", true);
705 +sticky_pref("devtools.theme", "dark");
706 +PROFILE_EOF
707 +
708 + else
709 + sizes="16 22 24 32 48 64 128 256"
710 + icon_path="${S}/browser/branding/official"
711 + icon="${PN}"
712 + name="Mozilla Firefox"
713 + fi
714 +
715 + # Disable built-in auto-update because we update firefox through package manager
716 + insinto ${MOZILLA_FIVE_HOME}/distribution/
717 + newins "${FILESDIR}"/disable-auto-update.policy.json policies.json
718 +
719 + # Install icons and .desktop for menu entry
720 + for size in ${sizes}; do
721 + insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
722 + newins "${icon_path}/default${size}.png" "${icon}.png"
723 + done
724 + # Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
725 + newicon "${icon_path}/default48.png" "${icon}.png"
726 + newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
727 + sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
728 + "${ED}/usr/share/applications/${PN}.desktop" || die
729 +
730 + # Add StartupNotify=true bug 237317
731 + if use startup-notification ; then
732 + echo "StartupNotify=true"\
733 + >> "${ED}/usr/share/applications/${PN}.desktop" \
734 + || die
735 + fi
736 +
737 + # Don't install llvm-symbolizer from sys-devel/llvm package
738 + [[ -f "${ED%/}${MOZILLA_FIVE_HOME}/llvm-symbolizer" ]] && \
739 + rm "${ED%/}${MOZILLA_FIVE_HOME}/llvm-symbolizer"
740 +
741 + # firefox and firefox-bin are identical
742 + rm "${ED%/}"${MOZILLA_FIVE_HOME}/firefox-bin || die
743 + dosym firefox ${MOZILLA_FIVE_HOME}/firefox-bin
744 +
745 + # Required in order to use plugins and even run firefox on hardened.
746 + pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,plugin-container}
747 +}
748 +
749 +pkg_preinst() {
750 + gnome2_icon_savelist
751 +
752 + # if the apulse libs are available in MOZILLA_FIVE_HOME then apulse
753 + # doesn't need to be forced into the LD_LIBRARY_PATH
754 + if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
755 + einfo "APULSE found - Generating library symlinks for sound support"
756 + local lib
757 + pushd "${ED}"${MOZILLA_FIVE_HOME} &>/dev/null || die
758 + for lib in ../apulse/libpulse{.so{,.0},-simple.so{,.0}} ; do
759 + # a quickpkg rolled by hand will grab symlinks as part of the package,
760 + # so we need to avoid creating them if they already exist.
761 + if [[ ! -L ${lib##*/} ]] ; then
762 + ln -s "${lib}" ${lib##*/} || die
763 + fi
764 + done
765 + popd &>/dev/null || die
766 + fi
767 +}
768 +
769 +pkg_postinst() {
770 + gnome2_icon_cache_update
771 + xdg_desktop_database_update
772 +
773 + if ! use gmp-autoupdate && ! use eme-free ; then
774 + elog "USE='-gmp-autoupdate' has disabled the following plugins from updating or"
775 + elog "installing into new profiles:"
776 + local plugin
777 + for plugin in "${GMP_PLUGIN_LIST[@]}"; do elog "\t ${plugin}" ; done
778 + elog
779 + fi
780 +
781 + if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
782 + elog "Apulse was detected at merge time on this system and so it will always be"
783 + elog "used for sound. If you wish to use pulseaudio instead please unmerge"
784 + elog "media-sound/apulse."
785 + elog
786 + fi
787 +}
788 +
789 +pkg_postrm() {
790 + gnome2_icon_cache_update
791 + xdg_desktop_database_update
792 +}