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: Sat, 10 Oct 2020 17:40:46
Message-Id: 1602351613.c2cb1b1809dfdcc237f0bffb3330db785ca697c7.whissi@gentoo
1 commit: c2cb1b1809dfdcc237f0bffb3330db785ca697c7
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 10 15:44:42 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 10 17:40:13 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2cb1b18
7
8 www-client/firefox: rev bump for new patch set
9
10 - Unbreak building against rust-1.47.0
11
12 - Multiple fixes for Wayland users
13 - bmo#1656727
14 - bmo#1669495
15 - bmo#1634404
16 - bmo#1668771
17 - bmo#1661192
18 - bmo#1640567
19
20 Package-Manager: Portage-3.0.8, Repoman-3.0.1
21 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
22
23 www-client/firefox/Manifest | 1 +
24 www-client/firefox/firefox-81.0.1-r1.ebuild | 1066 +++++++++++++++++++++++++++
25 2 files changed, 1067 insertions(+)
26
27 diff --git a/www-client/firefox/Manifest b/www-client/firefox/Manifest
28 index bada6f692bf..ecb6b8a8bcd 100644
29 --- a/www-client/firefox/Manifest
30 +++ b/www-client/firefox/Manifest
31 @@ -374,6 +374,7 @@ DIST firefox-80.0.1-zh-TW.xpi 611178 BLAKE2B e84b0defc7990b6c775a9ee9a5ba7dd54a6
32 DIST firefox-80.0.1.source.tar.xz 334690792 BLAKE2B 47c8cdb2c8c0088b5dc8abbdfba8be685dfdd4d079b155aebb1431a5f8b448b94d90e188d08426053be961f228d3b4e7852626f502397099e99e4a897e7dadfa SHA512 97a54e5f0ff0e34d0994b9ea67250fda1e9a51acb1129a5f6ce632ca5d15132ae4e5eb18c1a9a609a14f5012daf87c6e1a5049e096dd1c32cac9e2c981381d10
33 DIST firefox-80.0.source.tar.xz 335316448 BLAKE2B 3099426b27cd3c89b63be7d796c8c5a87d0ee9bd8252e5bde23ed3a61f71d611e7427ffee506224e81a88ef109eefe944f2cf3367bd636a6ed46b7351d0a4b1b SHA512 6cfba55615d032e77f973ffdb1d4bb27c3c00d1ef642521284afa3e01a1bd29c6db963181e9ebefb0a44e49b96c3f93e57ce49541eae7e5a54d3360ffa81c1f3
34 DIST firefox-81-patches-01.tar.xz 27212 BLAKE2B ef544bf38ae2dcb3a385d68f6ecea016a4d0677af895fad8be2ab07a2dab313d953b764fd0390844444f743ae1a2f67fa6f3b67795b72823d9eb47f4ae10cc33 SHA512 88d0ca8f29574ac45afce3be4a59a9816b3761eb5e1741770927c26c4d4afae669ba8632bbef78479cb7ec892e581ef06e2a5da7c2e106a676dce886d2a14ebc
35 +DIST firefox-81-patches-02.tar.xz 167760 BLAKE2B b6b3e55057b8533614597f2284d0caf88dede2a3580dc3f4ed375449ff3d776248dc37256678d416d605f69498468a63ef662e500f11523def67ff8c7f71ad1b SHA512 2229553934163ba4d017a3da23526f4577383e6c4c434e73a17c4eeec5aa4bd612f3523e0de567369a94dc23ac273fa5f77a4cbbb2ff43af3ba4f960a48bcc47
36 DIST firefox-81.0.1-ach.xpi 458702 BLAKE2B bc2bbb8174556aa91d8fe9149b5e7debedfbd8682207c62c8c1ca3ad86355bd522a2c08915094871ccb46c3c9b7a0a6dde4cc1a8dd296890176003a7eb349274 SHA512 04a2e8146fce327dfbe19a583c2d1ac45289a14dff7f29af17246d6bf8ae0c61363151cbea50da2a0ca06257c9b1ab4ef1b4d26086cea48b2121f059ca97d977
37 DIST firefox-81.0.1-af.xpi 429009 BLAKE2B 529a751d6b4ff4e9e1c693cd3c409d199ba5db53f499200718f1dd17c726b4d45b9c4e9a2d4b0fa418afacfc4c2917dfec09f55e5b12db39353e0759b68a4101 SHA512 c704334d07496c5cb0fb7a9755bd53ecc9fcd447772f8d40ab1d601c5a8e7d9ef99a366f3dda287b4a0e11795b5b4b3e06e0da9cc5e09bdedab3ccb3979c32b4
38 DIST firefox-81.0.1-an.xpi 506886 BLAKE2B 72b0b6d8aeabd3c0db9bdd3bd2e7015bc7245250c450a4844807c320228b3c3fd8423a0677c3b93f913e3acd2cc2d8752ab22a2fb78a5b8a62d4dc03e3e8edef SHA512 3da113ccdb5c219e1fa07b678056460687a2de57f783c5056e1572cbad0b2238fe1fbd5d36d463bebb1ec0ad2842bfd440a2995185e862ab51cb23ed5b1a8d3f
39
40 diff --git a/www-client/firefox/firefox-81.0.1-r1.ebuild b/www-client/firefox/firefox-81.0.1-r1.ebuild
41 new file mode 100644
42 index 00000000000..c7040123858
43 --- /dev/null
44 +++ b/www-client/firefox/firefox-81.0.1-r1.ebuild
45 @@ -0,0 +1,1066 @@
46 +# Copyright 1999-2020 Gentoo Authors
47 +# Distributed under the terms of the GNU General Public License v2
48 +
49 +EAPI="7"
50 +
51 +FIREFOX_PATCHSET="firefox-81-patches-02.tar.xz"
52 +
53 +LLVM_MAX_SLOT=11
54 +
55 +PYTHON_COMPAT=( python3_{7..9} )
56 +PYTHON_REQ_USE="ncurses,sqlite,ssl"
57 +
58 +WANT_AUTOCONF="2.1"
59 +
60 +VIRTUALX_REQUIRED="pgo"
61 +
62 +MOZ_ESR=
63 +
64 +# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
65 +MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
66 +MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
67 +MOZ_PV="${MOZ_PV%%_rc*}" # Handle rc for SRC_URI
68 +
69 +if [[ -n ${MOZ_ESR} ]] ; then
70 + # ESR releases have slightly different version numbers
71 + MOZ_PV="${MOZ_PV}esr"
72 +fi
73 +
74 +MOZ_PN="${PN%-bin}"
75 +MOZ_P="${MOZ_PN}-${MOZ_PV}"
76 +
77 +inherit autotools check-reqs desktop flag-o-matic gnome2-utils llvm \
78 + multiprocessing pax-utils python-any-r1 toolchain-funcs \
79 + virtualx xdg
80 +
81 +MOZ_SRC_BASE_URI="https://archive.mozilla.org/pub/${MOZ_PN}/releases/${MOZ_PV}"
82 +
83 +if [[ ${PV} == *_rc* ]] ; then
84 + MOZ_SRC_BASE_URI="https://archive.mozilla.org/pub/${MOZ_PN}/candidates/${MOZ_PV}-candidates/build${PV##*_rc}"
85 +fi
86 +
87 +PATCH_URIS=(
88 + https://dev.gentoo.org/~{axs,polynomial-c,whissi}/mozilla/patchsets/${FIREFOX_PATCHSET}
89 +)
90 +
91 +SRC_URI="${MOZ_SRC_BASE_URI}/source/${MOZ_P}.source.tar.xz
92 + ${PATCH_URIS[@]}"
93 +
94 +DESCRIPTION="Firefox Web Browser"
95 +HOMEPAGE="https://www.mozilla.com/firefox"
96 +
97 +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
98 +
99 +SLOT="0/$(ver_cut 1)"
100 +LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
101 +IUSE="clang cpu_flags_arm_neon dbus debug eme-free geckodriver +gmp-autoupdate
102 + hardened hwaccel jack lto +openh264 pgo pulseaudio screencast selinux
103 + +system-av1 +system-harfbuzz +system-icu +system-jpeg +system-libevent
104 + +system-libvpx +system-webp wayland wifi"
105 +
106 +REQUIRED_USE="screencast? ( wayland )"
107 +
108 +BDEPEND="${PYTHON_DEPS}
109 + app-arch/unzip
110 + app-arch/zip
111 + >=dev-util/cbindgen-0.14.3
112 + >=net-libs/nodejs-10.19.0
113 + virtual/pkgconfig
114 + >=virtual/rust-1.43.0
115 + || (
116 + (
117 + sys-devel/clang:11
118 + sys-devel/llvm:11
119 + clang? (
120 + =sys-devel/lld-11*
121 + pgo? ( =sys-libs/compiler-rt-sanitizers-11*[profile] )
122 + )
123 + )
124 + (
125 + sys-devel/clang:10
126 + sys-devel/llvm:10
127 + clang? (
128 + =sys-devel/lld-10*
129 + pgo? ( =sys-libs/compiler-rt-sanitizers-10*[profile] )
130 + )
131 + )
132 + (
133 + sys-devel/clang:9
134 + sys-devel/llvm:9
135 + clang? (
136 + =sys-devel/lld-9*
137 + pgo? ( =sys-libs/compiler-rt-sanitizers-9*[profile] )
138 + )
139 + )
140 + )
141 + lto? (
142 + !clang? ( sys-devel/binutils[gold] )
143 + )
144 + amd64? ( >=dev-lang/yasm-1.1 )
145 + x86? ( >=dev-lang/yasm-1.1 )
146 + !system-av1? (
147 + amd64? ( >=dev-lang/nasm-2.13 )
148 + x86? ( >=dev-lang/nasm-2.13 )
149 + )"
150 +
151 +CDEPEND="
152 + >=dev-libs/nss-3.56
153 + >=dev-libs/nspr-4.28
154 + dev-libs/atk
155 + dev-libs/expat
156 + >=x11-libs/cairo-1.10[X]
157 + >=x11-libs/gtk+-2.18:2
158 + >=x11-libs/gtk+-3.4.0:3[X]
159 + x11-libs/gdk-pixbuf
160 + >=x11-libs/pango-1.22.0
161 + >=media-libs/libpng-1.6.35:0=[apng]
162 + >=media-libs/mesa-10.2:*
163 + media-libs/fontconfig
164 + >=media-libs/freetype-2.4.10
165 + kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) )
166 + virtual/freedesktop-icon-theme
167 + >=x11-libs/pixman-0.19.2
168 + >=dev-libs/glib-2.26:2
169 + >=sys-libs/zlib-1.2.3
170 + >=dev-libs/libffi-3.0.10:=
171 + media-video/ffmpeg
172 + x11-libs/libX11
173 + x11-libs/libXcomposite
174 + x11-libs/libXdamage
175 + x11-libs/libXext
176 + x11-libs/libXfixes
177 + x11-libs/libXrender
178 + x11-libs/libXt
179 + dbus? (
180 + sys-apps/dbus
181 + dev-libs/dbus-glib
182 + )
183 + screencast? ( media-video/pipewire:0/0.3 )
184 + system-av1? (
185 + >=media-libs/dav1d-0.3.0:=
186 + >=media-libs/libaom-1.0.0:=
187 + )
188 + system-harfbuzz? (
189 + >=media-libs/harfbuzz-2.6.8:0=
190 + >=media-gfx/graphite2-1.3.13
191 + )
192 + system-icu? ( >=dev-libs/icu-67.1:= )
193 + system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
194 + system-libevent? ( >=dev-libs/libevent-2.0:0=[threads] )
195 + system-libvpx? ( >=media-libs/libvpx-1.8.2:0=[postproc] )
196 + system-webp? ( >=media-libs/libwebp-1.1.0:0= )
197 + wifi? (
198 + kernel_linux? (
199 + sys-apps/dbus
200 + dev-libs/dbus-glib
201 + net-misc/networkmanager
202 + )
203 + )
204 + jack? ( virtual/jack )
205 + selinux? ( sec-policy/selinux-mozilla )"
206 +
207 +RDEPEND="${CDEPEND}
208 + jack? ( virtual/jack )
209 + openh264? ( media-libs/openh264:*[plugin] )
210 + pulseaudio? (
211 + || (
212 + media-sound/pulseaudio
213 + >=media-sound/apulse-0.1.12-r4
214 + )
215 + )
216 + selinux? ( sec-policy/selinux-mozilla )"
217 +
218 +DEPEND="${CDEPEND}
219 + pulseaudio? (
220 + || (
221 + media-sound/pulseaudio
222 + >=media-sound/apulse-0.1.12-r4[sdk]
223 + )
224 + )
225 + wayland? ( >=x11-libs/gtk+-3.11:3[wayland] )
226 + amd64? ( virtual/opengl )
227 + x86? ( virtual/opengl )"
228 +
229 +S="${WORKDIR}/${PN}-${PV%_*}"
230 +
231 +# Allow MOZ_GMP_PLUGIN_LIST to be set in an eclass or
232 +# overridden in the enviromnent (advanced hackers only)
233 +if [[ -z "${MOZ_GMP_PLUGIN_LIST+set}" ]] ; then
234 + MOZ_GMP_PLUGIN_LIST=( gmp-gmpopenh264 gmp-widevinecdm )
235 +fi
236 +
237 +llvm_check_deps() {
238 + if ! has_version -b "sys-devel/clang:${LLVM_SLOT}" ; then
239 + ewarn "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
240 + return 1
241 + fi
242 +
243 + if use clang ; then
244 + if ! has_version -b "=sys-devel/lld-${LLVM_SLOT}*" ; then
245 + ewarn "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
246 + return 1
247 + fi
248 +
249 + if use pgo ; then
250 + if ! has_version -b "=sys-libs/compiler-rt-sanitizers-${LLVM_SLOT}*" ; then
251 + ewarn "=sys-libs/compiler-rt-sanitizers-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
252 + return 1
253 + fi
254 + fi
255 + fi
256 +
257 + einfo "Will use LLVM slot ${LLVM_SLOT}!" >&2
258 +}
259 +
260 +MOZ_LANGS=(
261 + ach af an ar ast az be bg bn br bs ca-valencia ca cak cs cy
262 + da de dsb el en-CA en-GB en-US eo es-AR es-CL es-ES es-MX et eu
263 + fa ff fi fr fy-NL ga-IE gd gl gn gu-IN he hi-IN hr hsb hu hy-AM
264 + ia id is it ja ka kab kk km kn ko lij lt lv mk mr ms my
265 + nb-NO ne-NP nl nn-NO oc pa-IN pl pt-BR pt-PT rm ro ru
266 + si sk sl son sq sr sv-SE ta te th tl tr trs uk ur uz vi
267 + xh zh-CN zh-TW
268 +)
269 +
270 +mozilla_set_globals() {
271 + # https://bugs.gentoo.org/587334
272 + local MOZ_TOO_REGIONALIZED_FOR_L10N=(
273 + fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO ne-NP nn-NO pa-IN sv-SE
274 + )
275 +
276 + local lang xflag
277 + for lang in "${MOZ_LANGS[@]}" ; do
278 + # en and en_US are handled internally
279 + if [[ ${lang} == en ]] || [[ ${lang} == en-US ]] ; then
280 + continue
281 + fi
282 +
283 + # strip region subtag if $lang is in the list
284 + if has ${lang} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then
285 + xflag=${lang%%-*}
286 + else
287 + xflag=${lang}
288 + fi
289 +
290 + SRC_URI+=" l10n_${xflag/[_@]/-}? ("
291 + SRC_URI+=" ${MOZ_SRC_BASE_URI}/linux-x86_64/xpi/${lang}.xpi -> ${MOZ_P}-${lang}.xpi"
292 + SRC_URI+=" )"
293 + IUSE+=" l10n_${xflag/[_@]/-}"
294 + done
295 +}
296 +mozilla_set_globals
297 +
298 +moz_clear_vendor_checksums() {
299 + debug-print-function ${FUNCNAME} "$@"
300 +
301 + if [[ ${#} -ne 1 ]] ; then
302 + die "${FUNCNAME} requires exact one argument"
303 + fi
304 +
305 + einfo "Clearing cargo checksums for ${1} ..."
306 +
307 + sed -i \
308 + -e 's/\("files":{\)[^}]*/\1/' \
309 + "${S}"/third_party/rust/${1}/.cargo-checksum.json \
310 + || die
311 +}
312 +
313 +moz_install_xpi() {
314 + debug-print-function ${FUNCNAME} "$@"
315 +
316 + if [[ ${#} -lt 2 ]] ; then
317 + die "${FUNCNAME} requires at least two arguments"
318 + fi
319 +
320 + local DESTDIR=${1}
321 + shift
322 +
323 + insinto "${DESTDIR}"
324 +
325 + local emid xpi_file xpi_tmp_dir
326 + for xpi_file in "${@}" ; do
327 + emid=
328 + xpi_tmp_dir=$(mktemp -d --tmpdir="${T}")
329 +
330 + # Unpack XPI
331 + unzip -qq "${xpi_file}" -d "${xpi_tmp_dir}" || die
332 +
333 + # Determine extension ID
334 + if [[ -f "${xpi_tmp_dir}/install.rdf" ]] ; then
335 + emid=$(sed -n -e '/install-manifest/,$ { /em:id/!d; s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${xpi_tmp_dir}/install.rdf")
336 + [[ -z "${emid}" ]] && die "failed to determine extension id from install.rdf"
337 + elif [[ -f "${xpi_tmp_dir}/manifest.json" ]] ; then
338 + emid=$(sed -n -e 's/.*"id": "\([^"]*\)".*/\1/p' "${xpi_tmp_dir}/manifest.json")
339 + [[ -z "${emid}" ]] && die "failed to determine extension id from manifest.json"
340 + else
341 + die "failed to determine extension id"
342 + fi
343 +
344 + einfo "Installing ${emid}.xpi into ${ED}${DESTDIR} ..."
345 + newins "${xpi_file}" "${emid}.xpi"
346 + done
347 +}
348 +
349 +mozconfig_add_options_ac() {
350 + debug-print-function ${FUNCNAME} "$@"
351 +
352 + if [[ ${#} -lt 2 ]] ; then
353 + die "${FUNCNAME} requires at least two arguments"
354 + fi
355 +
356 + local reason=${1}
357 + shift
358 +
359 + local option
360 + for option in ${@} ; do
361 + echo "ac_add_options ${option} # ${reason}" >>${MOZCONFIG}
362 + done
363 +}
364 +
365 +mozconfig_add_options_mk() {
366 + debug-print-function ${FUNCNAME} "$@"
367 +
368 + if [[ ${#} -lt 2 ]] ; then
369 + die "${FUNCNAME} requires at least two arguments"
370 + fi
371 +
372 + local reason=${1}
373 + shift
374 +
375 + local option
376 + for option in ${@} ; do
377 + echo "mk_add_options ${option} # ${reason}" >>${MOZCONFIG}
378 + done
379 +}
380 +
381 +mozconfig_use_enable() {
382 + debug-print-function ${FUNCNAME} "$@"
383 +
384 + if [[ ${#} -lt 1 ]] ; then
385 + die "${FUNCNAME} requires at least one arguments"
386 + fi
387 +
388 + local flag=$(use_enable "${@}")
389 + mozconfig_add_options_ac "$(use ${1} && echo +${1} || echo -${1})" "${flag}"
390 +}
391 +
392 +mozconfig_use_with() {
393 + debug-print-function ${FUNCNAME} "$@"
394 +
395 + if [[ ${#} -lt 1 ]] ; then
396 + die "${FUNCNAME} requires at least one arguments"
397 + fi
398 +
399 + local flag=$(use_with "${@}")
400 + mozconfig_add_options_ac "$(use ${1} && echo +${1} || echo -${1})" "${flag}"
401 +}
402 +
403 +pkg_pretend() {
404 + if [[ ${MERGE_TYPE} != binary ]] ; then
405 + if use pgo ; then
406 + if ! has usersandbox $FEATURES ; then
407 + die "You must enable usersandbox as X server can not run as root!"
408 + fi
409 + fi
410 +
411 + # Ensure we have enough disk space to compile
412 + if use pgo || use lto || use debug ; then
413 + CHECKREQS_DISK_BUILD="13G"
414 + else
415 + CHECKREQS_DISK_BUILD="5G"
416 + fi
417 +
418 + check-reqs_pkg_pretend
419 + fi
420 +}
421 +
422 +pkg_setup() {
423 + if [[ ${MERGE_TYPE} != binary ]] ; then
424 + if use pgo ; then
425 + if ! has userpriv ${FEATURES} ; then
426 + eerror "Building ${PN} with USE=pgo and FEATURES=-userpriv is not supported!"
427 + fi
428 + fi
429 +
430 + # Ensure we have enough disk space to compile
431 + if use pgo || use lto || use debug ; then
432 + CHECKREQS_DISK_BUILD="13G"
433 + else
434 + CHECKREQS_DISK_BUILD="5G"
435 + fi
436 +
437 + check-reqs_pkg_setup
438 +
439 + llvm_pkg_setup
440 +
441 + python-any-r1_pkg_setup
442 +
443 + # Avoid PGO profiling problems due to enviroment leakage
444 + # These should *always* be cleaned up anyway
445 + unset \
446 + DBUS_SESSION_BUS_ADDRESS \
447 + DISPLAY \
448 + ORBIT_SOCKETDIR \
449 + SESSION_MANAGER \
450 + XAUTHORITY \
451 + XDG_CACHE_HOME \
452 + XDG_SESSION_COOKIE
453 +
454 + # Build system is using /proc/self/oom_score_adj, bug #604394
455 + addpredict /proc/self/oom_score_adj
456 +
457 + if ! mountpoint -q /dev/shm ; then
458 + # If /dev/shm is not available, configure is known to fail with
459 + # a traceback report referencing /usr/lib/pythonN.N/multiprocessing/synchronize.py
460 + ewarn "/dev/shm is not mounted -- expect build failures!"
461 + fi
462 +
463 + # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
464 + # Note: These are for Gentoo Linux use ONLY. For your own distribution, please
465 + # get your own set of keys.
466 + if [[ -z "${MOZ_API_KEY_GOOGLE+set}" ]] ; then
467 + MOZ_API_KEY_GOOGLE="AIzaSyDEAOvatFogGaPi0eTgsV_ZlEzx0ObmepsMzfAc"
468 + fi
469 +
470 + # Ensure we use C locale when building, bug #746215
471 + export LC_ALL=C
472 + fi
473 +}
474 +
475 +src_unpack() {
476 + local _lp_dir="${WORKDIR}/language_packs"
477 + local _src_file
478 +
479 + if [[ ! -d "${_lp_dir}" ]] ; then
480 + mkdir "${_lp_dir}" || die
481 + fi
482 +
483 + for _src_file in ${A} ; do
484 + if [[ ${_src_file} == *.xpi ]]; then
485 + cp "${DISTDIR}/${_src_file}" "${_lp_dir}" || die "Failed to copy '${_src_file}' to '${_lp_dir}'!"
486 + else
487 + unpack ${_src_file}
488 + fi
489 + done
490 +}
491 +
492 +src_prepare() {
493 + use lto && rm -v "${WORKDIR}"/firefox-patches/*-LTO-Only-enable-LTO-*.patch
494 + eapply "${WORKDIR}/firefox-patches"
495 +
496 + # Allow user to apply any additional patches without modifing ebuild
497 + eapply_user
498 +
499 + # Make LTO respect MAKEOPTS
500 + sed -i \
501 + -e "s/multiprocessing.cpu_count()/$(makeopts_jobs)/" \
502 + "${S}"/build/moz.configure/lto-pgo.configure \
503 + || die "sed failed to set num_cores"
504 +
505 + # Make ICU respect MAKEOPTS
506 + sed -i \
507 + -e "s/multiprocessing.cpu_count()/$(makeopts_jobs)/" \
508 + "${S}"/intl/icu_sources_data.py \
509 + || die "sed failed to set num_cores"
510 +
511 + # sed-in toolchain prefix
512 + sed -i \
513 + -e "s/objdump/${CHOST}-objdump/" \
514 + "${S}"/python/mozbuild/mozbuild/configure/check_debug_ranges.py \
515 + || die "sed failed to set toolchain prefix"
516 +
517 + sed -i \
518 + -e 's/ccache_stats = None/return None/' \
519 + "${S}"/python/mozbuild/mozbuild/controller/building.py \
520 + || die "sed failed to disable ccache stats call"
521 +
522 + einfo "Removing pre-built binaries ..."
523 + find "${S}"/third_party -type f \( -name '*.so' -o -name '*.o' \) -print -delete || die
524 +
525 + # Clearing checksums where we have applied patches
526 + moz_clear_vendor_checksums target-lexicon-0.9.0
527 +
528 + # Create build dir
529 + BUILD_DIR="${WORKDIR}/${PN}_build"
530 + mkdir -p "${BUILD_DIR}" || die
531 +
532 + # Write API keys to disk
533 + echo -n "${MOZ_API_KEY_GOOGLE//gGaPi/}" > "${S}"/api-google.key || die
534 +
535 + xdg_src_prepare
536 +}
537 +
538 +src_configure() {
539 + local have_switched_compiler=
540 + if use clang && ! tc-is-clang ; then
541 + # Force clang
542 + einfo "Enforcing the use of clang due to USE=clang ..."
543 + have_switched_compiler=yes
544 + CC=${CHOST}-clang
545 + CXX=${CHOST}-clang++
546 + elif ! use clang && ! tc-is-gcc ; then
547 + # Force gcc
548 + have_switched_compiler=yes
549 + einfo "Enforcing the use of gcc due to USE=-clang ..."
550 + CC=${CHOST}-gcc
551 + CXX=${CHOST}-g++
552 + fi
553 +
554 + if [[ -n "${have_switched_compiler}" ]] ; then
555 + # Because we switched active compiler we have to ensure
556 + # that no unsupported flags are set
557 + strip-unsupported-flags
558 + fi
559 +
560 + # Ensure we use correct toolchain
561 + export HOST_CC="$(tc-getBUILD_CC)"
562 + export HOST_CXX="$(tc-getBUILD_CXX)"
563 + tc-export CC CXX LD AR NM OBJDUMP RANLIB PKG_CONFIG
564 +
565 + # Set MOZILLA_FIVE_HOME
566 + export MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
567 +
568 + # python/mach/mach/mixin/process.py fails to detect SHELL
569 + export SHELL="${EPREFIX}/bin/bash"
570 +
571 + # Set MOZCONFIG
572 + export MOZCONFIG="${S}/.mozconfig"
573 +
574 + # Initialize MOZCONFIG
575 + mozconfig_add_options_ac '' --enable-application=browser
576 +
577 + if use lto ; then
578 + if use clang ; then
579 + # Upstream only supports lld when using clang
580 + mozconfig_add_options_ac "forcing ld=lld due to USE=clang and USE=lto" --enable-linker=lld
581 +
582 + mozconfig_add_options_ac '+lto' --enable-lto=cross
583 + else
584 + # Linking only works when using ld.gold when LTO is enabled
585 + mozconfig_add_options_ac "forcing ld=gold due to USE=lto" --enable-linker=gold
586 +
587 + # ThinLTO is currently broken, see bmo#1644409
588 + mozconfig_add_options_ac '+lto' --enable-lto=full
589 + fi
590 +
591 + if use pgo ; then
592 + mozconfig_add_options_ac '+pgo' MOZ_PGO=1
593 + fi
594 + else
595 + # Avoid auto-magic on linker
596 + if use clang ; then
597 + # This is upstream's default
598 + mozconfig_add_options_ac "forcing ld=lld due to USE=clang" --enable-linker=lld
599 + elif tc-ld-is-gold ; then
600 + mozconfig_add_options_ac "linker is set to gold" --enable-linker=gold
601 + else
602 + mozconfig_add_options_ac "linker is set to bfd" --enable-linker=bfd
603 + fi
604 + fi
605 +
606 + # LTO flag was handled via configure
607 + filter-flags '-flto*'
608 +
609 + mozconfig_use_enable debug
610 + if use debug ; then
611 + mozconfig_add_options_ac '+debug' --disable-optimize
612 + else
613 + if is-flag '-g*' ; then
614 + if use clang ; then
615 + mozconfig_add_options_ac 'from CFLAGS' --enable-debug-symbols=$(get-flag '-g*')
616 + else
617 + mozconfig_add_options_ac 'from CFLAGS' --enable-debug-symbols
618 + fi
619 + else
620 + mozconfig_add_options_ac 'Gentoo default' --disable-debug-symbols
621 + fi
622 +
623 + if is-flag '-O0' ; then
624 + mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O0
625 + elif is-flag '-O4' ; then
626 + mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O4
627 + elif is-flag '-O3' ; then
628 + mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O3
629 + elif is-flag '-O1' ; then
630 + mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O1
631 + elif is-flag '-Os' ; then
632 + mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-Os
633 + else
634 + mozconfig_add_options_ac "Gentoo default" --enable-optimize=-O2
635 + fi
636 + fi
637 +
638 + # Debug flag was handled via configure
639 + filter-flags '-g*'
640 +
641 + # Optimization flag was handled via configure
642 + filter-flags '-O*'
643 +
644 + mozconfig_add_options_ac 'Gentoo default' \
645 + --allow-addon-sideload \
646 + --disable-cargo-incremental \
647 + --disable-crashreporter \
648 + --disable-install-strip \
649 + --disable-strip \
650 + --disable-updater \
651 + --enable-official-branding \
652 + --enable-release \
653 + --enable-system-ffi \
654 + --enable-system-pixman \
655 + --host="${CBUILD:-${CHOST}}" \
656 + --libdir="${EPREFIX}/usr/$(get_libdir)" \
657 + --prefix="${EPREFIX}/usr" \
658 + --target="${CHOST}" \
659 + --without-ccache \
660 + --with-intl-api \
661 + --with-libclang-path="$(llvm-config --libdir)" \
662 + --with-system-nspr \
663 + --with-system-nss \
664 + --with-system-png \
665 + --with-system-zlib \
666 + --with-toolchain-prefix="${CHOST}-" \
667 + --with-unsigned-addon-scopes=app,system \
668 + --x-includes="${SYSROOT}${EPREFIX}/usr/include" \
669 + --x-libraries="${SYSROOT}${EPREFIX}/usr/$(get_libdir)"
670 +
671 + # Set update channel
672 + local update_channel=release
673 + [[ -n ${MOZ_ESR} ]] && update_channel=esr
674 + mozconfig_add_options_ac '' --update-channel=${update_channel}
675 +
676 + if ! use x86 && [[ ${CHOST} != armv*h* ]] ; then
677 + mozconfig_add_options_ac '' --enable-rust-simd
678 + fi
679 +
680 + if [[ -s "${S}/api-google.key" ]] ; then
681 + local key_origin="Gentoo default"
682 + if [[ $(cat "${S}/api-google.key" | md5sum | awk '{ print $1 }') != 709560c02f94b41f9ad2c49207be6c54 ]] ; then
683 + key_origin="User value"
684 + fi
685 +
686 + mozconfig_add_options_ac "${key_origin}" \
687 + --with-google-location-service-api-keyfile="${S}/api-google.key" \
688 + --with-google-safebrowsing-api-keyfile="${S}/api-google.key"
689 + else
690 + einfo "Building without Google API key ..."
691 + fi
692 +
693 + mozconfig_use_with system-av1
694 + mozconfig_use_with system-harfbuzz
695 + mozconfig_use_with system-harfbuzz system-graphite2
696 + mozconfig_use_with system-icu
697 + mozconfig_use_with system-jpeg
698 + mozconfig_use_with system-libevent system-libevent "${SYSROOT}${EPREFIX}/usr"
699 + mozconfig_use_with system-libvpx
700 + mozconfig_use_with system-webp
701 +
702 + mozconfig_use_enable dbus
703 +
704 + use eme-free && mozconfig_add_options_ac '+eme-free' --disable-eme
705 +
706 + mozconfig_use_enable geckodriver
707 +
708 + if use hardened ; then
709 + mozconfig_add_options_ac "+hardened" --enable-hardening
710 + append-ldflags "-Wl,-z,relro -Wl,-z,now"
711 + fi
712 +
713 + mozconfig_use_enable jack
714 +
715 + mozconfig_use_enable pulseaudio
716 + # force the deprecated alsa sound code if pulseaudio is disabled
717 + if use kernel_linux && ! use pulseaudio ; then
718 + mozconfig_add_options_ac '-pulseaudio' --enable-alsa
719 + fi
720 +
721 + mozconfig_use_enable screencast pipewire
722 +
723 + mozconfig_use_enable wifi necko-wifi
724 +
725 + if use wayland ; then
726 + mozconfig_add_options_ac '+wayland' --enable-default-toolkit=cairo-gtk3-wayland
727 + else
728 + mozconfig_add_options_ac '' --enable-default-toolkit=cairo-gtk3
729 + fi
730 +
731 + # Modifications to better support ARM, bug #553364
732 + if use cpu_flags_arm_neon ; then
733 + mozconfig_add_options_ac '+cpu_flags_arm_neon' --with-fpu=neon
734 +
735 + if ! tc-is-clang ; then
736 + # thumb options aren't supported when using clang, bug 666966
737 + mozconfig_add_options_ac '+cpu_flags_arm_neon' \
738 + --with-thumb=yes \
739 + --with-thumb-interwork=no
740 + fi
741 + fi
742 +
743 + if [[ ${CHOST} == armv*h* ]] ; then
744 + mozconfig_add_options_ac 'CHOST=armv*h*' --with-float-abi=hard
745 +
746 + if ! use system-libvpx ; then
747 + sed -i \
748 + -e "s|softfp|hard|" \
749 + "${S}"/media/libvpx/moz.build \
750 + || die
751 + fi
752 + fi
753 +
754 + if use clang ; then
755 + # https://bugzilla.mozilla.org/show_bug.cgi?id=1482204
756 + # https://bugzilla.mozilla.org/show_bug.cgi?id=1483822
757 + # toolkit/moz.configure Elfhack section: target.cpu in ('arm', 'x86', 'x86_64')
758 + local disable_elf_hack=
759 + if use amd64 ; then
760 + disable_elf_hack=yes
761 + elif use x86 ; then
762 + disable_elf_hack=yes
763 + elif use arm ; then
764 + disable_elf_hack=yes
765 + fi
766 +
767 + if [[ -n ${disable_elf_hack} ]] ; then
768 + mozconfig_add_options_ac 'elf-hack is broken when using Clang' --disable-elf-hack
769 + fi
770 + fi
771 +
772 + # Additional ARCH support
773 + case "${ARCH}" in
774 + arm | ppc64)
775 + # Reduce the memory requirements for linking
776 + if use clang ; then
777 + # Nothing to do
778 + :;
779 + elif tc-ld-is-gold ; then
780 + append-ldflags -Wl,--no-keep-memory
781 + else
782 + append-ldflags -Wl,--no-keep-memory -Wl,--reduce-memory-overheads
783 + fi
784 + ;;
785 + esac
786 +
787 + if ! use elibc_glibc ; then
788 + mozconfig_add_options_ac '!elibc_glibc' --disable-jemalloc
789 + fi
790 +
791 + # Allow elfhack to work in combination with unstripped binaries
792 + # when they would normally be larger than 2GiB.
793 + append-ldflags "-Wl,--compress-debug-sections=zlib"
794 +
795 + # Pass $MAKEOPTS to build system
796 + export MOZ_MAKE_FLAGS="${MAKEOPTS}"
797 +
798 + # Use system's Python environment
799 + export MACH_USE_SYSTEM_PYTHON=1
800 +
801 + # Disable notification when build system has finished
802 + export MOZ_NOSPAM=1
803 +
804 + # Build system requires xargs but is unable to find it
805 + mozconfig_add_options_mk 'Gentoo default' "XARGS=${EPREFIX}/usr/bin/xargs"
806 +
807 + # Set build dir
808 + mozconfig_add_options_mk 'Gentoo default' "MOZ_OBJDIR=${BUILD_DIR}"
809 +
810 + # Handle EXTRA_CONF and show summary
811 + local ac opt hash reason
812 +
813 + # Apply EXTRA_ECONF entries to $MOZCONFIG
814 + if [[ -n ${EXTRA_ECONF} ]] ; then
815 + IFS=\! read -a ac <<<${EXTRA_ECONF// --/\!}
816 + for opt in "${ac[@]}"; do
817 + mozconfig_add_options_ac "EXTRA_ECONF" --${opt#--}
818 + done
819 + fi
820 +
821 + echo
822 + echo "=========================================================="
823 + echo "Building ${PF} with the following configuration"
824 + grep ^ac_add_options "${MOZCONFIG}" | while read ac opt hash reason; do
825 + [[ -z ${hash} || ${hash} == \# ]] \
826 + || die "error reading mozconfig: ${ac} ${opt} ${hash} ${reason}"
827 + printf " %-30s %s\n" "${opt}" "${reason:-mozilla.org default}"
828 + done
829 + echo "=========================================================="
830 + echo
831 +
832 + ./mach configure || die
833 +}
834 +
835 +src_compile() {
836 + local virtx_cmd=
837 +
838 + if use pgo ; then
839 + virtx_cmd=virtx
840 +
841 + # Reset and cleanup environment variables used by GNOME/XDG
842 + gnome2_environment_reset
843 +
844 + addpredict /root
845 + fi
846 +
847 + local -x GDK_BACKEND=x11
848 +
849 + ${virtx_cmd} ./mach build --verbose \
850 + || die
851 +}
852 +
853 +src_install() {
854 + # xpcshell is getting called during install
855 + pax-mark m \
856 + "${BUILD_DIR}"/dist/bin/xpcshell \
857 + "${BUILD_DIR}"/dist/bin/firefox \
858 + "${BUILD_DIR}"/dist/bin/plugin-container
859 +
860 + DESTDIR="${D}" ./mach install || die
861 +
862 + # Upstream cannot ship symlink but we can (bmo#658850)
863 + rm "${ED}${MOZILLA_FIVE_HOME}/${PN}-bin" || die
864 + dosym ${PN} ${MOZILLA_FIVE_HOME}/${PN}-bin
865 +
866 + # Don't install llvm-symbolizer from sys-devel/llvm package
867 + if [[ -f "${ED}${MOZILLA_FIVE_HOME}/llvm-symbolizer" ]] ; then
868 + rm -v "${ED}${MOZILLA_FIVE_HOME}/llvm-symbolizer" || die
869 + fi
870 +
871 + # Install policy (currently only used to disable application updates)
872 + insinto "${MOZILLA_FIVE_HOME}/distribution"
873 + newins "${FILESDIR}"/disable-auto-update.policy.json policies.json
874 +
875 + # Install system-wide preferences
876 + local PREFS_DIR="${MOZILLA_FIVE_HOME}/browser/defaults/preferences"
877 + insinto "${PREFS_DIR}"
878 + newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
879 +
880 + local GENTOO_PREFS="${ED}${PREFS_DIR}/all-gentoo.js"
881 +
882 + # Set dictionary path to use system hunspell
883 + cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to set spellchecker.dictionary_path pref"
884 + pref("spellchecker.dictionary_path", "${EPREFIX}/usr/share/myspell");
885 + EOF
886 +
887 + # Force hwaccel prefs if USE=hwaccel is enabled
888 + if use hwaccel ; then
889 + cat "${FILESDIR}"/gentoo-hwaccel-prefs.js-1 \
890 + >>"${GENTOO_PREFS}" \
891 + || die "failed to add prefs to force hardware-accelerated rendering to all-gentoo.js"
892 + fi
893 +
894 + if ! use gmp-autoupdate ; then
895 + local plugin
896 + for plugin in "${MOZ_GMP_PLUGIN_LIST[@]}" ; do
897 + einfo "Disabling auto-update for ${plugin} plugin ..."
898 + cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to disable autoupdate for ${plugin} media plugin"
899 + pref("media.${plugin}.autoupdate", false);
900 + EOF
901 + done
902 + fi
903 +
904 + # Force the graphite pref if USE=system-harfbuzz is enabled, since the pref cannot disable it
905 + if use system-harfbuzz ; then
906 + cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to set gfx.font_rendering.graphite.enabled pref"
907 + sticky_pref("gfx.font_rendering.graphite.enabled", true);
908 + EOF
909 + fi
910 +
911 + # Install language packs
912 + local langpacks=( $(find "${WORKDIR}/language_packs" -type f -name '*.xpi') )
913 + if [[ -n "${langpacks}" ]] ; then
914 + moz_install_xpi "${MOZILLA_FIVE_HOME}/distribution/extensions" "${langpacks[@]}"
915 + fi
916 +
917 + # Install geckodriver
918 + if use geckodriver ; then
919 + einfo "Installing geckodriver into ${ED}${MOZILLA_FIVE_HOME} ..."
920 + pax-mark m "${BUILD_DIR}"/dist/bin/geckodriver
921 + exeinto "${MOZILLA_FIVE_HOME}"
922 + doexe "${BUILD_DIR}"/dist/bin/geckodriver
923 +
924 + dosym ${MOZILLA_FIVE_HOME}/geckodriver /usr/bin/geckodriver
925 + fi
926 +
927 + # Install icons
928 + local icon_srcdir="${S}/browser/branding/official"
929 + local icon_symbolic_file="${FILESDIR}/icon/firefox-symbolic.svg"
930 +
931 + insinto /usr/share/icons/hicolor/symbolic/apps
932 + newins "${icon_symbolic_file}" ${PN}-symbolic.svg
933 +
934 + local icon size
935 + for icon in "${icon_srcdir}"/default*.png ; do
936 + size=${icon%.png}
937 + size=${size##*/default}
938 +
939 + if [[ ${size} -eq 48 ]] ; then
940 + newicon "${icon}" ${PN}.png
941 + fi
942 +
943 + newicon -s ${size} "${icon}" ${PN}.png
944 + done
945 +
946 + # Install menus
947 + local wrapper_wayland="${PN}-wayland.sh"
948 + local wrapper_x11="${PN}-x11.sh"
949 + local desktop_file="${FILESDIR}/icon/${PN}-r2.desktop"
950 + local display_protocols="auto X11"
951 + local icon="${PN}"
952 + local name="Mozilla ${MOZ_PN^}"
953 + local use_wayland="false"
954 +
955 + if use wayland ; then
956 + display_protocols+=" Wayland"
957 + use_wayland="true"
958 + fi
959 +
960 + local app_name desktop_filename display_protocol exec_command
961 + for display_protocol in ${display_protocols} ; do
962 + app_name="${name} on ${display_protocol}"
963 + desktop_filename="${PN}-${display_protocol,,}.desktop"
964 +
965 + case ${display_protocol} in
966 + Wayland)
967 + exec_command="${PN}-wayland --name ${PN}-wayland"
968 + newbin "${FILESDIR}/${wrapper_wayland}" ${PN}-wayland
969 + ;;
970 + X11)
971 + if ! use wayland ; then
972 + # Exit loop here because there's no choice so
973 + # we don't need wrapper/.desktop file for X11.
974 + continue
975 + fi
976 +
977 + exec_command="${PN}-x11 --name ${PN}-x11"
978 + newbin "${FILESDIR}/${wrapper_x11}" ${PN}-x11
979 + ;;
980 + *)
981 + app_name="${name}"
982 + desktop_filename="${PN}.desktop"
983 + exec_command="${PN}"
984 + ;;
985 + esac
986 +
987 + cp "${desktop_file}" "${WORKDIR}/${PN}.desktop-template" || die
988 +
989 + sed -i \
990 + -e "s:@NAME@:${app_name}:" \
991 + -e "s:@EXEC@:${exec_command}:" \
992 + -e "s:@ICON@:${icon}:" \
993 + "${WORKDIR}/${PN}.desktop-template" \
994 + || die
995 +
996 + newmenu "${WORKDIR}/${PN}.desktop-template" "${desktop_filename}"
997 +
998 + rm "${WORKDIR}/${PN}.desktop-template" || die
999 + done
1000 +
1001 + # Install generic wrapper script
1002 + [[ -f "${ED}/usr/bin/${PN}" ]] && rm "${ED}/usr/bin/${PN}"
1003 + newbin "${FILESDIR}/${PN}.sh" ${PN}
1004 +
1005 + # Update wrapper
1006 + local wrapper
1007 + for wrapper in \
1008 + "${ED}/usr/bin/${PN}" \
1009 + "${ED}/usr/bin/${PN}-x11" \
1010 + "${ED}/usr/bin/${PN}-wayland" \
1011 + ; do
1012 + [[ ! -f "${wrapper}" ]] && continue
1013 +
1014 + sed -i \
1015 + -e "s:@PREFIX@:${EPREFIX}/usr:" \
1016 + -e "s:@MOZ_FIVE_HOME@:${MOZILLA_FIVE_HOME}:" \
1017 + -e "s:@APULSELIB_DIR@:${apulselib}:" \
1018 + -e "s:@DEFAULT_WAYLAND@:${use_wayland}:" \
1019 + "${wrapper}" \
1020 + || die
1021 + done
1022 +}
1023 +
1024 +pkg_preinst() {
1025 + xdg_pkg_preinst
1026 +
1027 + # If the apulse libs are available in MOZILLA_FIVE_HOME then apulse
1028 + # does not need to be forced into the LD_LIBRARY_PATH
1029 + if use pulseaudio && has_version ">=media-sound/apulse-0.1.12-r4" ; then
1030 + einfo "APULSE found; Generating library symlinks for sound support ..."
1031 + local lib
1032 + pushd "${ED}${MOZILLA_FIVE_HOME}" &>/dev/null || die
1033 + for lib in ../apulse/libpulse{.so{,.0},-simple.so{,.0}} ; do
1034 + # A quickpkg rolled by hand will grab symlinks as part of the package,
1035 + # so we need to avoid creating them if they already exist.
1036 + if [[ ! -L ${lib##*/} ]] ; then
1037 + ln -s "${lib}" ${lib##*/} || die
1038 + fi
1039 + done
1040 + popd &>/dev/null || die
1041 + fi
1042 +}
1043 +
1044 +pkg_postinst() {
1045 + xdg_pkg_postinst
1046 +
1047 + if ! use gmp-autoupdate ; then
1048 + elog "USE='-gmp-autoupdate' has disabled the following plugins from updating or"
1049 + elog "installing into new profiles:"
1050 + local plugin
1051 + for plugin in "${MOZ_GMP_PLUGIN_LIST[@]}" ; do
1052 + elog "\t ${plugin}"
1053 + done
1054 + elog
1055 + fi
1056 +
1057 + if use pulseaudio && has_version ">=media-sound/apulse-0.1.12-r4" ; then
1058 + elog "Apulse was detected at merge time on this system and so it will always be"
1059 + elog "used for sound. If you wish to use pulseaudio instead please unmerge"
1060 + elog "media-sound/apulse."
1061 + elog
1062 + fi
1063 +
1064 + local show_doh_information show_normandy_information
1065 +
1066 + if [[ -z "${REPLACING_VERSIONS}" ]] ; then
1067 + # New install; Tell user that DoH is disabled by default
1068 + show_doh_information=yes
1069 + show_normandy_information=yes
1070 + else
1071 + local replacing_version
1072 + for replacing_version in ${REPLACING_VERSIONS} ; do
1073 + if ver_test "${replacing_version}" -lt 70 ; then
1074 + # Tell user only once about our DoH default
1075 + show_doh_information=yes
1076 + fi
1077 +
1078 + if ver_test "${replacing_version}" -lt 74.0-r2 ; then
1079 + # Tell user only once about our Normandy default
1080 + show_normandy_information=yes
1081 + fi
1082 + done
1083 + fi
1084 +
1085 + if [[ -n "${show_doh_information}" ]] ; then
1086 + elog
1087 + elog "Note regarding Trusted Recursive Resolver aka DNS-over-HTTPS (DoH):"
1088 + elog "Due to privacy concerns (encrypting DNS might be a good thing, sending all"
1089 + elog "DNS traffic to Cloudflare by default is not a good idea and applications"
1090 + elog "should respect OS configured settings), \"network.trr.mode\" was set to 5"
1091 + elog "(\"Off by choice\") by default."
1092 + elog "You can enable DNS-over-HTTPS in ${PN^}'s preferences."
1093 + fi
1094 +
1095 + # bug 713782
1096 + if [[ -n "${show_normandy_information}" ]] ; then
1097 + elog
1098 + elog "Upstream operates a service named Normandy which allows Mozilla to"
1099 + elog "push changes for default settings or even install new add-ons remotely."
1100 + elog "While this can be useful to address problems like 'Armagadd-on 2.0' or"
1101 + elog "revert previous decisions to disable TLS 1.0/1.1, privacy and security"
1102 + elog "concerns prevail, which is why we have switched off the use of this"
1103 + elog "service by default."
1104 + elog
1105 + elog "To re-enable this service set"
1106 + elog
1107 + elog " app.normandy.enabled=true"
1108 + elog
1109 + elog "in about:config."
1110 + fi
1111 +}