www-client/icecat: bump to 78.8.0, remove old

Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Alfred Wingate <parona@protonmail.com>
This commit is contained in:
Alfred Wingate 2021-03-22 02:40:12 +02:00
parent b1fbc0e4d0
commit e83031a8db
No known key found for this signature in database
GPG Key ID: A12750536B5E7010
16 changed files with 949 additions and 1033 deletions

View File

@ -1,2 +1 @@
DIST firefox-68.0-patches-12.tar.xz 17476 BLAKE2B bd788e24820f902f4ca908b0cf7a49a4c57e058915af1eb87233d19d91271092676c1ee4c67e88df2411ecccea47c4e735efdf95945954f2d9aac5cc2f9051f2 SHA512 8033a3c445eaddd28188b338534da16a4130b679a5f6673b3094524e47435890e6d454d7b67f81bbe21f80ef1b65fa7e6c27d71191ba70dd8ea87fc68463f9a7 DIST firefox-78esr-patches-10.tar.xz 66396 BLAKE2B c29b723e47c58b10885b220080568aba751e1b73c58e28fce62a2da4c4c3ba8c71b63e60448d17599a3df4446dbd9f9387b4b2b75da5ed1e545591aafe8ec83c SHA512 6bb9caf1f6867b894ab315a73f8ae6f381b5c80c90539f38e786ee653c72c0df055aade854faa23f22cab2253f54abaf918a756945b76ed88f5a224ba8a8f12f
DIST gnuzilla-8f9f30e1e9cf2b411ce2747024d4f72edda86904.tar.gz 8083043 BLAKE2B 2e306ec06af63ad3589968e6f648d43eeee48d53c60f836b94e05c367cdd830b2b5a66bbada4a564d8633fa66f1cdb121cf4c6a4047def5ce84f2ae74a108289 SHA512 fb8b8b5667b7a5047d6f3e96ff3ab0e62016baccbf9b5a91059d6eecf3bdaf960e05317830119a6784ac52f1cada9554d8c76cac0305bc532e1febcaa2d8bf0b

View File

@ -1,33 +0,0 @@
--- a/makeicecat 2020-04-28 02:06:48.912560052 +0200
+++ b/makeicecat 2020-04-28 02:07:40.172560384 +0200
@@ -193,8 +193,8 @@
for file in $(find |grep searchplugins/list.txt)
do
/bin/sed /^$/d -i $file
- sort -u $file > /tmp/sorttmp
- cp /tmp/sorttmp $file
+ sort -u $file > ./sorttmp
+ cp ./sorttmp $file
echo >> $file
done
@@ -524,14 +524,14 @@
find . -executable -exec chmod 750 {} \;
find . ! -executable -exec chmod 640 {} \;
-find . -type f | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" > /tmp/filelist.txt
-find . -type l | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" >> /tmp/filelist.txt
+find . -type f | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" > ./filelist.txt
+find . -type l | sed -e 's/^\.\///' | sort | xargs -i echo "{}={}" >> ./filelist.txt
-mkisofs -D -V "\$6" -no-pad -R -apple -o /tmp/icecat-uncompressed.dmg -path-list /tmp/filelist.txt -graft-points -gid 20 -dir-mode 0750 -new-dir-mode 0750
+mkisofs -D -V "\$6" -no-pad -R -apple -o ./icecat-uncompressed.dmg -path-list ./filelist.txt -graft-points -gid 20 -dir-mode 0750 -new-dir-mode 0750
-dmg dmg /tmp/icecat-uncompressed.dmg \$4
-rm /tmp/icecat-uncompressed.dmg
+dmg dmg ./icecat-uncompressed.dmg \$4
+rm ./icecat-uncompressed.dmg
find . -executable -exec chmod 755 {} \;
find . ! -executable -exec chmod 644 {} \;

View File

@ -1,10 +0,0 @@
--- a/browser/installer/package-manifest.in 2020-04-27 16:56:07.222346286 +0200
+++ b/browser/installer/package-manifest.in 2020-04-27 17:05:38.822349984 +0200
@@ -295,6 +295,7 @@
; [Default Preferences]
; All the pref files must be part of base to prevent migration bugs
+@RESPATH@/browser/@PREF_DIR@/all-gentoo.js
@RESPATH@/browser/@PREF_DIR@/icecat.js
@RESPATH@/browser/@PREF_DIR@/icecat-branding.js
@RESPATH@/greprefs.js

View File

@ -1,21 +0,0 @@
From: Mike Hommey <mh@glandium.org>
Date: Sun, 2 Apr 2017 06:33:19 +0900
Subject: Use the Mozilla Location Service key when the Google Key is not there
---
browser/app/profile/firefox.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index f57e2a7cc9f8..bb1ed4352c66 100644
--- a/browser/app/profile/icecat.js
+++ b/browser/app/profile/icecat.js
@@ -1372,7 +1372,7 @@ pref("dom.debug.propagate_gesture_events_through_content", false);
// All the Geolocation preferences are here.
//
-#ifndef EARLY_BETA_OR_EARLIER
+#if !defined(EARLY_BETA_OR_EARLIER) && defined(GOOGLE_LOCATION_SERVICE_API_KEY)
pref("geo.wifi.uri", "https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_LOCATION_SERVICE_API_KEY%");
#else
// Use MLS on Nightly and early Beta.

View File

@ -1,5 +0,0 @@
{
"policies": {
"DisableAppUpdate": true
}
}

View File

@ -0,0 +1,9 @@
[Global]
id=gentoo
version=1.0
about=GNU IceCat for Gentoo
[Preferences]
app.distributor="src_prepare-overlay"
app.distributor.channel="src_prepare-overlay"
startup.homepage_welcome_url="https://gitlab.com/src_prepare/src_prepare-overlay"

View File

@ -1,4 +1,3 @@
pref("app.update.enabled", false);
pref("app.update.autoInstallEnabled", false); pref("app.update.autoInstallEnabled", false);
pref("browser.display.use_system_colors", true); pref("browser.display.use_system_colors", true);
pref("browser.link.open_external", 3); pref("browser.link.open_external", 3);
@ -8,10 +7,6 @@ pref("browser.tabs.tabMinWidth", 15);
pref("browser.backspace_action", 0); pref("browser.backspace_action", 0);
pref("browser.urlbar.hideGoButton", true); pref("browser.urlbar.hideGoButton", true);
pref("accessibility.typeaheadfind", true); pref("accessibility.typeaheadfind", true);
pref("browser.shell.checkDefaultBrowser", false);
pref("browser.EULA.override", true);
pref("general.useragent.vendor", "Gentoo");
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
pref("intl.locale.requested", ""); pref("intl.locale.requested", "");
pref("extensions.autoDisableScopes", 0);
pref("layout.css.dpi", 0); pref("layout.css.dpi", 0);
pref("network.trr.mode", 5);

View File

@ -1,19 +0,0 @@
pref("app.update.enabled", false);
pref("app.update.autoInstallEnabled", false);
pref("browser.display.use_system_colors", true);
pref("browser.link.open_external", 3);
pref("general.smoothScroll", true);
pref("general.autoScroll", false);
pref("browser.tabs.tabMinWidth", 15);
pref("browser.backspace_action", 0);
pref("browser.urlbar.hideGoButton", true);
pref("accessibility.typeaheadfind", true);
pref("browser.shell.checkDefaultBrowser", false);
pref("browser.EULA.override", true);
pref("general.useragent.vendor", "Gentoo");
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
pref("intl.locale.requested", "");
pref("extensions.autoDisableScopes", 0);
pref("layout.css.dpi", 0);
pref("network.trr.mode", 5);
pref("app.normandy.enabled", false);

View File

