summaryrefslogtreecommitdiff
path: root/libre/iceweasel/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'libre/iceweasel/PKGBUILD')
-rw-r--r--libre/iceweasel/PKGBUILD212
1 files changed, 116 insertions, 96 deletions
diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD
index fecf3d823..88c99a7ba 100644
--- a/libre/iceweasel/PKGBUILD
+++ b/libre/iceweasel/PKGBUILD
@@ -33,7 +33,6 @@
# - Remove Google API keys and usage
# - Disable Mozilla telemetry and crash reporting (good manners
# because of all of the other patching we're doing
-# - keep using a bunch of system libs
#
# [1]: https://www.mozilla.org/en-US/foundation/trademarks/policy/
@@ -41,18 +40,18 @@
pkgname=iceweasel
replaces=('firefox')
epoch=1
-pkgver=69.0
+pkgver=70.0.1
pkgrel=1
pkgrel+=.parabola1
-_brandingver=69.0
+_brandingver=70.0
_brandingrel=1
-pkgdesc="Libre standalone web browser based on Mozilla Firefox"
+pkgdesc="Standalone web browser based on Mozilla Firefox"
arch=(x86_64)
arch+=(i686 armv7h)
license=(MPL GPL LGPL)
url="https://wiki.parabola.nu/$pkgname"
-depends=(gtk3 mozilla-common libxt startup-notification mime-types dbus-glib
- ffmpeg nss ttf-font libpulse)
+depends=(gtk3 libxt startup-notification mime-types dbus-glib ffmpeg nss
+ ttf-font libpulse)
depends+=(sqlite icu)
makedepends=(unzip zip diffutils python2-setuptools yasm mesa imake inetutils
xorg-server-xvfb autoconf2.13 rust clang llvm jack gtk2
@@ -64,37 +63,47 @@ optdepends=('networkmanager: Location detection via available WiFi networks'
'pulseaudio: Audio support'
'speech-dispatcher: Text-to-Speech'
'hunspell-en_US: Spell checking, American English')
-options=(!emptydirs !makeflags !debug)
+options=(!emptydirs !makeflags !strip)
source=(https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz{,.asc}
+ no-relinking.patch
0001-Use-remoting-name-for-GDK-application-names.patch
- $pkgname.desktop
- https://repo.parabola.nu/other/iceweasel/${pkgname}_${_brandingver}-${_brandingrel}.branding.tar.xz{,.sig}
- arm.patch
- build-arm-libopus.patch
- libre.patch
- searchengines.patch)
-sha256sums=('413c3febdfeb69eade818824eecbdb11eaeda71de229573810afd641ba741ec5'
+ $pkgname.desktop)
+source+=(https://repo.parabola.nu/other/iceweasel/${pkgname}_${_brandingver}-${_brandingrel}.branding.tar.xz{,.sig}
+ firefox-70.0-update-bindgen.patch
+ firefox-70.0-add-distro.patch
+ libre.patch
+ libre-searchengines.patch)
+sha256sums=('f2e9bb26af7682b31e82fdfc3a4b3e04fd1caa8b004469ea608185d33e35691b'
'SKIP'
+ '2dc9d1aa5eb7798c89f46478f254ae61e4122b4d1956d6044426288627d8a014'
'ab07ab26617ff76fce68e07c66b8aa9b96c2d3e5b5517e51a3c3eac2edd88894'
'e439117380218898cd5c60a8da8947847efbd0fe64cc06b129d6ca20a392cb3d'
- 'a6a3771416a51c17e22461abef38b3032c7dc991d223bc374d5bb4d3bc93e9e2'
+ 'e90956067d8549f02864d612369ed8714d7173f0ee07bbfb4374a7323b4a733e'
'SKIP'
- '2bb1f6b9b66a00f4f98eb5cdb2f25972018efe042153503cbc8c494780d7225e'
- '2d4d91f7e35d0860225084e37ec320ca6cae669f6c9c8fe7735cdbd542e3a7c9'
+ 'bde80a158f42f6afd01d9f3ce1ff9c8ecb89db96b6b7398f2acfb03436234eeb'
+ '41ab298519dfdf86e1599990cd2a2e4d939a2a1d77de829caa0593d0d2e8f0e8'
'783e1b7c2f6f8719cc8a0751aacc823a5029c2326ac0b5ff7c659d831e286387'
'dfed11d97f1d4198a3dc608be159b6b53a11054f376cdb73bb0fe9a487ae9418')
-validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353' # Mozilla Software Releases
- '3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger
+validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Releases <release@mozilla.com>
+validpgpkeys+=('BFA8008A8265677063B11BF47171986E4B745536') # Andreas Grapentin
prepare() {
- [[ -d mozbuild ]] && rm -rf mozbuild
+ mkdir mozbuild
cd firefox-$pkgver
+ # Avoid relinking during buildsymbols
+ patch -Np1 -i ../no-relinking.patch
+
# https://bugzilla.mozilla.org/show_bug.cgi?id=1530052
patch -Np1 -i ../0001-Use-remoting-name-for-GDK-application-names.patch
- ## build configuration
- cat >.mozconfig <<END
+ # https://bugzilla.mozilla.org/show_bug.cgi?id=1583471
+ patch -Np1 -i ../firefox-70.0-update-bindgen.patch
+
+ # https://bugzilla.mozilla.org/show_bug.cgi?id=1212502
+ patch -Np1 -i ../firefox-70.0-add-distro.patch
+
+ cat >../mozconfig <<END
ac_add_options --enable-application=browser
ac_add_options --prefix=/usr
@@ -102,10 +111,8 @@ ac_add_options --enable-release
ac_add_options --enable-hardening
ac_add_options --enable-optimize
ac_add_options --enable-rust-simd
-ac_add_options --enable-lto
-export MOZ_PGO=1
-export CC=clang
-export CXX=clang++
+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
@@ -115,21 +122,14 @@ ac_add_options --disable-official-branding
ac_add_options --with-branding=browser/branding/iceweasel
ac_add_options --enable-update-channel=release
ac_add_options --with-distribution-id=nu.parabola
+ac_add_options --with-unsigned-addon-scopes=app,system
export MOZ_APP_REMOTINGNAME=${pkgname//-/}
export MOZ_TELEMETRY_REPORTING=
export MOZ_REQUIRE_SIGNING=
# 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: does not build against libvpx-1.8.0 or 1.8.1 - disable --with-system-libvpx
-# 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
@@ -139,50 +139,16 @@ ac_add_options --disable-crashreporter
ac_add_options --disable-gconf
ac_add_options --disable-updater
ac_add_options --disable-tests
-ac_add_options --disable-eme
END
if [[ $CARCH = arm* ]]; then
- sed -i '/--enable-hardening/d' .mozconfig
- sed -i '/--enable-optimize/d' .mozconfig
- sed -i '/--enable-rust-simd/d' .mozconfig
- sed -i '/--enable-lto/d' .mozconfig
- sed -i '/export MOZ_PGO/d' .mozconfig
- sed -i '/--disable-eme/d' .mozconfig
-
- patch -Np1 -i ../arm.patch
- patch -Np1 -i ../build-arm-libopus.patch
-
- cat >> .mozconfig <<END
-#ac_add_options --enable-linker=gold
-ac_add_options --enable-optimize="-O2"
-ac_add_options --disable-rust-simd
-ac_add_options --disable-lto
-ac_add_options --disable-webrtc
-ac_add_options --disable-elf-hack
-ac_add_options --disable-av1
-# mk_add_options MOZ_MAKE_FLAGS="$MAKEFLAGS"
-export CC=gcc
-export CXX=g++
-export AR=gcc-ar
-export NM=gcc-nm
-export RANLIB=gcc-ranlib
-END
+ # TODO: fixme
+ false
fi
if [[ $CARCH = i686 ]]; then
- sed -i '/--enable-rust-simd/d' .mozconfig
- sed -i '/--enable-lto/d' .mozconfig
- sed -i '/export MOZ_PGO/d' .mozconfig
-
- cat >> .mozconfig <<END
-ac_add_options --disable-lto
-export CC=gcc
-export CXX=g++
-export AR=gcc-ar
-export NM=gcc-nm
-export RANLIB=gcc-ranlib
-END
+ # TODO: fixme
+ false
fi
## Rebranding
@@ -244,7 +210,7 @@ END
# local _remove_engines_sed='s|.*oogle.*| "ddg", "duckduckgo-html", "duckduckgo-lite", "internet-archive", "parabola-labs", "parabola-packages", "parabola-wiki-en", "searx", "wikipedia", "yacy"|g'
local _remove_engines_sed='s|.*oogle.*| "ddg", "wikipedia"|g'
local _search_config_file=browser/components/search/extensions/list.json
- patch -Np1 -i "$srcdir/searchengines.patch"
+ patch -Np1 -i "$srcdir/libre-searchengines.patch"
sed -i "${_remove_engines_sed}" ${_search_config_file}
# Sanity-check search-engines patching
@@ -260,26 +226,60 @@ build() {
export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
if [[ $CARCH = armv7h ]]; then
- # FIXME: wip ARM FTBS (memory exhausted)
-# export RUSTFLAGS+=" -Cdebuginfo=0"
- export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off -Copt-level=0"
-# export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
- export LDFLAGS+="-Wl,--no-keep-memory -Wl,--no-keep-files-mapped -Wl,--no-map-whole-files -Wl,--no-mmap-output-file"
+ # TODO: fixme
+ false
fi
if [[ $CARCH = i686 ]]; then
- export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off"
- export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
+ # TODO: fixme
+ false
fi
# LTO needs more open files
ulimit -n 4096
- if [[ $CARCH = x86_64 ]]; then
- xvfb-run -a -n 97 -s "-screen 0 1600x1200x24" ./mach build
- else
- ./mach build
+ # -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
+ msg2 "Building instrumented browser..."
+ cat >.mozconfig ../mozconfig - <<END
+ac_add_options --enable-profile-generate=cross
+END
+ ./mach build
+
+ msg2 "Profiling instrumented browser..."
+ ./mach package
+ LLVM_PROFDATA=llvm-profdata \
+ JARLOG_FILE="$PWD/jarlog" \
+ xvfb-run -a -n 92 -s "-screen 0 1600x1200x24" \
+ ./mach python build/pgo/profileserver.py
+
+ if ! compgen -G '*.profraw' >&2; then
+ error "No profile data produced."
+ return 1
fi
+
+ if [[ ! -s jarlog ]]; then
+ error "No jar log produced."
+ return 1
+ fi
+
+ msg2 "Removing instrumented browser..."
+ ./mach clobber
+
+ msg2 "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}
+ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog
+END
+ ./mach build
+
+ msg2 "Building symbol archive..."
./mach buildsymbols
}
@@ -292,9 +292,8 @@ package() {
DESTDIR="$pkgdir" ./mach install
find . -name '*crashreporter-symbols-full.zip' -exec cp -fvt "$startdir" {} +
- ## runtime configuration
- _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", "");
@@ -319,7 +318,7 @@ END
#
# However, they don't seem to be causing any of the critical issues.
local _shortver=$(cut -d. -f1,2 <<<"$pkgver")
- cat >> "$_vendorjs" <<END
+ cat >> "$vendorjs" <<END
// Disable "alt" as a shortcut key to open full menu bar. Conflicts with "alt" as a modifier
pref("ui.key.menuAccessKeyFocuses", false);
@@ -616,10 +615,15 @@ pref("dom.input.dirpicker", false);
// fix alsa sound sandbox issue for iceweasel-58
// https://labs.parabola.nu/issues/1628
pref("security.sandbox.content.syscall_whitelist", "16");
+
+// Disable recommendations of extensions and themes on about:addons page
+// https://labs.parabola.nu/issues/2409
+pref("extensions.htmlaboutaddons.discover.enabled", false);
+pref("extensions.htmlaboutaddons.recommendations.enabled", 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
@@ -631,24 +635,40 @@ app.distributor.channel=$pkgname
app.partner.parabola=parabola
END
+ local i
for i in 16 22 24 32 48 64 128 192 256 384; do
- install -Dm644 browser/branding/$pkgname/default$i.png \
+ install -Dvm644 browser/branding/$pkgname/default$i.png \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
done
- install -Dm644 "browser/branding/$pkgname/${pkgname}_icon.svg" \
+ install -Dvm644 "browser/branding/$pkgname/${pkgname}_icon.svg" \
"$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.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
+
+ if [[ -f "$startdir/.crash-stats-api.token" ]]; then
+ find . -name '*crashreporter-symbols-full.zip' -exec \
+ "$startdir/upload-symbol-archive" "$startdir/.crash-stats-api.token" {} +
+ else
+ find . -name '*crashreporter-symbols-full.zip' -exec \
+ cp -fvt "$startdir" {} +
+ fi
}
+
+# vim:set sw=2 et: