diff options
Diffstat (limited to 'libre/icecat/PKGBUILD')
-rw-r--r-- | libre/icecat/PKGBUILD | 280 |
1 files changed, 167 insertions, 113 deletions
diff --git a/libre/icecat/PKGBUILD b/libre/icecat/PKGBUILD index 76e8bd32a..251649162 100644 --- a/libre/icecat/PKGBUILD +++ b/libre/icecat/PKGBUILD @@ -17,11 +17,13 @@ # it is a WIP, based on an untested, pre-release source-ball # which is published only for the sake of those who want to help +# needed for the !(...) matching in prepare() +shopt -s extglob pkgname=icecat _upstream_ver=78.4.0-gnu1 pkgver=${_upstream_ver//-/_} -pkgrel=3 +pkgrel=3.2 pkgdesc="GNU IceCat - a libre standalone web browser based on Mozilla Firefox ESR" arch=(x86_64 i686 armv7h) license=(MPL GPL LGPL) @@ -30,163 +32,210 @@ depends=(gtk3 libxt mime-types dbus-glib ffmpeg nss ttf-font libpulse) makedepends=(unzip zip diffutils yasm mesa imake inetutils xorg-server-xvfb autoconf2.13 rust clang llvm jack gtk2 nodejs cbindgen nasm python-setuptools python-psutil lld) +makedepends+=(mozilla-searchplugins jq) optdepends=('networkmanager: Location detection via available WiFi networks' 'libnotify: Notification integration' 'pulseaudio: Audio support' 'speech-dispatcher: Text-to-Speech' 'hunspell-en_US: Spell checking, American English') -options=(!emptydirs !makeflags !debug) -# source=(http://ftp.gnu.org/gnu/gnuzilla/${_upstream_ver%-*}/${pkgname}-${_upstream_ver}.tar.bz2{,.sig} +options=(!emptydirs !makeflags !strip) source=(https://repo.parabola.nu/other/wip/${pkgname}-${_upstream_ver}-pre.tar.bz2{,.sig} - $pkgname.desktop - gnu_headshadow.png -# libre-searchengines.patch - libre.patch - mozilla-1463035.patch) -# deny_missing_docs.patch -# fix-double-definition-of-gettid.patch) -sha256sums=('6873d55b13e2d95ede3bf5bb59769179e91b1c4e05d8538d1576f18c9a6bb827' + ${pkgname}.desktop + 0001-Use-remoting-name-for-GDK-application-names.patch + rust_1.48.patch.gz) +source+=(libre.patch + mozilla-1663715.patch) +sha256sums=('314171bb68cd8b0fb7b880a77f3a2daa65acd660fc6f2a7d6871c5a5ba44be52' 'SKIP' - '2f9d117c1524312fb45f3e953cb0de02c525fd385a9b2b6d47308c8aaab0aedd' - '93e3001ce152e1d142619e215a9ef07dd429943b99d21726c25da9ceb31e31cd' - '99c279d04315c332a973a29b6ee540962364cd6d53cdaafc4055b3e1973e20da' - '65a560566db10e11bb1114805a653feaa40f4ff3775ac7e5f84d956deee2ed0a' - '6c3781e13d3e8343aa2435bdb78d2e2666891154c7abd847388e5331e0424edb' - 'cb1116c783995b8187574f84acb8365681aedaa2c76222cf060d31fedcb063c4' - '3ea006eafe4cee790955024faca3b3d7ac6cd6968b50635b9da3c254a07f4791') + 'f9f954fd06739e70a72ccf4774cfa71f349a4b133ec8f5dea0a3bcca2cf7321d' + '3bb7463471fb43b2163a705a79a13a3003d70fff4bbe44f467807ca056de9a75' + 'd32c87c4526e897d64453914da43f99366d1d0b7d71e43b4027a6cb5aa274040' + '28029afa3201e1be8138be06f741c59d64869edf0c9e90dbb05cfa6b5fff4ecd' + '665cf25255fd240f79d5d010b3c3764f2d80aa81fdc7b6e9a9728e4a7970685b') validpgpkeys=('318C679D94F17700CC847DE646A70073E4E50D4E' # Ruben Rodriguez '3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger prepare() { + mkdir -p mozbuild cd "$srcdir/$pkgname-${pkgver%_*}" -# echo "applying deny_missing_docs.patch" -# patch -Np1 -i ../deny_missing_docs.patch + # https://bugzilla.mozilla.org/show_bug.cgi?id=1530052 + patch -Np1 -i ../0001-Use-remoting-name-for-GDK-application-names.patch -# echo "applying fix-double-definition-of-gettid.patch" -# patch -Np1 -i ../fix-double-definition-of-gettid.patch + # https://bugzilla.mozilla.org/show_bug.cgi?id=1667736 + patch -Np1 -i ../rust_1.48.patch - # needed for 60.7-esr - export CXXFLAGS="$CXXFLAGS -fpermissive" + # https://bugzilla.mozilla.org/show_bug.cgi?id=1663715 + patch -Np1 -i ../mozilla-1663715.patch - # Move files directly to /usr/lib/icecat (no more symlinks) - local sed_rx='s;$(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION);$(libdir)/$(MOZ_APP_NAME);g' - sed -e "${sed_rx}" -i config/baseconfig.mk - sed_rx='s;$(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION);$(libdir)/$(MOZ_APP_NAME)-devel;g' - sed -e "${sed_rx}" -i config/baseconfig.mk - - cat >.mozconfig <<END + cat >../mozconfig <<END ac_add_options --enable-application=browser ac_add_options --prefix=/usr ac_add_options --enable-release -ac_add_options --enable-linker=gold ac_add_options --enable-hardening ac_add_options --enable-optimize -# Bug 1521249 --enable-rust-simd fails to build using Rust 1.33 -# https://bugzilla.mozilla.org/show_bug.cgi?id=1521249 -#ac_add_options --enable-rust-simd +ac_add_options --enable-rust-simd +ac_add_options --enable-linker=lld +ac_add_options --disable-elf-hack +export CC='clang --target=x86_64-unknown-linux-gnu' +export CXX='clang++ --target=x86_64-unknown-linux-gnu' +export AR=llvm-ar +export NM=llvm-nm +export RANLIB=llvm-ranlib # Branding -ac_add_options --with-app-basename=icecat -ac_add_options --with-app-name=icecat ac_add_options --enable-official-branding ac_add_options --enable-update-channel=release -ac_add_options --with-distribution-id=org.gnu +ac_add_options --with-distribution-id=nu.parabola +ac_add_options --with-unsigned-addon-scopes=app,system +ac_add_options --allow-addon-sideload +export MOZ_APP_NAME=icecat +export MOZ_APP_REMOTINGNAME=${pkgname//-/} +export MOZ_TELEMETRY_REPORTING= +export MOZ_REQUIRE_SIGNING= + +ac_add_options --with-app-basename=icecat +ac_add_options --with-app-name=icecat # System libraries -ac_add_options --enable-system-ffi -ac_add_options --enable-system-sqlite -ac_add_options --with-system-bz2 -ac_add_options --with-system-icu -ac_add_options --with-system-jpeg -# FIXME: firefox does currently not build against libvpx-1.8.0 -# ac_add_options --with-system-libvpx ac_add_options --with-system-nspr ac_add_options --with-system-nss -ac_add_options --with-system-zlib # Features ac_add_options --enable-alsa ac_add_options --enable-jack -ac_add_options --enable-startup-notification ac_add_options --disable-crashreporter -ac_add_options --disable-gconf ac_add_options --disable-updater ac_add_options --disable-eme - -# broken by rust-1.38 in esr60 -ac_add_options --disable-stylo END - if [[ $CARCH = arm* ]]; then - sed -i '/--enable-linker=gold/d' .mozconfig - sed -i '/--enable-rust-simd/d' .mozconfig - - # https://bugzilla.mozilla.org/show_bug.cgi?id=1463035 - patch -Np1 -i "$srcdir"/mozilla-1463035.patch - - cat >> .mozconfig <<END -ac_add_options --enable-optimize="-g -O2 -fno-schedule-insns" -ac_add_options --disable-elf-hack -ac_add_options --disable-webrtc -ac_add_options --disable-av1 -END - fi - - if [[ $CARCH = i686 ]]; then - sed -i '/--enable-linker=gold/d' .mozconfig - fi +# if [[ $CARCH = arm* ]]; then +# sed -i '/--enable-linker=gold/d' .mozconfig +# sed -i '/--enable-rust-simd/d' .mozconfig +# +# # https://bugzilla.mozilla.org/show_bug.cgi?id=1463035 +# patch -Np1 -i "$srcdir"/mozilla-1463035.patch +# +# cat >> .mozconfig <<END +#ac_add_options --enable-optimize="-g -O2 -fno-schedule-insns" +#ac_add_options --disable-elf-hack +#ac_add_options --disable-webrtc +#ac_add_options --disable-av1 +#END +# fi +# +# if [[ $CARCH = i686 ]]; then +# sed -i '/--enable-linker=gold/d' .mozconfig +# fi + + # install our searchengines + locales=( $(jq ".locales|keys|.[]" < browser/components/search/extensions/list.json) ) + rm -rv browser/components/search/extensions/!(wikipedia) + cp -rv /usr/share/mozilla/searchplugins/* browser/components/search/extensions/ + cat > browser/components/search/extensions/list.json << EOF +{ + "default": { + "visibleDefaultEngines": [ + "duckduckgo-html", "duckduckgo-lite", "internet-archive", "parabola-packages", "parabola-wiki", "searx", "wikipedia", "yacy" + ] + }, + "regionOverrides": { + }, + "locales": { +EOF + + comma="," + for locale in "${locales[@]}"; do + [ "$locale" != "${locales[-1]}" ] || comma="" + cat >> browser/components/search/extensions/list.json << EOF + $locale: { + "default": { + "visibleDefaultEngines": [ + "duckduckgo-html", "duckduckgo-lite", "internet-archive", "parabola-packages", "parabola-wiki", "searx", "wikipedia", "yacy" + ] + } + }$comma +EOF + done - # Put gnu_headshadow.png in the source code - install -m644 "$srcdir/gnu_headshadow.png" \ - browser/base/content/abouthome + cat >> browser/components/search/extensions/list.json << EOF + } +} +EOF + # quick syntax check + jq < browser/components/search/extensions/list.json # Patch and remove anything that's left patch -Np1 -i "$srcdir/libre.patch" - - # rm -v browser/base/content/abouthome/snippet*.png || true - # sed -i '\|abouthome/snippet|d - # ' browser/base/jar.mn - - # Load our searchplugins - rm -r -- browser/locales/searchplugins - cp -aT -- /usr/lib/mozilla/searchplugins browser/locales/searchplugins - patch -Np1 -i "$srcdir/libre-searchengines.patch" } build() { cd "$srcdir/$pkgname-${pkgver%_*}" + export MOZ_NOSPAM=1 export MOZBUILD_STATE_PATH="$srcdir/mozbuild" - if [[ $CARCH = armv7h ]]; then - export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off" - export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" - fi - - if [[ $CARCH = i686 ]]; then - export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off" - export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" - fi +# if [[ $CARCH = armv7h ]]; then +# export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off" +# export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +# fi +# +# if [[ $CARCH = i686 ]]; then +# export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off" +# export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +# fi # LTO needs more open files ulimit -n 4096 + # -fno-plt with cross-LTO causes obscure LLVM errors + # LLVM ERROR: Function Import: link error + CFLAGS="${CFLAGS/-fno-plt/}" + CXXFLAGS="${CXXFLAGS/-fno-plt/}" + + # Do 3-tier PGO + echo "Building instrumented browser..." + cat >.mozconfig ../mozconfig - <<END +ac_add_options --enable-profile-generate=cross +END + ./mach build + + echo "Profiling instrumented browser..." + ./mach package + LLVM_PROFDATA=llvm-profdata \ + JARLOG_FILE="$PWD/jarlog" \ + xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" \ + ./mach python build/pgo/profileserver.py + + stat -c "Profile data found (%s bytes)" merged.profdata + test -s merged.profdata + + stat -c "Jar log found (%s bytes)" jarlog + test -s jarlog + + echo "Removing instrumented browser..." + ./mach clobber + + echo "Building optimized browser..." + cat >.mozconfig ../mozconfig - <<END +ac_add_options --enable-lto=cross +ac_add_options --enable-profile-use=cross +ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata +ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog +END ./mach build - ./mach buildsymbols + +# echo "Building symbol archive..." +# ./mach buildsymbols } package() { - local _icu_ver - _icu_ver=$(pacman -S --print-format='%v' icu) - depends+=("icu>=${_icu_ver}" "icu<$((${_icu_ver%%.*} + 1))") - cd "$srcdir/$pkgname-${pkgver%_*}" DESTDIR="$pkgdir" ./mach install - _vendorjs="$pkgdir/usr/lib/$pkgname/browser/defaults/preferences/vendor.js" - install -Dm644 /dev/stdin "$_vendorjs" <<END + local vendorjs="$pkgdir/usr/lib/$pkgname/browser/defaults/preferences/vendor.js" + install -Dvm644 /dev/stdin "$vendorjs" <<END // Use LANG environment variable to choose locale pref("intl.locale.requested", ""); @@ -196,7 +245,7 @@ pref("spellchecker.dictionary_path", "/usr/share/hunspell"); // Disable default browser checking. pref("browser.shell.checkDefaultBrowser", false); -// Don't disable our bundled extensions in the application directory +// Don't disable extensions in the application directory pref("extensions.autoDisableScopes", 11); pref("extensions.shownSelectionUI", true); @@ -220,8 +269,8 @@ pref("security.ssl3.rsa_rc4_128_md5", false); pref("security.ssl3.rsa_rc4_128_sha", false); END - _distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini" - install -Dm644 /dev/stdin "$_distini" <<END + local distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini" + install -Dvm644 /dev/stdin "$distini" <<END [Global] id=parabola version=1.0 @@ -233,33 +282,38 @@ app.distributor.channel=$pkgname app.partner.parabola=parabola END - install -m755 -d ${pkgdir}/usr/share/applications - install -m755 -d ${pkgdir}/usr/share/pixmaps - - for i in 16 22 24 32 48 256; do - install -Dm644 "browser/branding/official/default$i.png" \ + local i theme=official + for i in 16 22 24 32 48 64 128 256; do + install -Dvm644 browser/branding/$theme/default$i.png \ "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png" done - install -Dm644 "browser/branding/official/content/icon64.png" \ + install -Dvm644 browser/branding/$theme/content/icon64.png \ "$pkgdir/usr/share/icons/hicolor/64x64/apps/$pkgname.png" - install -Dm644 "browser/branding/official/mozicon128.png" \ + install -Dvm644 browser/branding/$theme/mozicon128.png \ "$pkgdir/usr/share/icons/hicolor/128x128/apps/$pkgname.png" - install -Dm644 "browser/branding/official/content/about-logo.png" \ + install -Dvm644 browser/branding/$theme/content/about-logo.png \ "$pkgdir/usr/share/icons/hicolor/192x192/apps/$pkgname.png" - install -Dm644 "browser/branding/official/content/about-logo@2x.png" \ + install -Dvm644 browser/branding/$theme/content/about-logo@2x.png \ "$pkgdir/usr/share/icons/hicolor/384x384/apps/$pkgname.png" + install -Dvm644 browser/branding/$theme/content/identity-icons-brand.svg \ + "$pkgdir/usr/share/icons/hicolor/symbolic/apps/$pkgname-symbolic.svg" - install -Dm644 ../$pkgname.desktop \ + install -Dvm644 ../$pkgname.desktop \ "$pkgdir/usr/share/applications/$pkgname.desktop" # Install a wrapper to avoid confusion about binary path - install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END + install -Dvm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END #!/bin/sh exec /usr/lib/$pkgname/$pkgname "\$@" END # Replace duplicate binary with wrapper # https://bugzilla.mozilla.org/show_bug.cgi?id=658850 - ln -srf "$pkgdir/usr/bin/$pkgname" \ - "$pkgdir/usr/lib/$pkgname/$pkgname-bin" + ln -srfv "$pkgdir/usr/bin/$pkgname" "$pkgdir/usr/lib/$pkgname/$pkgname-bin" + + # Use system certificates + local nssckbi="$pkgdir/usr/lib/$pkgname/libnssckbi.so" + if [[ -e $nssckbi ]]; then + ln -srfv "$pkgdir/usr/lib/libnssckbi.so" "$nssckbi" + fi } |