# Maintainer: Jan Alexander Steffens (heftig) # Contributor: Ionut Biru # Contributor: Jakub Schmidtke # ALARM: Kevin Mihelich # - mozconfig changes for ARM # - revert change for clang that breaks gcc build on ARM # - disable rust lto for v7 highmem=1 pkgname=firefox pkgver=97.0.2 pkgrel=1 pkgdesc="Standalone web browser from mozilla.org" arch=(x86_64) license=(MPL GPL LGPL) url="https://www.mozilla.org/firefox/" 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) 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' 'xdg-desktop-portal: Screensharing with Wayland') options=(!emptydirs !makeflags !strip !lto !debug) source=(https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz{,.asc} build-arm-libopus.patch 0001-Use-remoting-name-for-GDK-application-names.patch $pkgname.desktop identity-icons-brand.svg) sha256sums=('c9f127741beabde78b021dc95b1740259d01677d461400682cb30e072126f075' 'SKIP' '8de6c0ecc70d2763936be6df4b91a3d2e806765bf510f987d6f2ffa2377c3f01' '5ead90994f91bed3231c2661977c69fc276cfbe278a1ab904daa544c9455ff42' '298eae9de76ec53182f38d5c549d0379569916eebf62149f9d7f4a7edef36abf' 'a9b8b4a0a1f4a7b4af77d5fc70c2686d624038909263c795ecc81e0aec7711e9') validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Releases # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) # Note: These are for Arch Linux use ONLY. For your own distribution, please # get your own set of keys. Feel free to contact foutrelis@archlinux.org for # more information. # - Arch Linux ARM has obtained permission to use the Arch Linux keys. _google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM # Mozilla API keys (see https://location.services.mozilla.com/api) # Note: These are for Arch Linux use ONLY. For your own distribution, please # get your own set of keys. Feel free to contact heftig@archlinux.org for # more information. _mozilla_api_key=e05d56db0a694edc8b5aaebda3f2db6a 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 echo -n "$_mozilla_api_key" >mozilla-api-key cat >.mozconfig <> .mozconfig # https://bugzilla.redhat.com/show_bug.cgi?id=1641623 echo "ac_add_options --disable-av1" >> .mozconfig MAKEFLAGS="-j1" sed -i '/cargo_rustc_flags += -Clto/d' config/makefiles/rust.mk elif [[ $CARCH == "aarch64" ]]; then echo 'ac_add_options --enable-rust-simd' >> .mozconfig fi echo 'ac_add_options --enable-optimize="-g0 -O2"' >> .mozconfig echo "mk_add_options MOZ_MAKE_FLAGS=\"${MAKEFLAGS}\"" >> .mozconfig export MOZ_DEBUG_FLAGS=" " export CFLAGS+=" -g0" export CXXFLAGS+=" -g0" export LDFLAGS+=" -Wl,--no-keep-memory" export RUSTFLAGS="-Cdebuginfo=0" patch -p1 -i ../build-arm-libopus.patch } build() { cd firefox-$pkgver 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 echo "Building optimized browser..." ./mach build echo "Building symbol archive..." ./mach buildsymbols } package() { cd firefox-$pkgver DESTDIR="$pkgdir" ./mach install local vendorjs="$pkgdir/usr/lib/$pkgname/browser/defaults/preferences/vendor.js" install -Dvm644 /dev/stdin "$vendorjs" <