diff options
Diffstat (limited to 'libre/iceweasel/PKGBUILD')
-rw-r--r-- | libre/iceweasel/PKGBUILD | 169 |
1 files changed, 123 insertions, 46 deletions
diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD index 57a711174..3048a21d6 100644 --- a/libre/iceweasel/PKGBUILD +++ b/libre/iceweasel/PKGBUILD @@ -45,23 +45,36 @@ # (good manners because of all of the other patching we're doing) +# NOTE: This PKGBUILD is kept in-sync with arch{,arm,32}, as closely as possible, +# for the sake of documentation and cleaner diffs. +# That also helps to identify which changes were made by Parabola vs upstream. +# Therefore, this PKGBUILD may declare blacklisted dependencies, non-free sources, +# or include code for anti-features; but those will be filtered-out subsequently. +# Any code which implements an anti-feature should be commented-out; +# and include an 'anti-feature' comment, for clarity. +# Any blacklisted dependencies and non-free sources should be filtered. +# Without those over-rides, the resulting program may not be FSDG-fit. +# Do not circumvent those over-rides, if compiling for the Parabola repos. + + pkgname=iceweasel epoch=1 -pkgver=97.0.2 +pkgver=98.0 pkgrel=1 -pkgrel+=.parabola5 -_brandingver=97.0-1 # unreleased WIP +pkgrel+=.parabola1 +_brandingver=98.0-1 pkgdesc="Standalone web browser derived from Mozilla Firefox" arch=(x86_64) arch+=(armv7h i686) license=(MPL GPL LGPL) url="https://wiki.parabola.nu/Iceweasel" -depends=(gtk3 libxt mime-types dbus-glib ffmpeg nss ttf-font libpulse) +depends=(gtk3 libxt mime-types dbus-glib ffmpeg4.4 nss ttf-font libpulse) makedepends=(unzip zip diffutils yasm mesa imake inetutils xorg-server-xvfb autoconf2.13 rust clang llvm jack nodejs cbindgen nasm python-setuptools python-psutil python-zstandard lld dump_syms wasi-compiler-rt wasi-libc wasi-libc++ wasi-libc++abi) makedepends+=(quilt libxslt imagemagick git jq python-jsonschema) +depends=( ${depends[*]/ffmpeg4.4/ffmpeg} ) makedepends+=(libvpx=1.11.0-1) [[ "${CARCH}" == i686 ]] && makedepends=( ${makedepends[*]/jack/jack2} ) [[ "${CARCH}" == i686 ]] && makedepends=( ${makedepends[*]/llvm/llvm12} ) @@ -75,28 +88,29 @@ optdepends=('networkmanager: Location detection via available WiFi networks' 'xdg-desktop-portal: Screensharing with Wayland') replaces=('firefox') options=(!emptydirs !makeflags !strip !lto !debug) # FIXME: make debug package -source=(https://archive.mozilla.org/pub/firefox/releases/${pkgver}/source/firefox-${pkgver}.source.tar.xz{,.asc} - 0001-Use-remoting-name-for-GDK-application-names.patch - $pkgname.desktop) +source=(https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz{,.asc} + $pkgname.desktop identity-icons-brand.svg) +source=(${source[*]/identity-icons-brand.svg/}) source+=(https://repo.parabola.nu/other/iceweasel/${pkgname}_${_brandingver}.branding.tar.xz{,.sig} - 9001-FSDG-always-sync-remote-settings-with-local-dump.patch + 9001-FSDG-sync-remote-settings-with-local-dump.patch 9002-FSDG-preference-defaults.patch - 9003-FSDG-misc.patch + 9003-FSDG-urihandlers.patch + 9004-FSDG-misc.patch process-json-files.py vendor.js.in) source_armv7h=(build-arm-libopus.patch) source_i686=('avoid-libxul-OOM-python-check.patch' 'rust-static-disable-network-test-on-static-libraries.patch' 'firefox-93.0_x86_math_private_20211110.patch') -sha256sums=('c9f127741beabde78b021dc95b1740259d01677d461400682cb30e072126f075' +sha256sums=('fd0a4c11d007d9045706667eb0f99f9b7422945188424cb937bfef530cb6f4dd' 'SKIP' - '8de6c0ecc70d2763936be6df4b91a3d2e806765bf510f987d6f2ffa2377c3f01' '9cdc2602661717712092d28bb494e5b48e518cb930898aca85eaf21f91f7ef58') -sha256sums+=('f6013003a6bac275fc27d1c10d1f38a033fe888a4dc64a6ad50522de41aaa70b' +sha256sums+=('f3e89499909b172476e931d9ab18b856d0001e3042b3816d1728809536179768' 'SKIP' 'a4e3c3869085cb282cb5a0fcb64e816c0415f25d4792a62c4f1d599d3111b23c' 'cb3079a0dc30321183bf8e112532c6f2aad045f68103f8d422c9691137aa770e' - '39e3a5e1ad137e21f842a44d7e3bd24050292d2b41fe59b4e7c7dfed52a195dd' + 'e192458a2a9878483984e1400bb3c66df369adfbf6f144b90445f80973c32ed1' + 'e7b8d08bb9fa98f09290632f37d1453c52db56fa0d20acf9bc5d110d2d64a920' '9386f1c50506cd20ab6d212335d5e4417faeb2aea371dd46f2d107d171e80b83' 'c93ce98e1cb64033079343ff1f3037fab6a3bc6d3eb5bc14c5edb70e2d45965d') sha256sums_armv7h=('2d4d91f7e35d0860225084e37ec320ca6cae669f6c9c8fe7735cdbd542e3a7c9') @@ -108,6 +122,19 @@ validpgpkeys+=('BFA8008A8265677063B11BF47171986E4B745536') # Andreas Grapentin validpgpkeys+=('3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger +# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) # anti-feature +# Note: These are for Arch Linux use ONLY. For your own distribution, please # anti-feature +# get your own set of keys. Feel free to contact foutrelis@archlinux.org for # anti-feature +# more information. # anti-feature +# _google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM # anti-feature + +# Mozilla API keys (see https://location.services.mozilla.com/api) # anti-feature +# Note: These are for Arch Linux use ONLY. For your own distribution, please # anti-feature +# get your own set of keys. Feel free to contact heftig@archlinux.org for # anti-feature +# more information. # anti-feature +# _mozilla_api_key=e05d56db0a694edc8b5aaebda3f2db6a # anti-feature + + # PGO requires networking _should_skip_pgo_armv7h=1 # disable for armv7h - always _should_skip_pgo_i686=1 # disable for i686 - always @@ -115,8 +142,10 @@ _should_skip_pgo_x86_64=0 # disable for x86_64 - sometimes for libremakepkg eval "_should_skip_pgo=\$_should_skip_pgo_${CARCH}" +## helpers ## + _check_build_config() { - pushd "$srcdir/firefox-${pkgver%_*}" > /dev/null + pushd "${srcdir}"/firefox-${pkgver} > /dev/null echo "Checking build configuration..." @@ -144,12 +173,36 @@ _check_build_config() { popd > /dev/null } +_check_patching() { + pushd "${srcdir}"/firefox-${pkgver} > /dev/null + + # URI protocol handlers + local uri_handlers=uriloader/exthandler/HandlerList.jsm + local webmails='google|yahoo' + grep 'name:' $uri_handlers | grep '"KiwiIRC",' && \ + ! grep 'name:' $uri_handlers | grep -v '"KiwiIRC",' && \ + ! grep -E "($webmails)" $uri_handlers || \ + ! echo "9003-FSDG-misc.patch needs reworking" || \ + return 1 + + # Remote Settings + local settings_server='firefox.settings.services.mozilla.com' + ! grep -qr $settings_server || \ + ! echo '9001-FSDG-sync-remote-settings-with-local-dump.patch needs reworking' || \ + return 1 + + popd > /dev/null +} + + +## business ## + prepare() { mkdir mozbuild cd firefox-$pkgver - # https://bugzilla.mozilla.org/show_bug.cgi?id=1530052 - patch -Np1 -i ../0001-Use-remoting-name-for-GDK-application-names.patch + # echo -n "$_google_api_key" >google-api-key # anti-feature + # echo -n "$_mozilla_api_key" >mozilla-api-key # anti-feature cat >../mozconfig <<END ac_add_options --enable-application=browser @@ -167,17 +220,22 @@ ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot # Branding ac_add_options --disable-official-branding +ac_add_options --enable-update-channel=release +ac_add_options --with-distribution-id=nu.parabola ac_add_options --with-branding=browser/branding/${pkgname} ac_add_options --with-app-name=${pkgname} ac_add_options --with-app-basename=${pkgname} -ac_add_options --enable-update-channel=release -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_REMOTINGNAME=${pkgname} +export MOZ_APP_REMOTINGNAME=${pkgname//-/} export MOZ_TELEMETRY_REPORTING= export MOZ_REQUIRE_SIGNING= +# Keys +# ac_add_options --with-google-location-service-api-keyfile=${PWD@Q}/google-api-key # anti-feature +# ac_add_options --with-google-safebrowsing-api-keyfile=${PWD@Q}/google-api-key # anti-feature +# ac_add_options --with-mozilla-api-keyfile=${PWD@Q}/mozilla-api-key # anti-feature + # System libraries ac_add_options --with-system-nspr ac_add_options --with-system-nss @@ -266,10 +324,9 @@ END echo "applying parabola branding" local brandingsrcdir="${srcdir}"/${pkgname}-${_brandingver/-*} local brandingdestdir=browser/branding/${pkgname} + local blank_svg='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"></svg>' rm -rf -- ${brandingdestdir} cp -aT -- ${brandingsrcdir}/branding ${brandingdestdir} - cp "${brandingdestdir}"/iceweasel_logo.svg "${brandingdestdir}"/content/aboutlogins.svg - cp "${brandingdestdir}"/iceweasel_logo.svg "${brandingdestdir}"/content/about-logo.svg # produce icons for i in 16 22 24 32 48 64 128 192 256 384; do @@ -277,6 +334,14 @@ END -o "${brandingdestdir}"/default${i}.png done + pushd "${brandingdestdir}" + cp iceweasel_logo.svg content/aboutlogins.svg + cp iceweasel_logo.svg content/about-logo.svg + convert -background none -geometry 192x192 iceweasel_logo.svg content/about-logo.png + convert -background none -geometry 384x384 iceweasel_logo.svg content/about-logo@2x.png + echo ${blank_svg} > content/blank.svg + popd + # custom new tab page # FIXME: the newtab page (aka "Start Page") has changed significantly # the new upstream start page ('activity-streams') is an add-on now @@ -321,6 +386,9 @@ END export QUILT_PC="${srcdir}"/.pc quilt push -av + # misc branding + sed -i "s|({ \$bits }-bit)|($CARCH)|" browser/locales/en-US/browser/aboutDialog.ftl + ## searchengines ## @@ -364,12 +432,8 @@ END rm testing/mozbase/mozproxy/tests/files/mitm5-linux-firefox-amazon.zip # Disable/neutralize Remote Settings (as best we can) - echo "applying 9001-FSDG-always-sync-remote-settings-with-local-dump.patch" - patch -Np1 --no-backup-if-mismatch -i ../9001-FSDG-always-sync-remote-settings-with-local-dump.patch - - # Verify Remote Settings patching - local settings_server='firefox.settings.services.mozilla.com' - ! grep -qr $settings_server || { echo 'Remote Settings patching needs rework'; return 1; } + echo "applying 9001-FSDG-sync-remote-settings-with-local-dump.patch" + patch -Np1 --no-backup-if-mismatch -i ../9001-FSDG-sync-remote-settings-with-local-dump.patch # Disable various components at the source level sed -i 's/;1/;0/' toolkit/components/telemetry/components.conf @@ -380,12 +444,22 @@ END python ../process-json-files.py "${srcdir}"/firefox-${pkgver} "${brandingsrcdir}" + # disable various phone-home/goelocation anti-featires echo "applying 9002-FSDG-preference-defaults.patch" patch -Np1 --no-backup-if-mismatch -i "${srcdir}"/9002-FSDG-preference-defaults.patch + # over-ride/install default URI protocol handlers + echo "applying 9003-FSDG-urihandlers.patch" + patch -Np1 --no-backup-if-mismatch -i "${srcdir}"/9003-FSDG-urihandlers.patch + # Remove remaining non-free bits - echo "applying 9003-FSDG-misc.patch" - patch -Np1 --no-backup-if-mismatch -i "${srcdir}"/9003-FSDG-misc.patch + echo "applying 9004-FSDG-misc.patch" + patch -Np1 --no-backup-if-mismatch -i "${srcdir}"/9004-FSDG-misc.patch + + + ## patching sanity checks ## + + _check_patching } build() { @@ -395,15 +469,12 @@ build() { export MOZ_NOSPAM=1 export MOZBUILD_STATE_PATH="$srcdir/mozbuild" + export MOZ_ENABLE_FULL_SYMBOLS=1 export MACH_USE_SYSTEM_PYTHON=1 # LTO needs more open files ulimit -n 4096 - # clang-{9,10,11} -> error: unknown argument: '-fvar-tracking-assignments' - CFLAGS="${CFLAGS/-fvar-tracking-assignments/}" - CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}" - ## [ARCH-SPECIFIC BUILD ENV] ## @@ -479,15 +550,11 @@ END xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" \ ./mach python build/pgo/profileserver.py - if [[ ! -s merged.profdata ]]; then - echo "No profile data produced." - return 1 - fi + stat -c "Profile data found (%s bytes)" merged.profdata + test -s merged.profdata - if [[ ! -s jarlog ]]; then - echo "No jar log produced." - return 1 - fi + stat -c "Jar log found (%s bytes)" jarlog + test -s jarlog echo "Removing instrumented browser..." ./mach clobber @@ -504,7 +571,7 @@ END ## sanity checks ## # each of the [ARCH-SPECIFIC BUILD CONFIG] branches above should have created .mozconfig - [[ ! -f .mozconfig ]] && echo ".mozconfig file not found in source root" && return 1 + [[ ! -f .mozconfig ]] && echo "cannot continue without a .mozconfig file" && return 1 _check_build_config @@ -512,6 +579,9 @@ END echo "Building optimized browser..." ./mach build + + echo "Building symbol archive..." + ./mach buildsymbols } package() { @@ -554,13 +624,20 @@ 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 -Dvm644 browser/branding/$pkgname/default$i.png \ + # NOTE: browser/branding/$theme is $brandingdestdir in configure() + local i theme=$pkgname + 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 -Dvm644 "browser/branding/$pkgname/${pkgname}_icon.svg" \ + install -Dvm644 browser/branding/$theme/content/about-logo.png \ + "$pkgdir/usr/share/icons/hicolor/192x192/apps/$pkgname.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/about-logo.svg \ "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.svg" + install -Dvm644 browser/branding/$theme/content/blank.svg \ + "$pkgdir/usr/share/icons/hicolor/symbolic/apps/$pkgname-symbolic.svg" install -Dvm644 ../$pkgname.desktop \ "$pkgdir/usr/share/applications/$pkgname.desktop" |