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