@ -8,10 +8,10 @@ Icon=@ICON@
Terminal=false Terminal=false
Type=Application Type=Application
MimeType=application/pdf;application/vnd.mozilla.xul+xml;application/xhtml+xml;text/html;text/mml;text/xml;x-scheme-handler/ftp;x-scheme-handler/http;x-scheme-handler/https; MimeType=application/pdf;application/vnd.mozilla.xul+xml;application/xhtml+xml;text/html;text/mml;text/xml;x-scheme-handler/ftp;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=@STARTUP_NOTIFY@ StartupNotify=true
Categories=Network;WebBrowser; Categories=Network;WebBrowser;
Keywords=web;browser;internet; Keywords=web;browser;internet;
Actions=new-window;new-private-window; Actions=new-window;new-private-window;profile-manager-window;
[Desktop Action new-window] [Desktop Action new-window]
Name=Open a New Window Name=Open a New Window
@ -228,3 +228,9 @@ Name[xh]=Ifestile yangasese entsha
Name[zh_CN]= Name[zh_CN]=
Name[zh_TW]= Name[zh_TW]=
Exec=@EXEC@ --private-window %u Exec=@EXEC@ --private-window %u
[Desktop Action profile-manager-window]
Name=Open the Profile Manager
Name[de]=Profilverwaltung öffnen
Name[cs]=Správa profilů
Exec=@EXEC@ --ProfileManager

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><linearGradient id="a"><stop offset="0" stop-color="#d4e3eb" stop-opacity=".5"/><stop offset="1" stop-color="#d4e3eb" stop-opacity="0"/></linearGradient><linearGradient xlink:href="#a" id="b" x1="64.8" y1="175.6" x2="114.7" y2="175.6" gradientUnits="userSpaceOnUse"/></defs><path d="M255 179a107 100 0 11-213 0 107 100 0 11213 0z" transform="matrix(1.08865 0 0 1.12618 -15 -32)" fill="#002452" stroke="#000"/><path d="M35 141l7-9c6 1 10 4 13 8l3 3h2l5 3-1-2 2 3 3 1h1l7 3 4-5-1-1h4l1-6-3 3-5-1v-2h-1l-2-4h-2v3h-2l1-6-4-1-2-2 3-1v-1l-3-1 3-4v-5h-3l2-5 1-6h-2v-2l2-1v-7c2-6 4-6 6-8v-6a95 95 0 00-39 59z" fill="#8ac2ff"/><path d="M102 139l3 5 1 5 7-1c12 9 7 11 6 14l11 1v-2h5l-1-3 1-2v-3l2-2v-1h-4l-1-5 4-4 2-6v-3l45 6 3 3-1 6 3 2v5h-7l-3 1 9 2c3 5 5 6 7 7v17l-18 24-7 1-5 2-8-1c-5-2-4-4-1-7 3-2 0-5-3-8 2-2 2-4 1-6l-11-9-2 8h-3v3l1 1v5l-4-3-2-1v3l-2 1-9-6-1-4h-1l-2-3 2-3-3-4-2 3h-3l-1-3 1-2h2l1-3-2-4 3-1v-8l-5-3-4-1 7 5-1 3h-1c-2-2-1-4-7-6v-4l-3-2 1-9z" fill="#5ea9fe"/><path d="M39 122c-1-60 35-98 94-108 44-2 66 18 89 28l6-13 3 1 6 7 7 1 13 9 39-3-1 11c-5 4-11 9-12 12s-2 4-4 5c0 6 1 9-2 13l-3 21c-5 4-10 8-14 14l-1 5c1 1-2 1-4 4-3 3-5 3-9 2l-8-1-2-3-10-1h-2l-7-7c-10-1-8-11-12-18l-9-10c-6 2-10 7-17 18-1 11-4 13-2 32l2 9 4 16c3 5 7 10 7 16 4 6 4 11 4 16 4 4 5 8 5 11-1 3-1 8-5 9l-8-1-1-2-6-1-4-6c1-6-4-12-11-18-1-2-6-6-4-7 2-2 1-8-3-11-3-2-4-6-7-9 1 2-6-14-5-16 1-5-4-18-6-18v-26c-4-19-10-44-47-30-8 2-27 10-53 49z" fill="#f1f6f8" stroke="#000"/><path d="M146 152c18-21 33-48 50-63 4 7 7 7 10 13s1 14 6 15c5 2 7 6 12 9l13 1c1-1 0 2 1 2 3 2 12 3 13 2l15-28-20-50-40-18L71 59 43 86l-5 39c8-13 20-32 32-39 57-42 68 5 67 9l7 41 2 16z" fill="#d0e0e9"/><path d="M191 258l3-4v-5s9-9 10-8h10v-3l5-1 5-5h2v-3l2-2v-4l3-5 1-5 3-3 3 2 7-1 1 9-3 6-1 7-2 1v4l-6 4 1 1c-8 12-23 16-44 15z" fill="#056eff"/><path d="M210 257c22-23 18-29 18-29h-2v4l-2 1-6 4-4 1-1 3-10 1-9 7v6l-3 3c8 2 13 0 19-1z" fill="#00c5ff"/><path d="M91 157c25 55 40 83 103 101 33 2 51-25 62-47 2 12 1 24 0 36-12 19-24 34-49 35-29 4-61 1-102-29-48-47-38-72-40-94 7-19 16-16 26-2z" fill="#aad4ff" stroke="#000"/><path d="M69 195c16-1 34 6 46 10-7-10-15-26-23-43-3-7-8-16-18-16-7 5-11 16-9 30 1 6 1 14 4 19z" fill="#f2f2f2" stroke="url(#b)"/><path d="M65 175c9 2 14-6 20-14v12l-19 11-1-9z" fill="#002655"/><path d="M72 208l24-14-3-7c-7 5-11 13-25 13l4 8z" fill="#00244f"/><path d="M77 217c9-3 18-7 25-13l3 5c-9 5-17 11-23 18l-5-10z" fill="#002045"/><path d="M89 236c9-5 19-10 25-17l5 5c-4 10-13 16-21 22l-9-10z" fill="#002655"/><path d="M106 253c31-16 25-19 25-19v1c2 4-1 13-13 26-5-2-10-4-12-8z" fill="#002a5d"/><path d="M130 267l14-22c0 4-1 9 2 12l2 1c-1 6-4 11-3 17-10-3-12-5-15-8z" fill="#00346f"/><path d="M156 278c8-3 4-24 4-24l13 14c-2 7-2 13 3 15-7-1-13 1-20-5z" fill="#003e84"/><path d="M188 263c20 6 13 12 20 19-6 1-11 2-20 1 7-4 4-12-1-20z" fill="#004fa5"/><path d="M225 262c4 5 8 8 11 9-5 4-10 7-16 9 2-4 1-10-1-16-1-2 5-2 6-2z" fill="#005cc1"/><path d="M213 79c-2-7-1-16 7-33 1-2 2-2 2-5l6-12 4 1c2 3 3 6 5 7l6 1 14 9 38-2 1 11-11 8-4 7-2 1v8l-1 3-1 1-4 22c-5 5-13 8-14 19l-3 3-3 3h-4c-1-8-4-7-3-11l7-10 5-1 3-2-12-2-3 5-14-16 1 16-8-1c-3-5-12-8-14-14-2-3-1-8 3-13l7 5 7 1 8-4v-8l-5-19-4-9c-5 11-3 24-14 31z" fill="#6db5ff"/><path d="M40 103l13-26 16-10 54-1c9 1 11 7 13 13 8 1 9 5 8 9l-6 9 2 32 5 8 1-21c0-13 3-16 6-19 33 0 33-25 35-50 1-1 2-3 5-4l23-4C113-3 54 32 40 103z" fill="#5babfe"/><path d="M62 50l7 2 3-3 4 8 3 1v-3l-7-13c6 2 11 8 14 9V40l2-2 3 9c5 6 6 10 8 14 3 1 5 0 6-1-2 0-4-1-5-6v-7l-3-1-1-11h3l7 21 14 8 4 1v-2c-6-2-11-9-16-13-4-9-1-10-2-15l4 7 10 11v-4c-9-12-4-13-6-19l3 1 1 9c5 5 14 8 14 17 2-2 7 4 9 14V60c-6-5-12-14-17-23-3-5-2-9-1-13 2 2 6 2 7 5l11 23c8 6 9 12 8 19 6 4 6 11 7 17l-1-13-12-43h5l2 6 5 3 4 13 1 23 1 1v14l3-14-2-3V51c-3-3-2-7-3-10l2-7h3v12l2 6V41l8-5-2 20 4-19 6 1c0 16-3 28-4 41 5-6 4-22 6-34l10-11 2 2-7 18-4 18 1 1 8-21v-4l4-9 7 5 11-5c-32-21-96-50-154 11z" fill="#004ca0"/><path d="M226 68l1-14 6-13v-3l6 2 18 10h25l-22 8h-7l-17-13c-6 7-8 15-10 23z" fill="#003a7b"/><path d="M237 98c10 9 9 11 9 11v-7c-3-3-6-3-9-4zM248 127l3-3 5 1-4 4-4-2z" fill="#001c41"/><g><path d="M240 120h-8c-1-1-4 0-7 2l-7 6 7-7 6-3h9v2zM234 117l-10 1-11 4 9-5c5-2 9-1 13-1l-1 1z" fill="#9fceff"/><path d="M241 122l-12 3c-5 1-8 6-12 9l6-7c4-4 7-4 10-5h9-1z" fill="#9fceff"/><path d="M221 131h0z" fill="none" stroke="#000"/></g></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -1,10 +0,0 @@
[Desktop Entry]
Name=@NAME@
Comment=Web Browser
Exec=icecat %u
Icon=@ICON@
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
Categories=Network;WebBrowser;

View File

@ -1,2 +0,0 @@
#!/bin/sh
patch -p1 < "${FILESDIR}"/0001_prevent_makeicecat_from_writing_to_slash_tmp.patch

View File

