# Maintainer (arch): Jan Alexander Steffens (heftig) # Contributor (arch): Ionut Biru # Contributor (arch): Jakub Schmidtke # Maintainer (connochaetos): Henry Jensen # Maintainer (alarm): Kevin Mihelich # Maintainer (arch32): Andreas Baumann # Contributor (arch32): Erich Eckner # Contributor: Andreas Grapentin # Contributor: Luke Shumaker # Contributor: André Silva # Contributor: Márcio Silva # Contributor: fauno # Contributor: vando # Contributor: Figue # Contributor: evr # Contributor: Muhammad 'MJ' Jassim # Contributor: taro-k # Contributor: Michał Masłowski # Contributor: Luke R. # Contributor: Isaac David # Contributor: bill-auger # Contributor: grizzlyuser # Rational for inclusion in [libre]: # - Modify the addons pages to use GNU IceCat plugins sources, rather # than addons.mozilla.org, which hosts non-free addons. # - Disable EME, which is implemented via the non-free libWideVine # CDM. # # The above changes cause us to run afoul of the Firefox trademark # policy[1], so making those changes also requires us to: # - Rebrand to Iceweasel # # technical: # - build i686 with GCC instead of clang # - disable rust-SIMD, LTO, PGO, and skip profiling build for armv7h and i686 # # privacy: # - Remove Google API keys and usage # - Disable Mozilla telemetry and crash reporting (good manners # because of all of the other patching we're doing) # # [1]: https://www.mozilla.org/en-US/foundation/trademarks/policy/ pkgname=iceweasel replaces=('firefox') epoch=1 pkgver=75.0 pkgrel=1 pkgrel+=.parabola2 _brandingver=75.0 _brandingrel=1 pkgdesc="Standalone web browser derived from Mozilla Firefox" arch=(x86_64) arch+=(i686 armv7h) license=(MPL GPL LGPL) url="https://wiki.parabola.nu/Iceweasel" 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 python nodejs python2-psutil cbindgen nasm) # FIXME: 'mozilla-serarchplugins' package needs re-working (see note in prepare()) makedepends+=(quilt libxslt imagemagick) 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 !strip) 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://repo.parabola.nu/other/iceweasel/${pkgname}_${_brandingver}-${_brandingrel}.branding.tar.xz{,.sig} libre.patch libre-searchengines.patch vendor.js.in) source_armv7h=(arm.patch build-arm-libopus.patch) source_i686=('rust-static-disable-network-test-on-static-libraries.patch' 'avoid-libxul-OOM-python-check.patch') sha256sums=('bbb1054d8f2717c634480556d3753a8483986af7360e023bb6232df80b746b0f' 'SKIP' '5f7ac724a5c5afd9322b1e59006f4170ea5354ca1e0e60dab08b7784c2d8463c' 'f573d00835afe066ef1887bfea35099933ee07aeadc4c0d603972127e600cfc4' 'b64059188836fbb9522d0d0a0d669dfa77c4f075f350554e414bb023afbaea31' 'SKIP' '3dbdf461f992394ca380700c229a6ce6220a07ba1c7f8475cc2ff39891447e56' 'd783225c311a4d64a9196d573627aeecaf02365395eea9783b1175b7613bdf6e' 'cc3d71eb493a3d53b1662567cae872f81ff99e0845d59ac402a890461c356183') sha256sums_i686=('4da71f6614dce71db8e9ec2d317514aae90838c2c65620d435f0df06b45b578b' '1882cd2a1689d41c3111abe45dab7215a5b292d5fff24fdde9af25af7b891a59') sha256sums_armv7h=('bc00516032330760444939c516a60c78f868631e1b37f075f0fe71a53737b966' '2d4d91f7e35d0860225084e37ec320ca6cae669f6c9c8fe7735cdbd542e3a7c9') validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Releases validpgpkeys+=('BFA8008A8265677063B11BF47171986E4B745536') # Andreas Grapentin prepare() { mkdir mozbuild cd firefox-$pkgver # https://bugzilla.mozilla.org/show_bug.cgi?id=1530052 echo "applying 0001-Use-remoting-name-for-GDK-application-names.patch" patch -Np1 -i ../0001-Use-remoting-name-for-GDK-application-names.patch cat >../mozconfig <>../mozconfig <>../mozconfig </ # 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 echo "applying libre-searchengines.patch" patch -Np1 -i "$srcdir/libre-searchengines.patch" sed -i "${_remove_engines_sed}" ${_search_config_file} # Sanity-check search-engines patching _removed_engines_regex='Bing|Google|Seznam|Twitter|Yahoo|Yandex|Яндекс|amazon|bing|google|ebay|twitter' _err_msg="search-engines patch needs re-working" ! grep -E ${_removed_engines_regex} ${_search_config_file} > /dev/null || ! echo "${_err_msg}" } build() { cd firefox-$pkgver export MOZ_NOSPAM=1 export MOZBUILD_STATE_PATH="$srcdir/mozbuild" # LTO needs more open files ulimit -n 4096 ## [ARCH-SPECIFIC BUILD ENV] ## if [[ $CARCH != armv7h ]]; then # -fno-plt with cross-LTO causes obscure LLVM errors # LLVM ERROR: Function Import: link error CFLAGS="${CFLAGS/-fno-plt/}" CXXFLAGS="${CXXFLAGS/-fno-plt/}" fi if [[ $CARCH != i686 ]]; then # DEBUG: clang-9: error: unknown argument: '-fvar-tracking-assignments' CFLAGS="${CFLAGS/-fvar-tracking-assignments/}" CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}" fi case ${CARCH} in armv7h) export MOZ_DEBUG_FLAGS=" " export CFLAGS+=" -g0" export CXXFLAGS+=" -g0" export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" export RUSTFLAGS="-Cdebuginfo=0" ;; i686) # disable LTO (clang has issues on IA32) export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off" export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" # libvpx has some hard-coded compiler flags for MMX, SSE, SSE2, use the correct one # per CARCH (75.0 uses an intrisic _mm_empty now, which required the corresponding # architecture flag to be preset - before it was merely embedding some assembly # code with EMMS export CFLAGS+=" -mmmx" export CXXFLAGS+=" -mmmx" ;; esac ## [ARCH-SPECIFIC BUILD CONFIG] ## case ${CARCH} in armv7h) # skipping PGO "instrumented browser"; so we have the final .mozconfig now cp ../mozconfig .mozconfig ;; i686) # do not do profiling on i686: ..or it will for sure run out of memory - it doesn't find libraries: # "XPCOMGlueLoad error for file /build/firefox/src/firefox-70.0/obj-i686-pc-linux-gnu/dist/firefox/libxul.so: # libmozsandbox.so: cannot open shared object file: No such file or directory # Couldn't load XPCOM." # avoid excessive debug symbols in rust leading to out-of-memory situations sed -i "s/debug_info = '\''2'\''/debug_info = '\''0'\''/" build/moz.configure/toolchain.configure # skipping PGO "instrumented browser"; so we have the final .mozconfig now cp ../mozconfig .mozconfig ;; x86_64) # Do 3-tier PGO echo "Building instrumented browser..." cat >.mozconfig ../mozconfig - <.mozconfig ../mozconfig - <=${_icu_ver}" "icu<$((${_icu_ver%%.*} + 1))") cd firefox-$pkgver DESTDIR="$pkgdir" ./mach install local vendorjs="$pkgdir/usr/lib/$pkgname/browser/defaults/preferences/vendor.js" install -Dvm644 /dev/stdin "$vendorjs" <> "$vendorjs" sed -i "s|@_SHORTVER_@|$_shortver|g" "$vendorjs" local distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini" install -Dvm644 /dev/stdin "$distini" < "${pkgdir}"/etc/ld.so.conf.d/${pkgname}.conf ;; x86_64) ;; *) echo "no [ARCH-SPECIFIC INSTALL] for arch: ${CARCH}" ; return 1 ; ;; esac # Replace duplicate binary with wrapper # https://bugzilla.mozilla.org/show_bug.cgi?id=658850 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 } # vim:set sw=2 et: