# Maintainer (arch): Jan Alexander Steffens (heftig) # Contributor: Ionut Biru # Contributor: Jakub Schmidtke # Contributor: Figue # Contributor: fauno # Contributor: evr # Contributor: Muhammad 'MJ' Jassim # Contributor: vando # Contributor: André Silva # Contributor: Henry Jensen # Contributor: Luke Shumaker # Contributor: Márcio Silva # Maintainer: Andreas Grapentin # Contributor: bill-auger # Contributor: grizzlyuser # NOTE: icecat (60.7 < V <= current) are not complete upstream releases # upstream releases normally have $_upstream_ver ending in '-gnu' # this build is based on gnuzilla VCS developement sources # rev: 65a61287a5142a9403ec00d973cb5e5d658a3c71 # with parabola patches applied # https://git.parabola.nu/~bill-auger/icecat.git/log/?h=parabola pkgname=icecat _upstream_ver=91.11.0-gnu1 _upstream_ver=${_upstream_ver/-gnu1/-pre1} # parabola pre-release pkgver=${_upstream_ver//-/_} pkgrel=1 pkgdesc="the GNU web browser, based on Mozilla Firefox ESR" arch=(armv7h i686 x86_64) license=(MPL GPL LGPL) url=http://www.gnu.org/software/gnuzilla/ 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 nodejs cbindgen nasm python-setuptools python-psutil python-zstandard lld dump_syms) makedepends+=(jq python-jsonschema) makedepends_i686=(gcc10) 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://repo.parabola.nu/other/${pkgname}/${pkgname}-${_upstream_ver}.tar.bz2{,.sig} icecat.desktop icecat-safe.desktop 0001-Use-remoting-name-for-GDK-application-names.patch ) source_armv7h=(arm.patch build-arm-libopus.patch) source_i686=(avoid-libxul-OOM-python-check.patch rust-static-disable-network-test-on-static-libraries.patch) sha256sums=('f2a149d562b0b441f4df1e395d00a36717f56001acf7f05d40ebab0088069661' 'SKIP' 'e00dbf01803cdd36fd9e1c0c018c19bb6f97e43016ea87062e6134bdc172bc7d' '33dd309eeb99ec730c97ba844bf6ce6c7840f7d27da19c82389cdefee8c20208' 'a7f5ae9f018678a391739365329a5a5b527b536bc9aac441c73ae811d2fa530d' ) sha256sums_armv7h=('bc00516032330760444939c516a60c78f868631e1b37f075f0fe71a53737b966' '2d4d91f7e35d0860225084e37ec320ca6cae669f6c9c8fe7735cdbd542e3a7c9') sha256sums_i686=('2f0c81a38c4578f68f5456b618fe84a78974072821488173eb55e0e72287e353' '10c5276eab2e87f400a6ec15d7ffbef3b0407ee888dea36f1128927ca55b9041') validpgpkeys+=('3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger (VCS builds) # disable PGO for 32-bit arches _should_skip_pgo=0 # for x86_64 [[ "${CARCH}" != 'armv7h' && "${CARCH}" != 'i686' ]] || _should_skip_pgo=1 _check_build_config() { pushd "${srcdir}"/${pkgname}-${pkgver%_*} > /dev/null echo "Checking build configuration..." # Configure produces mozinfo.json that reflects current configuration. # See build/docs/mozinfo.rst ./mach configure # In this test, jq collects values of the following keys of mozinfo.json into array, # and checks if any of them are not equal to false, in which case it returns "true". # E.g. if the value of any key is true or null (in case the key is missing from mozinfo.json), # that means the build configuration has to be reworked. local obj_directory=$(./mach environment | sed -En '/object directory:/{n;s/^\s+//;p;}') local antifeature_keys=(.crashreporter .datareporting .healthreport .normandy .telemetry .updater) local antifeatures=() echo "obj_directory is: ${obj_directory}" for key in ${antifeature_keys[@]} do jq -e "${key} != false" "${obj_directory}/mozinfo.json" &> /dev/null && antifeatures+=(${key}) done if (( ${#antifeatures[@]} )) then echo "Some anti-features are not disabled in build configuration files, aborting:" for key in ${antifeatures[@]} ; do echo " - ${key} is enabled" ; done ; [[ -z "${ar[*]/.datareporting/}" ]] && return 0 # FIXME: .datareporting is detected return 1 fi popd > /dev/null } prepare() { mkdir -p mozbuild cd "$srcdir/$pkgname-${pkgver%_*}" # https://bugzilla.mozilla.org/show_bug.cgi?id=1530052 patch -Np1 -i ../0001-Use-remoting-name-for-GDK-application-names.patch # # https://bugzilla.mozilla.org/show_bug.cgi?id=1667736 # patch -Np1 -i ../rust_1.48.patch cat >../mozconfig < 0.23 (currently 0.24) # https://bugzilla.mozilla.org/show_bug.cgi?id=1773259 sed -i '/const uint64_t ROOT_CLIP_CHAIN = ~0;/d' gfx/webrender_bindings/webrender_ffi.h ## [ARCH-SPECIFIC CONFIG] ## case ${CARCH} in armv7h) sed -i ' /--enable-hardening/d /--enable-optimize/d /--enable-rust-simd/d ' ../mozconfig cat >>../mozconfig <>../mozconfig < error: unknown argument: '-fvar-tracking-assignments' CFLAGS="${CFLAGS/-fvar-tracking-assignments/}" CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}" ## [ARCH-SPECIFIC BUILD ENV] ## case ${CARCH} in armv7h) export MOZ_DEBUG_FLAGS=" " export CFLAGS+=" -g0" export CXXFLAGS+=" -g0" export LDFLAGS+=" -Wl,--no-keep-memory" export RUSTFLAGS="-Cdebuginfo=0" ;; i686) # -fno-plt with cross-LTO -> LLVM ERROR: Function Import: link error CFLAGS="${CFLAGS/-fno-plt/}" CXXFLAGS="${CXXFLAGS/-fno-plt/}" # 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" ;; x86_64) ;; *) echo "no [ARCH-SPECIFIC BUILD ENV] for arch: ${CARCH}" ; return 1 ; ;; esac export CFLAGS export CXXFLAGS ## [ARCH-SPECIFIC BUILD CONFIG] ## case ${CARCH} in armv7h) ;; i686) # /usr/bin/ld.bfd: error: libxul.so(.debug_info) is too large (0x54c5369a bytes) options=( ${options[*]/\!strip/} ) # 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 ;; x86_64) ;; *) echo "no [ARCH-SPECIFIC BUILD CONFIG] for arch: ${CARCH}" ; return 1 ; ;; esac ## PGO build ## if (( $_should_skip_pgo )) then # skipping "3-tier PGO" "instrumented browser", to avoid OOM problems; # so we have the final .mozconfig now cp ../mozconfig .mozconfig else # Do 3-tier PGO echo "Building instrumented browser..." cat >.mozconfig ../mozconfig - <.mozconfig ../mozconfig - < "${pkgdir}"/etc/ld.so.conf.d/${pkgname}.conf # disable stripping in mozconfig. (insists to use llvm-strip which runs # out of memory on libxul.so). Now 2.5 GB can be stripped to 166 MB, so we do # that with the normal 'strip' from binutils after 'mach install' strip "$pkgdir/usr/lib/$pkgname/libxul.so" ;; 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 }