@ -1,912 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
COMMIT_SHA="8f9f30e1e9cf2b411ce2747024d4f72edda86904"
VIRTUALX_REQUIRED="pgo"
WANT_AUTOCONF="2.1"
MOZ_ESR="1"
PYTHON_COMPAT=( python3_{6,7,8} )
PYTHON_REQ_USE='ncurses,sqlite,ssl,threads(+)'
# This list can be updated with scripts/get_langs.sh from the mozilla overlay
#MOZ_LANGS=(ach af an ar ast az be bg bn br bs ca cak cs cy da de dsb el en en-CA
#en-GB en-US eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gn gu-IN
#he hi-IN hr hsb hu hy-AM ia id is it ja ka kab kk km kn ko lij lt lv mk mr ms my
#nb-NO nl nn-NO oc pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE ta te
#th tr uk ur uz vi xh zh-CN zh-TW )
MOZ_LANGS=()
PROPERTIES+=" live"
# Convert the ebuild version to the upstream mozilla version, used by mozlinguas
MOZ_PV="${PV/_alpha/a}" # Handle alpha for SRC_URI
MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
MOZ_PV="${MOZ_PV%%_rc*}" # Handle rc for SRC_URI
if [[ ${MOZ_ESR} == 1 ]] ; then
# ESR releases have slightly different version numbers
MOZ_PV="${MOZ_PV}esr"
fi
# Patch version
PATCH="firefox-68.0-patches-12"
MOZ_HTTP_URI="https://git.savannah.gnu.org/cgit/gnuzilla.git"
MOZ_SRC_URI="https://git.savannah.gnu.org/cgit/gnuzilla.git/snapshot/gnuzilla-${COMMIT_SHA}.tar.gz"
LLVM_MAX_SLOT=10
inherit check-reqs eapi7-ver flag-o-matic toolchain-funcs vcs-snapshot \
gnome2-utils llvm mozcoreconf-v6 oom-score-adj pax-utils xdg-utils \
autotools multiprocessing virtualx
#mozlinguas-v2
DESCRIPTION="GNU IceCat Web Browser"
HOMEPAGE="https://www.gnu.org/software/gnuzilla/"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
SLOT="0"
LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
IUSE="
amd64 -bindist clang cpu_flags_x86_avx2 dbus debug geckodriver
+gmp-autoupdate hardened hwaccel jack kernel_linux lto cpu_flags_arm_neon
pgo pulseaudio +screenshot selinux startup-notification +system-av1
+system-harfbuzz +system-icu +system-jpeg +system-libevent
-system-sqlite -system-libvpx +system-webp test wayland wifi x86
"
REQUIRED_USE="pgo? ( lto )
wifi? ( dbus )"
RESTRICT="
!test? ( test )
"
PATCH_URIS=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c,whissi}/mozilla/patchsets/${PATCH}.tar.xz )
SRC_URI="
${SRC_URI}
${MOZ_SRC_URI}
${PATCH_URIS[@]}
"
# Mercurial for makeicecat (see "src_unpack" below)
BDEPEND+="
dev-vcs/mercurial
dev-perl/File-Rename:0
"
CDEPEND="
>=dev-libs/glib-2.26:2
>=dev-libs/libffi-3.0.10:=
>=dev-libs/nspr-4.21
>=dev-libs/nss-3.44.3
>=media-libs/freetype-2.4.10
>=media-libs/libpng-1.6.35:0=[apng]
>=media-libs/mesa-10.2:*
>=sys-libs/zlib-1.2.3
>=x11-libs/cairo-1.10[X]
>=x11-libs/gtk+-2.18:2
>=x11-libs/gtk+-3.4.0:3[X]
>=x11-libs/pango-1.22.0
>=x11-libs/pixman-0.19.2
dev-libs/atk
dev-libs/expat
media-libs/fontconfig
media-video/ffmpeg
virtual/freedesktop-icon-theme
x11-libs/gdk-pixbuf
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
startup-notification? ( >=x11-libs/startup-notification-0.8 )
jack? ( virtual/jack )
selinux? ( sec-policy/selinux-mozilla )
system-harfbuzz? ( >=media-libs/harfbuzz-2.4.0:0= >=media-gfx/graphite2-1.3.13 )
system-icu? ( >=dev-libs/icu-63.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-libevent? ( >=dev-libs/libevent-2.0:0=[threads] )
system-libvpx? ( =media-libs/libvpx-1.7*:0=[postproc] )
system-sqlite? ( >=dev-db/sqlite-3.28.0:3[secure-delete,debug=] )
system-webp? ( >=media-libs/libwebp-1.0.2:0= )
kernel_linux? (
!pulseaudio? (
media-libs/alsa-lib
)
)
dbus? (
>=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
)
system-av1? (
>=media-libs/dav1d-0.3.0:=
>=media-libs/libaom-1.0.0:=
)
wifi? (
kernel_linux? (
>=sys-apps/dbus-0.60
>=dev-libs/dbus-glib-0.72
net-misc/networkmanager
)
)
"
RDEPEND="
${CDEPEND}
jack? ( virtual/jack )
pulseaudio? ( || ( media-sound/pulseaudio
>=media-sound/apulse-0.1.9 ) )
selinux? ( sec-policy/selinux-mozilla )
"
DEPEND="
${CDEPEND}
app-arch/zip
app-arch/unzip
>=dev-util/cbindgen-0.8.7
>=net-libs/nodejs-8.11.0
>=sys-devel/binutils-2.30
sys-apps/findutils
|| (
(
sys-devel/clang:10
!clang? ( sys-devel/llvm:10 )
clang? (
=sys-devel/lld-10*
sys-devel/llvm:10[gold]
pgo? ( =sys-libs/compiler-rt-sanitizers-10*[profile] )
)
)
(
sys-devel/clang:9
!clang? ( sys-devel/llvm:9 )
clang? (
=sys-devel/lld-9*
sys-devel/llvm:9[gold]
pgo? ( =sys-libs/compiler-rt-sanitizers-9*[profile] )
)
)
(
sys-devel/clang:8
!clang? ( sys-devel/llvm:8 )
clang? (
=sys-devel/lld-8*
sys-devel/llvm:8[gold]
pgo? ( =sys-libs/compiler-rt-sanitizers-8*[profile] )
)
)
)
pulseaudio? ( media-sound/pulseaudio )
>=virtual/rust-1.34.0
wayland? ( >=x11-libs/gtk+-3.11:3[wayland] )
amd64? ( >=dev-lang/yasm-1.1 virtual/opengl )
x86? ( >=dev-lang/yasm-1.1 virtual/opengl )
!system-av1? (
amd64? ( >=dev-lang/nasm-2.13 )
x86? ( >=dev-lang/nasm-2.13 )
)
"
#S="${WORKDIR}/icecat-${PV%_*}"
S="${WORKDIR}/gnuzilla-${COMMIT_SHA}/output/icecat-${PV%_*}"
QA_PRESTRIPPED="usr/lib*/${PN}/icecat"
BUILD_OBJ_DIR="${S}/ff"
# allow GMP_PLUGIN_LIST to be set in an eclass or
# overridden in the enviromnent (advanced hackers only)
if [[ -z $GMP_PLUGIN_LIST ]] ; then
GMP_PLUGIN_LIST=( gmp-gmpopenh264 gmp-widevinecdm )
fi
fix_path() {
local value_to_move=${1}
local new_path path_value
IFS=:; local -a path_values=( ${PATH} )
for path_value in "${path_values[@]}" ; do
if [[ ${path_value} == *"${value_to_move}"* ]] ; then
new_path="${path_value}${new_path:+:}${new_path}"
else
new_path+="${new_path:+:}${path_value}"
fi
done
echo "${new_path}"
}
llvm_check_deps() {
if ! has_version --host-root "sys-devel/clang:${LLVM_SLOT}" ; then
ewarn "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
return 1
fi
if use clang ; then
if ! has_version --host-root "=sys-devel/lld-${LLVM_SLOT}*" ; then
ewarn "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
return 1
fi
if use pgo ; then
if ! has_version --host-root "=sys-libs/compiler-rt-sanitizers-${LLVM_SLOT}*" ; then
ewarn "=sys-libs/compiler-rt-sanitizers-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
return 1
fi
fi
fi
einfo "Will use LLVM slot ${LLVM_SLOT}!" >&2
}
pkg_pretend() {
if use pgo ; then
if ! has usersandbox ${FEATURES} ; then
die "You must enable usersandbox as X server can not run as root!"
fi
fi
# Ensure we have enough disk space to compile
if use pgo || use lto || use debug || use test ; then
CHECKREQS_DISK_BUILD="16G"
else
CHECKREQS_DISK_BUILD="12G"
fi
check-reqs_pkg_pretend
}
pkg_setup() {
moz_pkgsetup
# Ensure we have enough disk space to compile
if use pgo || use lto || use debug || use test ; then
CHECKREQS_DISK_BUILD="16G"
else
CHECKREQS_DISK_BUILD="12G"
fi
check-reqs_pkg_setup
# Avoid PGO profiling problems due to enviroment leakage
# These should *always* be cleaned up anyway
unset DBUS_SESSION_BUS_ADDRESS \
DISPLAY \
ORBIT_SOCKETDIR \
SESSION_MANAGER \
XDG_CACHE_HOME \
XDG_SESSION_COOKIE \
XAUTHORITY
oom_score_adj_allow_write
llvm_pkg_setup
# Workaround for #627726
if has ccache ${FEATURES} ; then
if use clang && use pgo ; then
die "Using FEATURES=ccache with USE=clang and USE=pgo is currently known to be broken (bug #718632)."
fi
einfo "Fixing PATH for FEATURES=ccache ..."
PATH=$(fix_path 'ccache/bin')
elif has distcc ${FEATURES} ; then
einfo "Fixing PATH for FEATURES=distcc ..."
PATH=$(fix_path 'distcc/bin')
fi
}
src_unpack() {
default
# Unpack language packs
# mozlinguas_src_unpack
cd "${WORKDIR}"/gnuzilla-"${COMMIT_SHA}"
"${FILESDIR}"/patch_without_repoman_knowing.sh
# G N U / M a g i c
./makeicecat
}
src_prepare() {
rm "${WORKDIR}"/firefox/2013_avoid_noinline_on_GCC_with_skcms.patch
rm "${WORKDIR}"/firefox/2015_fix_cssparser.patch
cp "${FILESDIR}"/1000_gentoo_preference_file.patch "${WORKDIR}"/firefox
cp "${FILESDIR}"/3000_use_the_Mozilla_location_service_when_no_Google_key_is_available.patch "${WORKDIR}"/firefox
eapply "${WORKDIR}/firefox"
# Allow user to apply any additional patches without modifing ebuild
eapply_user
# Make LTO respect MAKEOPTS
sed -i \
-e "s/multiprocessing.cpu_count()/$(makeopts_jobs)/" \
"${S}"/build/moz.configure/toolchain.configure \
|| die "sed failed to set num_cores"
# Enable gnomebreakpad
if use debug ; then
sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
"${S}"/build/unix/run-mozilla.sh || die "sed failed!"
fi
# Drop -Wl,--as-needed related manipulation for ia64 as it causes ld sefgaults, bug #582432
if use ia64 ; then
sed -i \
-e '/^OS_LIBS += no_as_needed/d' \
-e '/^OS_LIBS += as_needed/d' \
"${S}"/widget/gtk/mozgtk/gtk2/moz.build \
"${S}"/widget/gtk/mozgtk/gtk3/moz.build \
|| die "sed failed to drop --as-needed for ia64"
fi
# Fix sandbox violations during make clean, bug 372817
sed -e "s:\(/no-such-file\):${T}\1:g" \
-i "${S}"/config/rules.mk \
-i "${S}"/nsprpub/configure{.in,} \
|| die
# Don't exit with error when some libs are missing which we have in
# system.
sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
-i "${S}"/browser/installer/Makefile.in || die
# Don't error out when there's no files to be removed:
sed 's@\(xargs rm\)$@\1 -f@' \
-i "${S}"/toolkit/mozapps/installer/packager.mk || die
# Keep codebase the same even if not using official branding
sed '/^MOZ_DEV_EDITION=1/d' \
-i "${S}"/browser/branding/official/configure.sh || die
# rustfmt, a tool to format Rust code, is optional and not required to build Firefox.
# However, when available, an unsupported version can cause problems, bug #669548
sed -i -e "s@check_prog('RUSTFMT', add_rustup_path('rustfmt')@check_prog('RUSTFMT', add_rustup_path('rustfmt_do_not_use')@" \
"${S}"/build/moz.configure/rust.configure || die
# Autotools configure is now called old-configure.in
# This works because there is still a configure.in that happens to be for the
# shell wrapper configure script
eautoreconf old-configure.in
# Must run autoconf in js/src
cd "${S}"/js/src || die
eautoconf old-configure.in
}
src_configure() {
MEXTENSIONS="default"
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Gentoo Linux use ONLY. For your own distribution, please
# get your own set of keys.
_google_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
# Add information about TERM to output (build.log) to aid debugging
# blessings problems
if [[ -n "${TERM}" ]] ; then
einfo "TERM is set to: \"${TERM}\""
else
einfo "TERM is unset."
fi
if use clang && ! tc-is-clang ; then
# Force clang
einfo "Enforcing the use of clang due to USE=clang ..."
CC=${CHOST}-clang
CXX=${CHOST}-clang++
strip-unsupported-flags
elif ! use clang && ! tc-is-gcc ; then
# Force gcc
einfo "Enforcing the use of gcc due to USE=-clang ..."
CC=${CHOST}-gcc
CXX=${CHOST}-g++
strip-unsupported-flags
fi
####################################
#
# mozconfig, CFLAGS and CXXFLAGS setup
#
####################################
mozconfig_init
# common config components
mozconfig_annotate 'system_libs' \
--with-system-zlib \
--with-system-bz2
# Must pass release in order to properly select linker
mozconfig_annotate 'Enable by Gentoo' --enable-release
if use pgo ; then
if ! has userpriv $FEATURES ; then
eerror "Building IceCat with USE=pgo and FEATURES=-userpriv is not supported!"
fi
fi
# Don't let user's LTO flags clash with upstream's flags
filter-flags -flto*
if use lto ; then
local show_old_compiler_warning=
if use clang ; then
# At this stage CC is adjusted and the following check will
# will work
if [[ $(clang-major-version) -lt 7 ]] ; then
show_old_compiler_warning=1
fi
# Upstream only supports lld when using clang
mozconfig_annotate "forcing ld=lld due to USE=clang and USE=lto" --enable-linker=lld
else
if [[ $(gcc-major-version) -lt 8 ]] ; then
show_old_compiler_warning=1
fi
# Bug 689358
append-cxxflags -flto
if ! use cpu_flags_x86_avx2 ; then
local _gcc_version_with_ipa_cdtor_fix="8.3"
local _current_gcc_version="$(gcc-major-version).$(gcc-minor-version)"
if ver_test "${_current_gcc_version}" -lt "${_gcc_version_with_ipa_cdtor_fix}" ; then
# due to a GCC bug, GCC will produce AVX2 instructions
# even if the CPU doesn't support AVX2, https://gcc.gnu.org/ml/gcc-patches/2018-12/msg01142.html
einfo "Disable IPA cdtor due to bug in GCC and missing AVX2 support -- triggered by USE=lto"
append-ldflags -fdisable-ipa-cdtor
else
einfo "No GCC workaround required, GCC version is already patched!"
fi
else
einfo "No GCC workaround required, system supports AVX2"
fi
# Linking only works when using ld.gold when LTO is enabled
mozconfig_annotate "forcing ld=gold due to USE=lto" --enable-linker=gold
fi
if [[ -n "${show_old_compiler_warning}" ]] ; then
# Checking compiler's major version uses CC variable. Because we allow
# user to control used compiler via USE=clang flag, we cannot use
# initial value. So this is the earliest stage where we can do this check
# because pkg_pretend is not called in the main phase function sequence
# environment saving is not guaranteed so we don't know if we will have
# correct compiler until now.
ewarn ""
ewarn "USE=lto requires up-to-date compiler (>=gcc-8 or >=clang-7)."
ewarn "You are on your own -- expect build failures. Don't file bugs using that unsupported configuration!"
ewarn ""
sleep 5
fi
mozconfig_annotate '+lto' --enable-lto=thin
if use pgo ; then
mozconfig_annotate '+pgo' MOZ_PGO=1
fi
else
# Avoid auto-magic on linker
if use clang ; then
# This is upstream's default
mozconfig_annotate "forcing ld=lld due to USE=clang" --enable-linker=lld
elif tc-ld-is-gold ; then
mozconfig_annotate "linker is set to gold" --enable-linker=gold
else
mozconfig_annotate "linker is set to bfd" --enable-linker=bfd
fi
fi
# It doesn't compile on alpha without this LDFLAGS
use alpha && append-ldflags "-Wl,--no-relax"
# Add full relro support for hardened
if use hardened ; then
append-ldflags "-Wl,-z,relro,-z,now"
mozconfig_use_enable hardened hardening
fi
# Modifications to better support ARM, bug 553364
if use cpu_flags_arm_neon ; then
mozconfig_annotate '' --with-fpu=neon
if ! tc-is-clang ; then
# thumb options aren't supported when using clang, bug 666966
mozconfig_annotate '' --with-thumb=yes
mozconfig_annotate '' --with-thumb-interwork=no
fi
fi
if [[ ${CHOST} == armv*h* ]] ; then
mozconfig_annotate '' --with-float-abi=hard
if ! use system-libvpx ; then
sed -i -e "s|softfp|hard|" \
"${S}"/media/libvpx/moz.build
fi
fi
if use bindist; then
die "USE bindist must be turned off for this package."
fi
# mozconfig_use_enable official-branding
mozconfig_use_enable debug
mozconfig_use_enable debug tests
if ! use debug ; then
mozconfig_annotate 'disabled by Gentoo' --disable-debug-symbols
else
mozconfig_annotate 'enabled by Gentoo' --enable-debug-symbols
fi
# These are enabled by default in all mozilla applications
mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --with-system-nss --with-nss-prefix="${SYSROOT}${EPREFIX}"/usr
mozconfig_annotate '' --x-includes="${SYSROOT}${EPREFIX}"/usr/include \
--x-libraries="${SYSROOT}${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate '' --prefix="${EPREFIX}"/usr
mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)
mozconfig_annotate '' --disable-crashreporter
mozconfig_annotate 'Gentoo default' --with-system-png
mozconfig_annotate '' --enable-system-ffi
mozconfig_annotate '' --disable-gconf
mozconfig_annotate '' --with-intl-api
mozconfig_annotate '' --enable-system-pixman
# Instead of the standard --build= and --host=, mozilla uses --host instead
# of --build, and --target intstead of --host.
# Note, mozilla also has --build but it does not do what you think it does.
# Set both --target and --host as mozilla uses python to guess values otherwise
mozconfig_annotate '' --target="${CHOST}"
mozconfig_annotate '' --host="${CBUILD:-${CHOST}}"
if use system-libevent ; then
mozconfig_annotate '' --with-system-libevent="${SYSROOT}${EPREFIX}"/usr
fi
if ! use x86 && [[ ${CHOST} != armv*h* ]] ; then
mozconfig_annotate '' --enable-rust-simd
fi
# use the gtk3 toolkit (the only one supported at this point)
# TODO: Will this result in automagic dependency on x11-libs/gtk+[wayland]?
if use wayland ; then
mozconfig_annotate '' --enable-default-toolkit=cairo-gtk3-wayland
else
mozconfig_annotate '' --enable-default-toolkit=cairo-gtk3
fi
mozconfig_use_enable startup-notification
mozconfig_use_enable system-sqlite
mozconfig_use_with system-av1
mozconfig_use_with system-harfbuzz
mozconfig_use_with system-harfbuzz system-graphite2
mozconfig_use_with system-icu
mozconfig_use_with system-jpeg
mozconfig_use_with system-libvpx
mozconfig_use_with system-webp
mozconfig_use_enable pulseaudio
# force the deprecated alsa sound code if pulseaudio is disabled
if use kernel_linux && ! use pulseaudio ; then
mozconfig_annotate '-pulseaudio' --enable-alsa
fi
# Disable built-in ccache support to avoid sandbox violation, #665420
# Use FEATURES=ccache instead!
mozconfig_annotate '' --without-ccache
sed -i -e 's/ccache_stats = None/return None/' \
python/mozbuild/mozbuild/controller/building.py || \
die "Failed to disable ccache stats call"
mozconfig_use_enable dbus
mozconfig_use_enable wifi necko-wifi
mozconfig_use_enable geckodriver
# enable JACK, bug 600002
mozconfig_use_enable jack
# Setup api key for location services and safebrowsing, https://bugzilla.mozilla.org/show_bug.cgi?id=1531176#c34
echo -n "${_google_api_key}" > "${S}"/google-api-key
mozconfig_annotate '' --with-google-location-service-api-keyfile="${S}/google-api-key"
mozconfig_annotate '' --with-google-safebrowsing-api-keyfile="${S}/google-api-key"
mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
# allow elfhack to work in combination with unstripped binaries
# when they would normally be larger than 2GiB.
append-ldflags "-Wl,--compress-debug-sections=zlib"
if use clang && ! use arm64; then
# https://bugzilla.mozilla.org/show_bug.cgi?id=1482204
# https://bugzilla.mozilla.org/show_bug.cgi?id=1483822
mozconfig_annotate 'elf-hack is broken when using Clang' --disable-elf-hack
fi
echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
echo "mk_add_options XARGS=/usr/bin/xargs" >> "${S}"/.mozconfig
# Finalize and report settings
mozconfig_final
mkdir -p "${S}"/third_party/rust/libloading/.deps
# workaround for funky/broken upstream configure...
SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
./mach configure || die
}
src_compile() {
local _virtx=
if use pgo ; then
_virtx=virtx
# Reset and cleanup environment variables used by GNOME/XDG
gnome2_environment_reset
addpredict /root
addpredict /etc/gconf
fi
GDK_BACKEND=x11 \
MOZ_MAKE_FLAGS="${MAKEOPTS} -O" \
SHELL="${SHELL:-${EPREFIX}/bin/bash}" \
MOZ_NOSPAM=1 \
${_virtx} \
./mach build --verbose \
|| die
}
src_install() {
cd "${BUILD_OBJ_DIR}" || die
# Pax mark xpcshell for hardened support, only used for startupcache creation.
pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
# Add our default prefs for IceCat
cp "${FILESDIR}"/gentoo-default-prefs.js-3 \
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
|| die
# set dictionary path, to use system hunspell
echo "pref(\"spellchecker.dictionary_path\", \"${EPREFIX}/usr/share/myspell\");" \
>>"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
# force the graphite pref if system-harfbuzz is enabled, since the pref cant disable it
if use system-harfbuzz ; then
echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" \
>>"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
fi
# force cairo as the canvas renderer on platforms without skia support
if [[ $(tc-endian) == "big" ]] ; then
echo "sticky_pref(\"gfx.canvas.azure.backends\",\"cairo\");" \
>>"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
echo "sticky_pref(\"gfx.content.azure.backends\",\"cairo\");" \
>>"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" || die
fi
# Augment this with hwaccel prefs
if use hwaccel ; then
cat "${FILESDIR}"/gentoo-hwaccel-prefs.js-1 >> \
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
|| die
fi
if ! use screenshot ; then
echo "pref(\"extensions.screenshots.disabled\", true);" >> \
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
|| die
fi
echo "pref(\"extensions.autoDisableScopes\", 3);" >> \
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
|| die
local plugin
use gmp-autoupdate || use eme-free || for plugin in "${GMP_PLUGIN_LIST[@]}" ; do
echo "pref(\"media.${plugin}.autoupdate\", false);" >> \
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
|| die
done
cd "${S}"
MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
DESTDIR="${D}" ./mach install || die
if use geckodriver ; then
cp "${BUILD_OBJ_DIR}"/dist/bin/geckodriver "${ED%/}"${MOZILLA_FIVE_HOME} || die
pax-mark m "${ED%/}"${MOZILLA_FIVE_HOME}/geckodriver
dosym ${MOZILLA_FIVE_HOME}/geckodriver /usr/bin/geckodriver
fi
# Install language packs
# MOZEXTENSION_TARGET="distribution/extensions" MOZ_INSTALL_L10N_XPIFILE="1" mozlinguas_src_install
local size sizes icon_path icon name
sizes="16 22 24 32 48 64 128 256"
icon_path="${S}/browser/branding/official"
icon="${PN}"
name="GNU IceCat"
# Disable built-in auto-update because we update IceCat through package manager
insinto ${MOZILLA_FIVE_HOME}/distribution/
newins "${FILESDIR}"/disable-auto-update.policy.json policies.json
# Install icons and .desktop for menu entry
for size in ${sizes} ; do
insinto "/usr/share/icons/hicolor/${size}x${size}/apps"
newins "${icon_path}/default${size}.png" "${icon}.png"
done
# Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
newicon "${icon_path}/default48.png" "${icon}.png"
# Add StartupNotify=true bug 237317
local startup_notify="false"
if use startup-notification ; then
startup_notify="true"
fi
local display_protocols="auto X11" use_wayland="false"
if use wayland ; then
display_protocols+=" Wayland"
use_wayland="true"
fi
local app_name desktop_filename display_protocol exec_command
for display_protocol in ${display_protocols} ; do
app_name="${name} on ${display_protocol}"
desktop_filename="${PN}-${display_protocol,,}.desktop"
case ${display_protocol} in
Wayland)
exec_command='icecat-wayland --name icecat-wayland'
newbin "${FILESDIR}"/icecat-wayland.sh icecat-wayland
;;
X11)
if ! use wayland ; then
# Exit loop here because there's no choice so
# we don't need wrapper/.desktop file for X11.
continue
fi
exec_command='icecat-x11 --name icecat-x11'
newbin "${FILESDIR}"/icecat-x11.sh icecat-x11
;;
*)
app_name="${name}"
desktop_filename="${PN}.desktop"
exec_command='icecat'
;;
esac
newmenu "${FILESDIR}/icon/${PN}-r1.desktop" "${desktop_filename}"
sed -i \
-e "s:@NAME@:${app_name}:" \
-e "s:@EXEC@:${exec_command}:" \
-e "s:@ICON@:${icon}:" \
-e "s:@STARTUP_NOTIFY@:${startup_notify}:" \
"${ED%/}/usr/share/applications/${desktop_filename}" || die
done
rm "${ED%/}"/usr/bin/icecat || die
newbin "${FILESDIR}"/icecat.sh icecat
local wrapper
for wrapper in \
"${ED%/}"/usr/bin/icecat \
"${ED%/}"/usr/bin/icecat-x11 \
"${ED%/}"/usr/bin/icecat-wayland \
; do
[[ ! -f "${wrapper}" ]] && continue
sed -i \
-e "s:@PREFIX@:${EPREFIX%/}/usr:" \
-e "s:@DEFAULT_WAYLAND@:${use_wayland}:" \
"${wrapper}" || die
done
# Don't install llvm-symbolizer from sys-devel/llvm package
[[ -f "${ED%/}${MOZILLA_FIVE_HOME}/llvm-symbolizer" ]] && \
rm "${ED%/}${MOZILLA_FIVE_HOME}/llvm-symbolizer"
# icecat and icecat-bin are identical
rm "${ED%/}"${MOZILLA_FIVE_HOME}/icecat-bin || die
dosym icecat ${MOZILLA_FIVE_HOME}/icecat-bin
# Required in order to use plugins and even run icecat on hardened.
pax-mark m "${ED%/}"${MOZILLA_FIVE_HOME}/{icecat,plugin-container}
}
pkg_preinst() {
gnome2_icon_savelist
# if the apulse libs are available in MOZILLA_FIVE_HOME then apulse
# doesn't need to be forced into the LD_LIBRARY_PATH
if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
einfo "APULSE found - Generating library symlinks for sound support"
local lib
pushd "${ED}"${MOZILLA_FIVE_HOME} &>/dev/null || die
for lib in ../apulse/libpulse{.so{,.0},-simple.so{,.0}} ; do
# a quickpkg rolled by hand will grab symlinks as part of the package,
# so we need to avoid creating them if they already exist.
if [[ ! -L ${lib##*/} ]] ; then
ln -s "${lib}" ${lib##*/} || die
fi
done
popd &>/dev/null || die
fi
}
pkg_postinst() {
gnome2_icon_cache_update
xdg_desktop_database_update
if ! use gmp-autoupdate; then
elog "USE='-gmp-autoupdate' has disabled the following plugins from updating or"
elog "installing into new profiles:"
local plugin
for plugin in "${GMP_PLUGIN_LIST[@]}"; do elog "\t ${plugin}" ; done
elog
fi
if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
elog "Apulse was detected at merge time on this system and so it will always be"
elog "used for sound. If you wish to use pulseaudio instead please unmerge"
elog "media-sound/apulse."
elog
fi
local show_doh_information show_normandy_information
if [[ -z "${REPLACING_VERSIONS}" ]] ; then
# New install; Tell user that DoH is disabled by default
show_doh_information=yes
show_normandy_information=yes
else
local replacing_version
for replacing_version in ${REPLACING_VERSIONS} ; do
if ver_test "${replacing_version}" -lt 68.6.0-r3 ; then
# Tell user only once about our DoH default
show_doh_information=yes
fi
if ver_test "${replacing_version}" -lt 68.6.0-r3 ; then
# Tell user only once about our Normandy default
show_normandy_information=yes
fi
done
fi
if [[ -n "${show_doh_information}" ]] ; then
elog
elog "Note regarding Trusted Recursive Resolver aka DNS-over-HTTPS (DoH):"
elog "Due to privacy concerns (encrypting DNS might be a good thing, sending all"
elog "DNS traffic to Cloudflare by default is not a good idea and applications"
elog "should respect OS configured settings), \"network.trr.mode\" was set to 5"
elog "(\"Off by choice\") by default."
elog "You can enable DNS-over-HTTPS in ${PN^}'s preferences."
fi
# bug 713782
if [[ -n "${show_normandy_information}" ]] ; then
elog
elog "Upstream operates a service named Normandy which allows Mozilla to"
elog "push changes for default settings or even install new add-ons remotely."
elog "While this can be useful to address problems like 'Armagadd-on 2.0' or"
elog "revert previous decisions to disable TLS 1.0/1.1, privacy and security"
elog "concerns prevail, which is why we have switched off the use of this"
elog "service by default."
elog
elog "To re-enable this service set"
elog
elog " app.normandy.enabled=true"
elog
elog "in about:config."
fi
}
pkg_postrm() {
gnome2_icon_cache_update
xdg_desktop_database_update
}

View File

@ -0,0 +1,922 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Ebuild is based on the Firefox ebuilds in the main repo
EAPI="7"
# Using Gentoos firefox patches as system libraries and lto are quite nice
FIREFOX_PATCHSET="firefox-78esr-patches-10.tar.xz"
LLVM_MAX_SLOT=11
PYTHON_COMPAT=( python3_{7..9} )
PYTHON_REQ_USE="ncurses,sqlite,ssl"
WANT_AUTOCONF="2.1"
VIRTUALX_REQUIRED="pgo"
inherit autotools check-reqs desktop flag-o-matic gnome2-utils llvm \
multiprocessing pax-utils python-any-r1 toolchain-funcs \
virtualx xdg
PATCH_URIS=(
https://dev.gentoo.org/~{axs,polynomial-c,whissi}/mozilla/patchsets/${FIREFOX_PATCHSET}
)
SRC_URI="${PATCH_URIS[@]}"
DESCRIPTION="GNU IceCat Web Browser"
HOMEPAGE="https://www.gnu.org/software/gnuzilla/"
KEYWORDS="~amd64"
SLOT="0"
LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
IUSE="+clang cpu_flags_arm_neon dbus debug geckodriver
hardened hwaccel jack lto +openh264 pgo pulseaudio screencast selinux
+system-av1 +system-harfbuzz +system-icu +system-jpeg +system-libevent
+system-libvpx +system-webp wayland wifi"
REQUIRED_USE="debug? ( !system-av1 )
screencast? ( wayland )
wifi? ( dbus )"
BDEPEND="${PYTHON_DEPS}
app-arch/unzip
app-arch/zip
>=dev-util/cbindgen-0.14.3
>=net-libs/nodejs-10.21.0
virtual/pkgconfig
>=virtual/rust-1.41.0
|| (
(
sys-devel/clang:11
sys-devel/llvm:11
clang? (
=sys-devel/lld-11*
pgo? ( =sys-libs/compiler-rt-sanitizers-11*[profile] )
)
)
(
sys-devel/clang:10
sys-devel/llvm:10
clang? (
=sys-devel/lld-10*
pgo? ( =sys-libs/compiler-rt-sanitizers-10*[profile] )
)
)
(
sys-devel/clang:9
sys-devel/llvm:9
clang? (
=sys-devel/lld-9*
pgo? ( =sys-libs/compiler-rt-sanitizers-9*[profile] )
)
)
)
lto? (
!clang? ( sys-devel/binutils[gold] )
)
amd64? ( >=dev-lang/yasm-1.1 )
x86? ( >=dev-lang/yasm-1.1 )
!system-av1? (
amd64? ( >=dev-lang/nasm-2.13 )
x86? ( >=dev-lang/nasm-2.13 )
)"
CDEPEND="
>=dev-libs/nss-3.53.1
>=dev-libs/nspr-4.25
dev-libs/atk
dev-libs/expat
>=x11-libs/cairo-1.10[X]
>=x11-libs/gtk+-2.18:2
>=x11-libs/gtk+-3.4.0:3[X]
x11-libs/gdk-pixbuf
>=x11-libs/pango-1.22.0
>=media-libs/libpng-1.6.35:0=[apng]
>=media-libs/mesa-10.2:*
media-libs/fontconfig
>=media-libs/freetype-2.4.10
kernel_linux? ( !pulseaudio? ( media-libs/alsa-lib ) )
virtual/freedesktop-icon-theme
>=x11-libs/pixman-0.19.2
>=dev-libs/glib-2.26:2
>=sys-libs/zlib-1.2.3
>=dev-libs/libffi-3.0.10:=
media-video/ffmpeg
x11-libs/libX11
x11-libs/libXcomposite
x11-libs/libXdamage
x11-libs/libXext
x11-libs/libXfixes
x11-libs/libXrender
x11-libs/libXt
dbus? (
sys-apps/dbus
dev-libs/dbus-glib
)
screencast? ( media-video/pipewire:0/0.3 )
system-av1? (
>=media-libs/dav1d-0.3.0:=
>=media-libs/libaom-1.0.0:=
)
system-harfbuzz? (
>=media-libs/harfbuzz-2.6.8:0=
>=media-gfx/graphite2-1.3.13
)
system-icu? ( >=dev-libs/icu-67.1:= )
system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1 )
system-libevent? ( >=dev-libs/libevent-2.0:0=[threads] )
system-libvpx? ( >=media-libs/libvpx-1.8.2:0=[postproc] )
system-webp? ( >=media-libs/libwebp-1.1.0:0= )
wifi? (
kernel_linux? (
sys-apps/dbus
dev-libs/dbus-glib
net-misc/networkmanager
)
)
jack? ( virtual/jack )
selinux? ( sec-policy/selinux-mozilla )"
RDEPEND="${CDEPEND}
jack? ( virtual/jack )
openh264? ( media-libs/openh264:*[plugin] )
pulseaudio? (
|| (
media-sound/pulseaudio
>=media-sound/apulse-0.1.12-r4
)
)
selinux? ( sec-policy/selinux-mozilla )"
DEPEND="${CDEPEND}
pulseaudio? (
|| (
media-sound/pulseaudio
>=media-sound/apulse-0.1.12-r4[sdk]
)
)
wayland? ( >=x11-libs/gtk+-3.11:3[wayland] )
amd64? ( virtual/opengl )
x86? ( virtual/opengl )"
S="${WORKDIR}/${PN}-${PV%_*}"
llvm_check_deps() {
if ! has_version -b "sys-devel/clang:${LLVM_SLOT}" ; then
ewarn "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
return 1
fi
if use clang ; then
if ! has_version -b "=sys-devel/lld-${LLVM_SLOT}*" ; then
ewarn "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
return 1
fi
if use pgo ; then
if ! has_version -b "=sys-libs/compiler-rt-sanitizers-${LLVM_SLOT}*" ; then
ewarn "=sys-libs/compiler-rt-sanitizers-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
return 1
fi
fi
fi
einfo "Using LLVM slot ${LLVM_SLOT} to build" >&2
}
moz_clear_vendor_checksums() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${#} -ne 1 ]] ; then
die "${FUNCNAME} requires exact one argument"
fi
einfo "Clearing cargo checksums for ${1} ..."
sed -i \
-e 's/\("files":{\)[^}]*/\1/' \
"${S}"/third_party/rust/${1}/.cargo-checksum.json \
|| die
}
mozconfig_add_options_ac() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${#} -lt 2 ]] ; then
die "${FUNCNAME} requires at least two arguments"
fi
local reason=${1}
shift
local option
for option in ${@} ; do
echo "ac_add_options ${option} # ${reason}" >>${MOZCONFIG}
done
}
mozconfig_add_options_mk() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${#} -lt 2 ]] ; then
die "${FUNCNAME} requires at least two arguments"
fi
local reason=${1}
shift
local option
for option in ${@} ; do
echo "mk_add_options ${option} # ${reason}" >>${MOZCONFIG}
done
}
mozconfig_use_enable() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${#} -lt 1 ]] ; then
die "${FUNCNAME} requires at least one arguments"
fi
local flag=$(use_enable "${@}")
mozconfig_add_options_ac "$(use ${1} && echo +${1} || echo -${1})" "${flag}"
}
mozconfig_use_with() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${#} -lt 1 ]] ; then
die "${FUNCNAME} requires at least one arguments"
fi
local flag=$(use_with "${@}")
mozconfig_add_options_ac "$(use ${1} && echo +${1} || echo -${1})" "${flag}"
}
pkg_pretend() {
if [[ ${MERGE_TYPE} != binary ]] ; then
if use pgo ; then
if ! has usersandbox $FEATURES ; then
die "You must enable usersandbox as X server can not run as root!"
fi
fi
# Ensure we have enough disk space to compile
if use pgo || use lto || use debug ; then
CHECKREQS_DISK_BUILD="13500M"
else
CHECKREQS_DISK_BUILD="6400M"
fi
check-reqs_pkg_pretend
fi
}
pkg_setup() {
if [[ ${MERGE_TYPE} != binary ]] ; then
if use pgo ; then
if ! has userpriv ${FEATURES} ; then
eerror "Building ${PN} with USE=pgo and FEATURES=-userpriv is not supported!"
fi
fi
# Ensure we have enough disk space to compile
if use pgo || use lto || use debug ; then
CHECKREQS_DISK_BUILD="13500M"
else
CHECKREQS_DISK_BUILD="6400M"
fi
check-reqs_pkg_setup
llvm_pkg_setup
if use clang && use lto ; then
local version_lld=$(ld.lld --version 2>/dev/null | awk '{ print $2 }')
[[ -n ${version_lld} ]] && version_lld=$(ver_cut 1 "${version_lld}")
[[ -z ${version_lld} ]] && die "Failed to read ld.lld version!"
# temp fix for https://bugs.gentoo.org/768543
# we can assume that rust 1.{49,50}.0 always uses llvm 11
local version_rust=$(rustc -Vv 2>/dev/null | grep -F -- 'release:' | awk '{ print $2 }')
[[ -n ${version_rust} ]] && version_rust=$(ver_cut 1-2 "${version_rust}")
[[ -z ${version_rust} ]] && die "Failed to read version from rustc!"
if ver_test "${version_rust}" -ge "1.49" && ver_test "${version_rust}" -le "1.50" ; then
local version_llvm_rust="11"
else
local version_llvm_rust=$(rustc -Vv 2>/dev/null | grep -F -- 'LLVM version:' | awk '{ print $3 }')
[[ -n ${version_llvm_rust} ]] && version_llvm_rust=$(ver_cut 1 "${version_llvm_rust}")
[[ -z ${version_llvm_rust} ]] && die "Failed to read used LLVM version from rustc!"
fi
if ver_test "${version_lld}" -ne "${version_llvm_rust}" ; then
eerror "Rust is using LLVM version ${version_llvm_rust} but ld.lld version belongs to LLVM version ${version_lld}."
eerror "You will be unable to link ${CATEGORY}/${PN}. To proceed you have the following options:"
eerror " - Manually switch rust version using 'eselect rust' to match used LLVM version"
eerror " - Switch to dev-lang/rust[system-llvm] which will guarantee matching version"
eerror " - Build ${CATEGORY}/${PN} without USE=lto"
die "LLVM version used by Rust (${version_llvm_rust}) does not match with ld.lld version (${version_lld})!"
fi
fi
python-any-r1_pkg_setup
# Avoid PGO profiling problems due to enviroment leakage
# These should *always* be cleaned up anyway
unset \
DBUS_SESSION_BUS_ADDRESS \
DISPLAY \
ORBIT_SOCKETDIR \
SESSION_MANAGER \
XAUTHORITY \
XDG_CACHE_HOME \
XDG_SESSION_COOKIE
# Build system is using /proc/self/oom_score_adj, bug #604394
addpredict /proc/self/oom_score_adj
if ! mountpoint -q /dev/shm ; then
# If /dev/shm is not available, configure is known to fail with
# a traceback report referencing /usr/lib/pythonN.N/multiprocessing/synchronize.py
ewarn "/dev/shm is not mounted -- expect build failures!"
fi
# Ensure we use C locale when building, bug #746215
export LC_ALL=C
fi
}
src_unpack() {
unpack /usr/share/makeicecat-"${PV}"/output/icecat-"${PV}"-gnu1.tar.bz2 || eerror "Tarball missing, check www-client/makeicecat is correct"
unpack "${FIREFOX_PATCHSET}"
}
src_prepare() {
use lto && rm -v "${WORKDIR}"/firefox-patches/*-LTO-Only-enable-LTO-*.patch
eapply "${WORKDIR}/firefox-patches"
# Allow user to apply any additional patches without modifing ebuild
eapply_user
# Make LTO respect MAKEOPTS
sed -i \
-e "s/multiprocessing.cpu_count()/$(makeopts_jobs)/" \
"${S}"/build/moz.configure/lto-pgo.configure \
|| die "sed failed to set num_cores"
# Make ICU respect MAKEOPTS
sed -i \
-e "s/multiprocessing.cpu_count()/$(makeopts_jobs)/" \
"${S}"/intl/icu_sources_data.py \
|| die "sed failed to set num_cores"
# sed-in toolchain prefix
sed -i \
-e "s/objdump/${CHOST}-objdump/" \
"${S}"/python/mozbuild/mozbuild/configure/check_debug_ranges.py \
|| die "sed failed to set toolchain prefix"
sed -i \
-e 's/ccache_stats = None/return None/' \
"${S}"/python/mozbuild/mozbuild/controller/building.py \
|| die "sed failed to disable ccache stats call"
einfo "Removing pre-built binaries ..."
find "${S}"/third_party -type f \( -name '*.so' -o -name '*.o' \) -print -delete || die
# Clearing checksums where we have applied patches
moz_clear_vendor_checksums target-lexicon-0.9.0
# Create build dir
BUILD_DIR="${WORKDIR}/${PN}_build"
mkdir -p "${BUILD_DIR}" || die
xdg_src_prepare
}
src_configure() {
# Show flags set at the beginning
einfo "Current BINDGEN_CFLAGS:\t${BINDGEN_CFLAGS:-no value set}"
einfo "Current CFLAGS:\t\t${CFLAGS:-no value set}"
einfo "Current CXXFLAGS:\t\t${CXXFLAGS:-no value set}"
einfo "Current LDFLAGS:\t\t${LDFLAGS:-no value set}"
einfo "Current RUSTFLAGS:\t\t${RUSTFLAGS:-no value set}"
local have_switched_compiler=
if use clang && ! tc-is-clang ; then
# Force clang
einfo "Enforcing the use of clang due to USE=clang ..."
have_switched_compiler=yes
AR=llvm-ar
CC=${CHOST}-clang
CXX=${CHOST}-clang++
NM=llvm-nm
RANLIB=llvm-ranlib
elif ! use clang && ! tc-is-gcc ; then
# Force gcc
have_switched_compiler=yes
einfo "Enforcing the use of gcc due to USE=-clang ..."
AR=gcc-ar
CC=${CHOST}-gcc
CXX=${CHOST}-g++
NM=gcc-nm
RANLIB=gcc-ranlib
fi
if [[ -n "${have_switched_compiler}" ]] ; then
# Because we switched active compiler we have to ensure
# that no unsupported flags are set
strip-unsupported-flags
fi
# Ensure we use correct toolchain
export HOST_CC="$(tc-getBUILD_CC)"
export HOST_CXX="$(tc-getBUILD_CXX)"
tc-export CC CXX LD AR NM OBJDUMP RANLIB PKG_CONFIG
# Pass the correct toolchain paths through cbindgen
if tc-is-cross-compiler ; then
export BINDGEN_CFLAGS="${SYSROOT:+--sysroot=${ESYSROOT}} --target=${CHOST} ${BINDGEN_CFLAGS-}"
fi
# Set MOZILLA_FIVE_HOME
export MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}"
# python/mach/mach/mixin/process.py fails to detect SHELL
export SHELL="${EPREFIX}/bin/bash"
# Set MOZCONFIG
export MOZCONFIG="${S}/.mozconfig"
# Initialize MOZCONFIG
mozconfig_add_options_ac '' --enable-application=browser
# Set Gentoo defaults
#export MOZILLA_OFFICIAL=1
mozconfig_add_options_ac 'Gentoo default' \
--allow-addon-sideload \
--disable-cargo-incremental \
--disable-crashreporter \
--disable-install-strip \
--disable-strip \
--disable-updater \
--enable-official-branding \
--enable-release \
--enable-system-ffi \
--enable-system-pixman \
--host="${CBUILD:-${CHOST}}" \
--libdir="${EPREFIX}/usr/$(get_libdir)" \
--prefix="${EPREFIX}/usr" \
--target="${CHOST}" \
--without-ccache \
--with-intl-api \
--with-libclang-path="$(llvm-config --libdir)" \
--with-system-nspr \
--with-system-nss \
--with-system-png \
--with-system-zlib \
--with-toolchain-prefix="${CHOST}-" \
--with-unsigned-addon-scopes=app,system \
--x-includes="${SYSROOT}${EPREFIX}/usr/include" \
--x-libraries="${SYSROOT}${EPREFIX}/usr/$(get_libdir)"
if ! use x86 && [[ ${CHOST} != armv*h* ]] ; then
mozconfig_add_options_ac '' --enable-rust-simd
fi
mozconfig_use_with system-av1
mozconfig_use_with system-harfbuzz
mozconfig_use_with system-harfbuzz system-graphite2
mozconfig_use_with system-icu
mozconfig_use_with system-jpeg
mozconfig_use_with system-libevent system-libevent "${SYSROOT}${EPREFIX}/usr"
mozconfig_use_with system-libvpx
mozconfig_use_with system-webp
mozconfig_use_enable dbus
mozconfig_use_enable geckodriver
if use hardened ; then
mozconfig_add_options_ac "+hardened" --enable-hardening
append-ldflags "-Wl,-z,relro -Wl,-z,now"
fi
mozconfig_use_enable jack
mozconfig_use_enable pulseaudio
# force the deprecated alsa sound code if pulseaudio is disabled
if use kernel_linux && ! use pulseaudio ; then
mozconfig_add_options_ac '-pulseaudio' --enable-alsa
fi
mozconfig_use_enable screencast pipewire
mozconfig_use_enable wifi necko-wifi
if use wayland ; then
mozconfig_add_options_ac '+wayland' --enable-default-toolkit=cairo-gtk3-wayland
else
mozconfig_add_options_ac '' --enable-default-toolkit=cairo-gtk3
fi
if use lto ; then
if use clang ; then
# Upstream only supports lld when using clang
mozconfig_add_options_ac "forcing ld=lld due to USE=clang and USE=lto" --enable-linker=lld
mozconfig_add_options_ac '+lto' --enable-lto=cross
else
# Linking only works when using ld.gold when LTO is enabled
mozconfig_add_options_ac "forcing ld=gold due to USE=lto" --enable-linker=gold
# ThinLTO is currently broken, see bmo#1644409
mozconfig_add_options_ac '+lto' --enable-lto=full
fi
if use pgo ; then
mozconfig_add_options_ac '+pgo' MOZ_PGO=1
if use clang ; then
# Used in build/pgo/profileserver.py
export LLVM_PROFDATA="llvm-profdata"
fi
fi
else
# Avoid auto-magic on linker
if use clang ; then
# This is upstream's default
mozconfig_add_options_ac "forcing ld=lld due to USE=clang" --enable-linker=lld
elif tc-ld-is-gold ; then
mozconfig_add_options_ac "linker is set to gold" --enable-linker=gold
else
mozconfig_add_options_ac "linker is set to bfd" --enable-linker=bfd
fi
fi
# LTO flag was handled via configure
filter-flags '-flto*'
mozconfig_use_enable debug
if use debug ; then
mozconfig_add_options_ac '+debug' --disable-optimize
else
if is-flag '-g*' ; then
if use clang ; then
mozconfig_add_options_ac 'from CFLAGS' --enable-debug-symbols=$(get-flag '-g*')
else
mozconfig_add_options_ac 'from CFLAGS' --enable-debug-symbols
fi
else
mozconfig_add_options_ac 'Gentoo default' --disable-debug-symbols
fi
if is-flag '-O0' ; then
mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O0
elif is-flag '-O4' ; then
mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O4
elif is-flag '-O3' ; then
mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O3
elif is-flag '-O1' ; then
mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O1
elif is-flag '-Os' ; then
mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-Os
else
mozconfig_add_options_ac "Gentoo default" --enable-optimize=-O2
fi
fi
# Debug flag was handled via configure
filter-flags '-g*'
# Optimization flag was handled via configure
filter-flags '-O*'
# Modifications to better support ARM, bug #553364
if use cpu_flags_arm_neon ; then
mozconfig_add_options_ac '+cpu_flags_arm_neon' --with-fpu=neon
if ! tc-is-clang ; then
# thumb options aren't supported when using clang, bug 666966
mozconfig_add_options_ac '+cpu_flags_arm_neon' \
--with-thumb=yes \
--with-thumb-interwork=no
fi
fi
if [[ ${CHOST} == armv*h* ]] ; then
mozconfig_add_options_ac 'CHOST=armv*h*' --with-float-abi=hard
if ! use system-libvpx ; then
sed -i \
-e "s|softfp|hard|" \
"${S}"/media/libvpx/moz.build \
|| die
fi
fi
if use clang ; then
# https://bugzilla.mozilla.org/show_bug.cgi?id=1482204
# https://bugzilla.mozilla.org/show_bug.cgi?id=1483822
# toolkit/moz.configure Elfhack section: target.cpu in ('arm', 'x86', 'x86_64')
local disable_elf_hack=
if use amd64 ; then
disable_elf_hack=yes
elif use x86 ; then
disable_elf_hack=yes
elif use arm ; then
disable_elf_hack=yes
fi
if [[ -n ${disable_elf_hack} ]] ; then
mozconfig_add_options_ac 'elf-hack is broken when using Clang' --disable-elf-hack
fi
elif tc-is-gcc ; then
if ver_test $(gcc-fullversion) -ge 10 ; then
einfo "Forcing -fno-tree-loop-vectorize to workaround GCC bug, see bug 758446 ..."
append-cxxflags -fno-tree-loop-vectorize
fi
fi
# Additional ARCH support
case "${ARCH}" in
arm)
# Reduce the memory requirements for linking
if use clang ; then
# Nothing to do
:;
elif tc-ld-is-gold || use lto ; then
append-ldflags -Wl,--no-keep-memory
else
append-ldflags -Wl,--no-keep-memory -Wl,--reduce-memory-overheads
fi
;;
esac
if ! use elibc_glibc ; then
mozconfig_add_options_ac '!elibc_glibc' --disable-jemalloc
fi
# Allow elfhack to work in combination with unstripped binaries
# when they would normally be larger than 2GiB.
append-ldflags "-Wl,--compress-debug-sections=zlib"
# Make revdep-rebuild.sh happy; Also required for musl
append-ldflags -Wl,-rpath="${MOZILLA_FIVE_HOME}",--enable-new-dtags
# Pass $MAKEOPTS to build system
export MOZ_MAKE_FLAGS="${MAKEOPTS}"
# Use system's Python environment
export MACH_USE_SYSTEM_PYTHON=1
# Disable notification when build system has finished
export MOZ_NOSPAM=1
# Build system requires xargs but is unable to find it
mozconfig_add_options_mk 'Gentoo default' "XARGS=${EPREFIX}/usr/bin/xargs"
# Set build dir
mozconfig_add_options_mk 'Gentoo default' "MOZ_OBJDIR=${BUILD_DIR}"
# Show flags we will use
einfo "Build BINDGEN_CFLAGS:\t${BINDGEN_CFLAGS:-no value set}"
einfo "Build CFLAGS:\t\t${CFLAGS:-no value set}"
einfo "Build CXXFLAGS:\t\t${CXXFLAGS:-no value set}"
einfo "Build LDFLAGS:\t\t${LDFLAGS:-no value set}"
einfo "Build RUSTFLAGS:\t\t${RUSTFLAGS:-no value set}"
# Handle EXTRA_CONF and show summary
local ac opt hash reason
# Apply EXTRA_ECONF entries to $MOZCONFIG
if [[ -n ${EXTRA_ECONF} ]] ; then
IFS=\! read -a ac <<<${EXTRA_ECONF// --/\!}
for opt in "${ac[@]}"; do
mozconfig_add_options_ac "EXTRA_ECONF" --${opt#--}
done
fi
echo
echo "=========================================================="
echo "Building ${PF} with the following configuration"
grep ^ac_add_options "${MOZCONFIG}" | while read ac opt hash reason; do
[[ -z ${hash} || ${hash} == \# ]] \
|| die "error reading mozconfig: ${ac} ${opt} ${hash} ${reason}"
printf " %-30s %s\n" "${opt}" "${reason:-mozilla.org default}"
done
echo "=========================================================="
echo
./mach configure || die
}
src_compile() {
local virtx_cmd=
if use pgo ; then
virtx_cmd=virtx
# Reset and cleanup environment variables used by GNOME/XDG
gnome2_environment_reset
addpredict /root
fi
local -x GDK_BACKEND=x11
${virtx_cmd} ./mach build --verbose \
|| die
}
src_install() {
# xpcshell is getting called during install
pax-mark m \
"${BUILD_DIR}"/dist/bin/xpcshell \
"${BUILD_DIR}"/dist/bin/${PN} \
"${BUILD_DIR}"/dist/bin/plugin-container
DESTDIR="${D}" ./mach install || die
# Upstream cannot ship symlink but we can (bmo#658850)
rm "${ED}${MOZILLA_FIVE_HOME}/${PN}-bin" || die
dosym ${PN} ${MOZILLA_FIVE_HOME}/${PN}-bin
# Don't install llvm-symbolizer from sys-devel/llvm package
if [[ -f "${ED}${MOZILLA_FIVE_HOME}/llvm-symbolizer" ]] ; then
rm -v "${ED}${MOZILLA_FIVE_HOME}/llvm-symbolizer" || die
fi
# Install policy (currently only used to disable application updates)
insinto "${MOZILLA_FIVE_HOME}/distribution"
newins "${FILESDIR}"/distribution.ini distribution.ini
# Install system-wide preferences
local PREFS_DIR="${MOZILLA_FIVE_HOME}/browser/defaults/preferences"
insinto "${PREFS_DIR}"
newins "${FILESDIR}"/gentoo-default-prefs.js all-gentoo.js
local GENTOO_PREFS="${ED}${PREFS_DIR}/all-gentoo.js"
# Set dictionary path to use system hunspell
cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to set spellchecker.dictionary_path pref"
pref("spellchecker.dictionary_path", "${EPREFIX}/usr/share/myspell");
EOF
# Force hwaccel prefs if USE=hwaccel is enabled
if use hwaccel ; then
cat "${FILESDIR}"/gentoo-hwaccel-prefs.js \
>>"${GENTOO_PREFS}" \
|| die "failed to add prefs to force hardware-accelerated rendering to all-gentoo.js"
fi
# Force the graphite pref if USE=system-harfbuzz is enabled, since the pref cannot disable it
if use system-harfbuzz ; then
cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to set gfx.font_rendering.graphite.enabled pref"
sticky_pref("gfx.font_rendering.graphite.enabled", true);
EOF
fi
# Install geckodriver
if use geckodriver ; then
einfo "Installing geckodriver into ${ED}${MOZILLA_FIVE_HOME} ..."
pax-mark m "${BUILD_DIR}"/dist/bin/geckodriver
exeinto "${MOZILLA_FIVE_HOME}"
doexe "${BUILD_DIR}"/dist/bin/geckodriver
dosym ${MOZILLA_FIVE_HOME}/geckodriver /usr/bin/geckodriver
fi
# Install icons
local icon_srcdir="${S}/browser/branding/official"
local icon_symbolic_file="${FILESDIR}/icon/"${PN}"-symbolic.svg"
insinto /usr/share/icons/hicolor/symbolic/apps
newins "${icon_symbolic_file}" "${PN}"-symbolic.svg
local icon size
for icon in "${icon_srcdir}"/default*.png ; do
size=${icon%.png}
size=${size##*/default}
if [[ ${size} -eq 48 ]] ; then
newicon "${icon}" ${PN}.png
fi
newicon -s ${size} "${icon}" ${PN}.png
done
# Install menus
local wrapper_wayland="${PN}-wayland.sh"
local wrapper_x11="${PN}-x11.sh"
local desktop_file="${FILESDIR}/icon/${PN}-r2.desktop"
local display_protocols="auto X11"
local icon="${PN}"
local name="GNU IceCat"
local use_wayland="false"
if use wayland ; then
display_protocols+=" Wayland"
use_wayland="true"
fi
local app_name desktop_filename display_protocol exec_command
for display_protocol in ${display_protocols} ; do
app_name="${name} on ${display_protocol}"
desktop_filename="${PN}-${display_protocol,,}.desktop"
case ${display_protocol} in
Wayland)
exec_command="${PN}-wayland --name ${PN}-wayland"
newbin "${FILESDIR}/${wrapper_wayland}" ${PN}-wayland
;;
X11)
if ! use wayland ; then
# Exit loop here because there's no choice so
# we don't need wrapper/.desktop file for X11.
continue
fi
exec_command="${PN}-x11 --name ${PN}-x11"
newbin "${FILESDIR}/${wrapper_x11}" ${PN}-x11
;;
*)
app_name="${name}"
desktop_filename="${PN}.desktop"
exec_command="${PN}"
;;
esac
cp "${desktop_file}" "${WORKDIR}/${PN}.desktop-template" || die
sed -i \
-e "s:@NAME@:${app_name}:" \
-e "s:@EXEC@:${exec_command}:" \
-e "s:@ICON@:${icon}:" \
"${WORKDIR}/${PN}.desktop-template" \
|| die
newmenu "${WORKDIR}/${PN}.desktop-template" "${desktop_filename}"
rm "${WORKDIR}/${PN}.desktop-template" || die
done
# Install generic wrapper script
[[ -f "${ED}/usr/bin/${PN}" ]] && rm "${ED}/usr/bin/${PN}"
newbin "${FILESDIR}/${PN}.sh" ${PN}
# Update wrapper
local wrapper
for wrapper in \
"${ED}/usr/bin/${PN}" \
"${ED}/usr/bin/${PN}-x11" \
"${ED}/usr/bin/${PN}-wayland" \
; do
[[ ! -f "${wrapper}" ]] && continue
sed -i \
-e "s:@PREFIX@:${EPREFIX}/usr:" \
-e "s:@MOZ_FIVE_HOME@:${MOZILLA_FIVE_HOME}:" \
-e "s:@APULSELIB_DIR@:${apulselib}:" \
-e "s:@DEFAULT_WAYLAND@:${use_wayland}:" \
"${wrapper}" \
|| die
done
}
pkg_preinst() {
xdg_pkg_preinst
# If the apulse libs are available in MOZILLA_FIVE_HOME then apulse
# does not need to be forced into the LD_LIBRARY_PATH
if use pulseaudio && has_version ">=media-sound/apulse-0.1.12-r4" ; then
einfo "APULSE found; Generating library symlinks for sound support ..."
local lib
pushd "${ED}${MOZILLA_FIVE_HOME}" &>/dev/null || die
for lib in ../apulse/libpulse{.so{,.0},-simple.so{,.0}} ; do
# A quickpkg rolled by hand will grab symlinks as part of the package,
# so we need to avoid creating them if they already exist.
if [[ ! -L ${lib##*/} ]] ; then
ln -s "${lib}" ${lib##*/} || die
fi
done
popd &>/dev/null || die
fi
}
pkg_postinst() {
xdg_pkg_postinst
if use pulseaudio && has_version ">=media-sound/apulse-0.1.12-r4" ; then
elog "Apulse was detected at merge time on this system and so it will always be"
elog "used for sound. If you wish to use pulseaudio instead please unmerge"
elog "media-sound/apulse."
elog
fi
}

View File

@ -1,20 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata> <pkgmetadata>
<maintainer type="project">
<email>mozilla@gentoo.org</email>
<name>Gentoo Mozilla Team</name>
</maintainer>
<use> <use>
<flag name="amd64">You should not be able to see this</flag>
<flag name="clang">Use Clang compiler instead of GCC</flag> <flag name="clang">Use Clang compiler instead of GCC</flag>
<flag name="custom-optimization">Build with user-specified compiler optimizations
(-Os, -O0, -O1, -O2, -O3) from CFLAGS (unsupported)</flag>
<flag name="geckodriver">Enable WebDriver support</flag> <flag name="geckodriver">Enable WebDriver support</flag>
<flag name="gmp-autoupdate">Allow Gecko Media Plugins (binary blobs) to be automatically
downloaded and kept up-to-date in user profiles</flag>
<flag name="hwaccel">Force-enable hardware-accelerated rendering (Mozilla bug 594876)</flag> <flag name="hwaccel">Force-enable hardware-accelerated rendering (Mozilla bug 594876)</flag>
<flag name="lto">Enable Link Time Optimization (LTO). Requires Gold linker when using GCC <flag name="lto">Enable Link Time Optimization (LTO). Requires Gold linker when using GCC
or LDD linker when using Clang</flag> or LDD linker when using Clang</flag>
<flag name="openh264">Use <pkg>media-libs/openh264</pkg> for H.264 support
instead of downloading binary blob from Mozilla at runtime</flag>
<flag name="pgo">Add support for profile-guided optimization using gcc-4.5, <flag name="pgo">Add support for profile-guided optimization using gcc-4.5,
for faster binaries. This option will double the compile time.</flag> for faster binaries. This option will double the compile time.</flag>
<flag name="screenshot">Allow to disable screenshot extension in global profile</flag> <flag name="screencast">Enable support for remote desktop and screen cast using <pkg>media-video/pipewire</pkg></flag>
<flag name="system-av1">Use the system-wide <pkg>media-libs/dav1d</pkg> <flag name="system-av1">Use the system-wide <pkg>media-libs/dav1d</pkg>
and <pkg>media-libs/libaom</pkg> library instead of bundled.</flag> and <pkg>media-libs/libaom</pkg> library instead of bundled.</flag>
<flag name="system-harfbuzz">Use the system-wide <pkg>media-libs/harfbuzz</pkg> <flag name="system-harfbuzz">Use the system-wide <pkg>media-libs/harfbuzz</pkg>
@ -27,12 +28,7 @@
instead of bundled.</flag> instead of bundled.</flag>
<flag name="system-libvpx">Use the system-wide <pkg>media-libs/libvpx</pkg> <flag name="system-libvpx">Use the system-wide <pkg>media-libs/libvpx</pkg>
instead of bundled.</flag> instead of bundled.</flag>
<flag name="system-sqlite">Use the system-wide <pkg>dev-db/sqlite</pkg>
installation with secure-delete enabled</flag>
<flag name="system-webp">Use the system-wide <pkg>media-libs/libwebp</pkg> <flag name="system-webp">Use the system-wide <pkg>media-libs/libwebp</pkg>
instead of bundled.</flag> instead of bundled.</flag>
<flag name="x86">You should not be able to see this</flag>
</use> </use>
</pkgmetadata> </pkgmetadata>