diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2022-10-06 16:05:31 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2022-10-07 07:17:54 -0400 |
commit | fb7b612ccab6085e71c28092acdd30a68b093c36 (patch) | |
tree | abae951a90a00421739d3ccc045f10915b7bd843 | |
parent | 0efad1d902b9ea345b04f10629131f0d2f42302b (diff) |
housekeeping - minimize diff between icecat and iceweasel
-rw-r--r-- | libre/icecat/PKGBUILD | 323 | ||||
-rw-r--r-- | libre/icecat/vendor.js.in | 0 | ||||
-rw-r--r-- | libre/iceweasel/PKGBUILD | 247 |
3 files changed, 318 insertions, 252 deletions
diff --git a/libre/icecat/PKGBUILD b/libre/icecat/PKGBUILD index 5418f2111..e0d191134 100644 --- a/libre/icecat/PKGBUILD +++ b/libre/icecat/PKGBUILD @@ -1,20 +1,41 @@ -# Maintainer (arch): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> +# Maintainer (arch): Jan Alexander Steffens (heftig) <heftig@archlinux.org> # Contributor: Ionut Biru <ibiru@archlinux.org> # Contributor: Jakub Schmidtke <sjakub@gmail.com> -# Contributor: Figue <ffigue at gmail> +# Contributor: Henry Jensen <hjensen@connochaetos.org> +# Maintainer (archarm): Kevin Mihelich <kevin@archlinuxarm.org> +# Maintainer (arch32): Andreas Baumann <mail@andreasbaumann.cc> +# Contributor: Erich Eckner <git@eckner.net> +# Contributor: Andreas Grapentin <andreas@grapentin.org> +# Contributor: Luke Shumaker <lukeshu@parabola.nu> +# Contributor: André Silva <emulatorman@hyperbola.info> +# Contributor: Márcio Silva <coadde@hyperbola.info> # Contributor: fauno <fauno@kiwwwi.com.ar> +# Contributor: vando <facundo@esdebian.org> +# Contributor: Figue <ffigue at gmail> # Contributor: evr <evanroman at gmail> # Contributor: Muhammad 'MJ' Jassim <UnbreakableMJ@gmail.com> # Contributor: vando <facundo@esdebian.org> -# Contributor: André Silva <emulatorman@hyperbola.info> -# Contributor: Henry Jensen <hjensen@connochaetos.org> -# Contributor: Luke Shumaker <lukeshu@parabola.nu> -# Contributor: Márcio Silva <coadde@hyperbola.info> -# Maintainer: Andreas Grapentin <andreas@grapentin.org> +# Contributor: taro-k <taro-k@movasense_com> +# Contributor: Michał Masłowski <mtjm@mtjm.eu> +# Contributor: Luke R. <g4jc@openmailbox.org> +# Contributor: Isaac David <isacdaavid@isacdaavid.info> # Contributor: bill-auger <bill-auger@programmer.net> # Contributor: grizzlyuser <grizzlyuser@protonmail.com> +# parabola changes and rationale +# NOTE: This PKGBUILD is kept in-sync, as closely as possible, +# with arch{,arm,32} (firefox), and parabola {iceweasel,icecat}, +# 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. + # NOTE: icecat (60.7 < V <= current) are not complete upstream releases # upstream releases normally have $_upstream_ver ending in '-gnu<N>' # this build is based on gnuzilla VCS developement sources @@ -81,11 +102,24 @@ _should_skip_pgo=0 # for x86_64 [[ "${CARCH}" != 'armv7h' && "${CARCH}" != 'i686' ]] || _should_skip_pgo=1 +## helpers ## + _check_build_config() { pushd "${srcdir}"/${pkgname}-${pkgver%%_*} > /dev/null echo "Checking build configuration..." + # Each of the [ARCH-SPECIFIC CONFIG] branches in prepare(), should have prepared a + # $srcdir/mozconfig file with any arch-specific changes to the Arch x86_64 PKGBUILD. + # Finally, that file should have been copied to $srcdir/firefox-$pkgver/.mozconfig + grep '^ac_add_options --with-distribution-id=nu.parabola' .mozconfig &> /dev/null || \ + ! echo "cannot continue without a .mozconfig file" || return 1 + + if ! [[ "${CARCH}" =~ ^(aarch64|armv7h)$ ]] # ARM has no --disable-eme option + then grep '^ac_add_options --disable-eme' .mozconfig &> /dev/null || \ + ! echo ".mozconfig file was not properly treated per the FSDG" || return 1 + fi + # Configure produces mozinfo.json that reflects current configuration. # See build/docs/mozinfo.rst ./mach configure @@ -97,36 +131,55 @@ _check_build_config() { 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}) + do if jq -e "${key} != false" "${obj_directory}"/mozinfo.json &> /dev/null + then antifeatures+=(${key}) + fi 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 - + [[ -z "${antifeatures[*]/.datareporting/}" ]] && return 0 || # FIXME: (icecat) .datareporting is detected return 1 fi popd > /dev/null } +_check_patching() { + return 0 # let's assume that icecat is already FSDG-fit upstream +} + + +## business ## + prepare() { mkdir -p mozbuild cd "$srcdir/$pkgname-${pkgver%%_*}" + + ## technical patching ## + + # FIXME: FTBS with cbindgen > 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 + case ${CARCH} in + aarch64|armv7h) + ;; i686|x86_64) # Unbreak build with glibc 2.36 patch -Np1 -i ../arc4random.diff ;; esac - # FIXME: FTBS with cbindgen > 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 + + + ## general configuration ## + + # 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 @@ -143,18 +196,24 @@ ac_add_options --disable-bootstrap ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot # Branding -ac_add_options --enable-official-branding +ac_add_options --enable-official-branding # branding (icecat) ac_add_options --enable-update-channel=release -ac_add_options --with-distribution-id=nu.parabola -ac_add_options --with-app-name=${pkgname} -ac_add_options --with-app-basename=${pkgname} +ac_add_options --with-distribution-id=nu.parabola # branding over-ride +ac_add_options --with-app-name=${pkgname} # branding over-ride +ac_add_options --with-app-basename=${pkgname} # branding over-ride ac_add_options --with-unsigned-addon-scopes=app,system ac_add_options --allow-addon-sideload +# export MOZILLA_OFFICIAL=1 # branding (icecat) export MOZ_APP_NAME=$pkgname # TODO: probably do not need this (per --with-app-name=) 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 @@ -162,18 +221,13 @@ ac_add_options --with-system-nss # Features ac_add_options --enable-alsa ac_add_options --enable-jack -ac_add_options --disable-crashreporter +ac_add_options --disable-crashreporter # anti-feature ac_add_options --disable-updater ac_add_options --disable-tests -ac_add_options --disable-eme +ac_add_options --disable-eme # anti-feature END - # FIXME: FTBS with cbindgen > 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 @@ -213,27 +267,30 @@ EOF 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 - # mozbuild.configure.options.InvalidOptionError: --disable-eme is not available in this configuration - # EME is disabled anyway in the built package, but better check if it exists for ARM each new release. - sed -i 's|ac_add_options --disable-eme||' ../mozconfig + # archarm `export` commands are under the '[ARCH-SPECIFIC BUILD ENV]' section - echo "applying build-arm-libopus.patch" - patch -p1 -i ../build-arm-libopus.patch + echo "applying build-arm-libopus.patch" + patch -p1 -i ../build-arm-libopus.patch - # At this point in the script, the arch, arch32, and parabola PKGBUILDs - # have prepared a temporary ${srcdir}/mozconfig; but the archarm PKGBUILD - # writes directly to the final firefox-$pkgver/.mozconfig. - # We allowed .mozconfig to be written above, only to minimize the diff against archarm. - # For consistency across arches, we move it to ${srcdir}/mozconfig now. - # ${srcdir}/mozconfig will clobber firefox-$pkgver/.mozconfig later, in build(). - cat .mozconfig >> ../mozconfig + # At this point in the script, the arch, arch32, and parabola PKGBUILDs + # have prepared a temporary ${srcdir}/mozconfig; but the archarm PKGBUILD + # writes directly to the final firefox-$pkgver/.mozconfig. + # We allowed .mozconfig to be written above, only to minimize the diff against archarm. + # For consistency across arches, we move it to ${srcdir}/mozconfig now. + # ${srcdir}/mozconfig will clobber firefox-$pkgver/.mozconfig later, in build(). + cat .mozconfig >> ../mozconfig ;; - i686) - # disable LTO and use gcc toolchain (clang has issues on IA32) - # disable SIMD (SSE2 for i686) - export MOZ_SOURCE_CHANGESET="DEVEDITION_${pkgver//./_}_RELEASE" - cat >>../mozconfig <<END + i686) + export MOZ_SOURCE_CHANGESET="DEVEDITION_${pkgver//./_}_RELEASE" + + # disable LTO as it has little benefit and uses too many resources + # don't compile with clang, use gcc toolchain (clang has issues on IA32) + # disable SIMD (SSE2 for i686) + # set correct compiler and toochain tools + cat >>../mozconfig <<END ac_add_options --disable-linker=lld ac_add_options --enable-linker=bfd ac_add_options --disable-lto @@ -246,27 +303,27 @@ export RANLIB=gcc-ranlib export STRIP=strip END - # readelf: Error: Unable to seek to 0x801db328 for section headers - echo "applying avoid-libxul-OOM-python-check.patch" - patch -p1 -i ../avoid-libxul-OOM-python-check.patch - - # test failure in rust code (complaining about network functions) when PGO is used, - # see https://bugzilla.mozilla.org/show_bug.cgi?id=1565757 - echo "applying rust-static-disable-network-test-on-static-libraries.patch" - patch -p1 -i ../rust-static-disable-network-test-on-static-libraries.patch - - # FIXME: this patch is probably temporary - it comes from mozilla - # https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 - # /build/iceweasel/src/firefox-96.0.1/modules/fdlibm/src/math_private.h:34:21: - # error: conflicting declaration ‘typedef __double_t double_t’ - # /usr/include/math.h:156:21: note: previous declaration as ‘typedef long double double_t’ - echo "applying firefox-99.0.1-fdlibm-double.patch" - patch -p1 -i "$srcdir/firefox-99.0.1-fdlibm-double.patch" + # readelf: Error: Unable to seek to 0x801db328 for section headers + echo "applying avoid-libxul-OOM-python-check.patch" + patch -p1 -i ../avoid-libxul-OOM-python-check.patch + + # test failure in rust code (complaining about network functions) when PGO is used, + # see https://bugzilla.mozilla.org/show_bug.cgi?id=1565757 + echo "applying rust-static-disable-network-test-on-static-libraries.patch" + patch -p1 -i ../rust-static-disable-network-test-on-static-libraries.patch + + # FIXME: this patch is probably temporary - it comes from mozilla + # https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 + # /build/iceweasel/src/firefox-96.0.1/modules/fdlibm/src/math_private.h:34:21: + # error: conflicting declaration ‘typedef __double_t double_t’ + # /usr/include/math.h:156:21: note: previous declaration as ‘typedef long double double_t’ + echo "applying firefox-99.0.1-fdlibm-double.patch" + patch -p1 -i "$srcdir/firefox-99.0.1-fdlibm-double.patch" ;; - x86_64) - sed -i '/--enable-rust-simd/d' ../mozconfig + x86_64) + sed -i '/--enable-rust-simd/d' ../mozconfig ;; - *) echo "no [ARCH-SPECIFIC CONFIG] for arch: ${CARCH}" ; return 1 ; + *) echo "no [ARCH-SPECIFIC CONFIG] for arch: ${CARCH}" ; return 1 ; ;; esac @@ -279,6 +336,11 @@ END ## libre patching ## # let's assume that icecat is already FSDG-fit upstream + + + ## patching sanity checks ## + + _check_patching } build() { @@ -288,45 +350,42 @@ build() { export MOZ_NOSPAM=1 export MOZBUILD_STATE_PATH="$srcdir/mozbuild" - export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system + # export MOZ_ENABLE_FULL_SYMBOLS=1 # anti-feature + export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system # parabola policy # 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] ## case ${CARCH} in - armv7h) - export MOZ_DEBUG_FLAGS=" " - export CFLAGS+=" -g0" - export CXXFLAGS+=" -g0" - export LDFLAGS+=" -Wl,--no-keep-memory" - export RUSTFLAGS="-Cdebuginfo=0" + aarch64|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" + i686) + # -fno-plt with cross-LTO -> LLVM ERROR: Function Import: link error + CFLAGS="${CFLAGS/-fno-plt/}" + CXXFLAGS="${CXXFLAGS/-fno-plt/}" + + # try hard to tell ld and rust not to use too much memory (no lto, no debug info, etc.) + 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) + x86_64) ;; - *) echo "no [ARCH-SPECIFIC BUILD ENV] for arch: ${CARCH}" ; return 1 ; + *) echo "no [ARCH-SPECIFIC BUILD ENV] for arch: ${CARCH}" ; return 1 ; ;; esac export CFLAGS @@ -336,16 +395,16 @@ build() { ## [ARCH-SPECIFIC BUILD CONFIG] ## case ${CARCH} in - armv7h) + aarch64|armv7h) ;; - i686) - # /usr/bin/ld.bfd: error: libxul.so(.debug_info) is too large (0x54c5369a bytes) - options=( ${options[*]/\!strip/} ) + 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 + # 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) + x86_64) ;; *) echo "no [ARCH-SPECIFIC BUILD CONFIG] for arch: ${CARCH}" ; return 1 ; ;; @@ -356,8 +415,7 @@ build() { if (( $_should_skip_pgo )) then - # skipping "3-tier PGO" "instrumented browser", to avoid OOM problems; - # so we have the final .mozconfig now + # skipping "3-tier PGO" "instrumented browser"; so the final .mozconfig is ready now cp ../mozconfig .mozconfig else # Do 3-tier PGO @@ -375,15 +433,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 @@ -399,8 +453,6 @@ END ## sanity checks ## - # each of the [ARCH-SPECIFIC BUILD CONFIG] branches above should have created .mozconfig - [[ -f .mozconfig ]] || ! echo "cannot continue without a .mozconfig file" || return 1 _check_build_config @@ -408,6 +460,9 @@ END echo "Building optimized browser..." ./mach build + + # echo "Building symbol archive..." # anti-feature + # ./mach buildsymbols # anti-feature } package() { @@ -429,17 +484,20 @@ pref("browser.shell.checkDefaultBrowser", false); pref("extensions.autoDisableScopes", 11); END + # Parabola additions to vendor.js + cat "${srcdir}"/vendor.js.in >> "${vendorjs}" + local distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini" install -Dvm644 /dev/stdin "$distini" <<END [Global] id=parabola -version=1.0 -about=Icecat for Parabola GNU/Linux-libre -about.en-US=Icecat for Parabola GNU/Linux-libre -about.eo=Icecat por Parabola GNU/Linux-libre -about.es-ES=Icecat para Parabola GNU/Linux-libre -about.gl=Icecat para Parabola GNU/Linux-libre -about.pt-BR=Icecat para Parabola GNU/Linux-libre +version=${_upstream_ver} +about=${pkgname^} for Parabola GNU/Linux-libre +about.en-US=${pkgname^} for Parabola GNU/Linux-libre +about.eo=${pkgname^} por Parabola GNU/Linux-libre +about.es-ES=${pkgname^} para Parabola GNU/Linux-libre +about.gl=${pkgname^} para Parabola GNU/Linux-libre +about.pt-BR=${pkgname^} para Parabola GNU/Linux-libre [Preferences] app.distributor=parabola @@ -463,10 +521,8 @@ END install -Dvm644 browser/branding/official/default48.png \ "$pkgdir/usr/share/pixmaps/icecat.png" - install -Dvm644 "${srcdir}"/icecat.desktop \ - "$pkgdir/usr/share/applications/icecat.desktop" - install -Dvm644 "${srcdir}"/icecat-safe.desktop \ - "$pkgdir/usr/share/applications/icecat-safe.desktop" + install -Dvm644 ../$pkgname.desktop \ + "$pkgdir/usr/share/applications/$pkgname.desktop" # Install a wrapper to avoid confusion about binary path install -Dvm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END @@ -478,19 +534,19 @@ END ## [ARCH-SPECIFIC INSTALL] ## case ${CARCH} in - armv7h) + aarch64|armv7h) ;; - i686) - # libxul.so cannot find it's libraries - install -dm 755 "${pkgdir}"/etc/ld.so.conf.d - echo "/usr/lib/${pkgname}" > "${pkgdir}"/etc/ld.so.conf.d/${pkgname}.conf - - # disable stripping in mozconfig.<arch> (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" + i686) + # libxul.so cannot find it's libraries + install -dm 755 "${pkgdir}/etc/ld.so.conf.d" + echo "/usr/lib/${pkgname}" > "${pkgdir}"/etc/ld.so.conf.d/${pkgname}.conf + + # disable stripping in mozconfig.<arch> (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) + x86_64) ;; *) echo "no [ARCH-SPECIFIC INSTALL] for arch: ${CARCH}" ; return 1 ; ;; @@ -505,4 +561,11 @@ END if [[ -e $nssckbi ]]; then ln -srfv "$pkgdir/usr/lib/libnssckbi.so" "$nssckbi" fi + + # export SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE="$startdir/.crash-stats-api.token" # anti-feature + # if [[ -f $SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE ]]; then # anti-feature + # make -C obj uploadsymbols # anti-feature + # else # anti-feature + # cp -fvt "$startdir" obj/dist/*crashreporter-symbols-full.tar.zst # anti-feature + # fi } diff --git a/libre/icecat/vendor.js.in b/libre/icecat/vendor.js.in new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/libre/icecat/vendor.js.in diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD index ba1cab0ad..8272f6ed8 100644 --- a/libre/iceweasel/PKGBUILD +++ b/libre/iceweasel/PKGBUILD @@ -14,6 +14,7 @@ # Contributor: Figue <ffigue at gmail> # Contributor: evr <evanroman at gmail> # Contributor: Muhammad 'MJ' Jassim <UnbreakableMJ@gmail.com> +# Contributor: vando <facundo@esdebian.org> # Contributor: taro-k <taro-k@movasense_com> # Contributor: Michał Masłowski <mtjm@mtjm.eu> # Contributor: Luke R. <g4jc@openmailbox.org> @@ -53,7 +54,8 @@ # - do not compile/upload remote debug symbols -# NOTE: This PKGBUILD is kept in-sync with arch{,arm,32}, as closely as possible, +# NOTE: This PKGBUILD is kept in-sync, as closely as possible, +# with arch{,arm,32} (firefox), and parabola {iceweasel,icecat}, # 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, @@ -165,11 +167,11 @@ _check_build_config() { # Each of the [ARCH-SPECIFIC CONFIG] branches in prepare(), should have prepared a # $srcdir/mozconfig file with any arch-specific changes to the Arch x86_64 PKGBUILD. # Finally, that file should have been copied to $srcdir/firefox-$pkgver/.mozconfig - grep '^ac_add_options --with-distribution-id=nu.parabola' .mozconfig || \ - ! echo "cannot continue without a .mozconfig file" || return 1 + grep '^ac_add_options --with-distribution-id=nu.parabola' .mozconfig &> /dev/null || \ + ! echo "cannot continue without a .mozconfig file" || return 1 if ! [[ "${CARCH}" =~ ^(aarch64|armv7h)$ ]] # ARM has no --disable-eme option - then grep '^ac_add_options --disable-eme' .mozconfig || \ + then grep '^ac_add_options --disable-eme' .mozconfig &> /dev/null || \ ! echo ".mozconfig file was not properly treated per the FSDG" || return 1 fi @@ -186,7 +188,9 @@ _check_build_config() { local antifeatures=() echo "obj_directory is: ${obj_directory}" for key in ${antifeature_keys[@]} - do jq -e "${key} != false" "${obj_directory}"/mozinfo.json && antifeatures+=(${key}) + do if jq -e "${key} != false" "${obj_directory}"/mozinfo.json &> /dev/null + then antifeatures+=(${key}) + fi done if (( ${#antifeatures[@]} )) then echo "Some anti-features are not disabled in build configuration files, aborting:" @@ -231,12 +235,12 @@ prepare() { aarch64|armv7h) # https://bugzilla.mozilla.org/show_bug.cgi?id=1786638 patch -Np1 -i ../0001-Bug-1786638-Return-early-if-we-can-t-fetch-an-intern.patch - ;; + ;; *) # Unbreak build with python-zstandard 0.18.0 echo "applying zstandard-0.18.0.diff" patch -Np1 -i ../zstandard-0.18.0.diff - ;; + ;; esac @@ -288,59 +292,59 @@ ac_add_options --enable-jack ac_add_options --disable-crashreporter # anti-feature ac_add_options --disable-updater ac_add_options --disable-tests -ac_add_options --disable-eme +ac_add_options --disable-eme # anti-feature END ## [ARCH-SPECIFIC CONFIG] ## case ${CARCH} in - aarch64|armv7h) - # archarm has these changes in-line above - sed -i ' - /--enable-hardening/d - /--enable-optimize/d - /--enable-rust-simd/d - s|--with-wasi-sysroot=/usr/share/wasi-sysroot|--without-wasm-sandboxed-libraries| - ' ../mozconfig - - if [[ $CARCH == "armv7h" ]]; then - echo "ac_add_options --disable-elf-hack" >> .mozconfig - # https://bugzilla.redhat.com/show_bug.cgi?id=1641623 - echo "ac_add_options --disable-av1" >> .mozconfig - # reduce jobs due to RAM constraints - MAKEFLAGS="-j1" - # disable hard-coded LTO - sed -i '/cargo_rustc_flags += -Clto/d' config/makefiles/rust.mk - sed -i '/RUSTFLAGS += -Cembed-bitcode=yes/d' config/makefiles/rust.mk - # increase codegen-units due to RAM constraints - sed -i 's/codegen-units=1/codegen-units=16/' config/makefiles/rust.mk - # webrtc on ARMv7 implies android, so disable it - echo "ac_add_options --disable-webrtc" >> .mozconfig - 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 - - # archarm export statements are under the '[ARCH-SPECIFIC BUILD ENV]' section - - patch -p1 -i ../build-arm-libopus.patch - - # For consistency across arches, we actually want .mozconfig to be ../mozconfig. - # We allowed .mozconfig to be written above, only to minimize the diff against archarm. - # ${srcdir}/mozconfig will clobber firefox-$pkgver/.mozconfig later, in build() - cat .mozconfig >> ../mozconfig + aarch64|armv7h) + # archarm has these changes in-line above + sed -i ' + /--enable-hardening/d + /--enable-optimize/d + /--enable-rust-simd/d + s| --with-wasi-sysroot=.*| --without-wasm-sandboxed-libraries| + ' ../mozconfig + + if [[ $CARCH == "armv7h" ]]; then + echo "ac_add_options --disable-elf-hack" >> .mozconfig + # https://bugzilla.redhat.com/show_bug.cgi?id=1641623 + echo "ac_add_options --disable-av1" >> .mozconfig + # reduce jobs due to RAM constraints + MAKEFLAGS="-j1" + # disable hard-coded LTO + sed -i '/cargo_rustc_flags += -Clto/d' config/makefiles/rust.mk + sed -i '/RUSTFLAGS += -Cembed-bitcode=yes/d' config/makefiles/rust.mk + # increase codegen-units due to RAM constraints + sed -i 's/codegen-units=1/codegen-units=16/' config/makefiles/rust.mk + # webrtc on ARMv7 implies android, so disable it + echo "ac_add_options --disable-webrtc" >> .mozconfig + 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 + + # archarm export statements are under the '[ARCH-SPECIFIC BUILD ENV]' section + + patch -p1 -i ../build-arm-libopus.patch + + # For consistency across arches, we actually want .mozconfig to be ../mozconfig. + # We allowed .mozconfig to be written above, only to minimize the diff against archarm. + # ${srcdir}/mozconfig will clobber firefox-$pkgver/.mozconfig later, in build() + cat .mozconfig >> ../mozconfig ;; - i686) - export MOZ_SOURCE_CHANGESET="DEVEDITION_${pkgver//./_}_RELEASE" - - # disable LTO as it has little benefit and uses too many resources - # don't compile with clang, use gcc toolchain (clang has issues on IA32) - # disable SIMD (SSE2 for i686) - # set correct compiler and toochain tools - cat >>../mozconfig <<END + i686) + export MOZ_SOURCE_CHANGESET="DEVEDITION_${pkgver//./_}_RELEASE" + + # disable LTO as it has little benefit and uses too many resources + # don't compile with clang, use gcc toolchain (clang has issues on IA32) + # disable SIMD (SSE2 for i686) + # set correct compiler and toochain tools + cat >>../mozconfig <<END ac_add_options --disable-linker=lld ac_add_options --enable-linker=bfd ac_add_options --disable-lto @@ -356,26 +360,26 @@ export RANLIB=gcc-ranlib export STRIP=strip END - # readelf: Error: Unable to seek to 0x801db328 for section headers - echo "applying avoid-libxul-OOM-python-check.patch" - patch -p1 -i ../avoid-libxul-OOM-python-check.patch - - # test failure in rust code (complaining about network functions) when PGO is used, - # see https://bugzilla.mozilla.org/show_bug.cgi?id=1565757 - echo "applying rust-static-disable-network-test-on-static-libraries.patch" - patch -p1 -i ../rust-static-disable-network-test-on-static-libraries.patch - - # FIXME: this patch is probably temporary - it comes from mozilla - # https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 - # /build/iceweasel/src/firefox-96.0.1/modules/fdlibm/src/math_private.h:34:21: - # error: conflicting declaration ‘typedef __double_t double_t’ - # /usr/include/math.h:156:21: note: previous declaration as ‘typedef long double double_t’ - echo "applying firefox-99.0.1-fdlibm-double.patch" - patch -p1 -i "$srcdir/firefox-99.0.1-fdlibm-double.patch" + # readelf: Error: Unable to seek to 0x801db328 for section headers + echo "applying avoid-libxul-OOM-python-check.patch" + patch -p1 -i ../avoid-libxul-OOM-python-check.patch + + # test failure in rust code (complaining about network functions) when PGO is used, + # see https://bugzilla.mozilla.org/show_bug.cgi?id=1565757 + echo "applying rust-static-disable-network-test-on-static-libraries.patch" + patch -p1 -i ../rust-static-disable-network-test-on-static-libraries.patch + + # FIXME: this patch is probably temporary - it comes from mozilla + # https://bugzilla.mozilla.org/show_bug.cgi?id=1729459 + # /build/iceweasel/src/firefox-96.0.1/modules/fdlibm/src/math_private.h:34:21: + # error: conflicting declaration ‘typedef __double_t double_t’ + # /usr/include/math.h:156:21: note: previous declaration as ‘typedef long double double_t’ + echo "applying firefox-99.0.1-fdlibm-double.patch" + patch -p1 -i "$srcdir/firefox-99.0.1-fdlibm-double.patch" ;; - x86_64) + x86_64) ;; - *) echo "no [ARCH-SPECIFIC CONFIG] for arch: ${CARCH}" ; return 1 ; + *) echo "no [ARCH-SPECIFIC CONFIG] for arch: ${CARCH}" ; return 1 ; ;; esac @@ -535,8 +539,7 @@ build() { export MOZ_NOSPAM=1 export MOZBUILD_STATE_PATH="$srcdir/mozbuild" # export MOZ_ENABLE_FULL_SYMBOLS=1 # anti-feature - # export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=pip # parabola policy violation - export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system + export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system # parabola policy # LTO needs more open files ulimit -n 4096 @@ -545,32 +548,32 @@ build() { ## [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" + aarch64|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/}" - - # try hard to tell ld and rust not to use too much memory (no lto, no debug info, etc.) - 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" + i686) + # -fno-plt with cross-LTO -> LLVM ERROR: Function Import: link error + CFLAGS="${CFLAGS/-fno-plt/}" + CXXFLAGS="${CXXFLAGS/-fno-plt/}" + + # try hard to tell ld and rust not to use too much memory (no lto, no debug info, etc.) + 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) + x86_64) ;; - *) echo "no [ARCH-SPECIFIC BUILD ENV] for arch: ${CARCH}" ; return 1 ; + *) echo "no [ARCH-SPECIFIC BUILD ENV] for arch: ${CARCH}" ; return 1 ; ;; esac export CFLAGS @@ -580,18 +583,18 @@ build() { ## [ARCH-SPECIFIC BUILD CONFIG] ## case ${CARCH} in - armv7h) + aarch64|armv7h) ;; - i686) - # /usr/bin/ld.bfd: error: libxul.so(.debug_info) is too large (0x54c5369a bytes) - options=( ${options[*]/\!strip/} ) + 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 + # 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) + x86_64) ;; - *) echo "no [ARCH-SPECIFIC BUILD CONFIG] for arch: ${CARCH}" ; return 1 ; + *) echo "no [ARCH-SPECIFIC BUILD CONFIG] for arch: ${CARCH}" ; return 1 ; ;; esac @@ -677,12 +680,12 @@ END [Global] id=parabola version=(${_brandingver} branding) -about=Iceweasel for Parabola GNU/Linux-libre -about.en-US=Iceweasel for Parabola GNU/Linux-libre -about.eo=Iceweasel por Parabola GNU/Linux-libre -about.es-ES=Iceweasel para Parabola GNU/Linux-libre -about.gl=Iceweasel para Parabola GNU/Linux-libre -about.pt-BR=Iceweasel para Parabola GNU/Linux-libre +about=${pkgname^} for Parabola GNU/Linux-libre +about.en-US=${pkgname^} for Parabola GNU/Linux-libre +about.eo=${pkgname^} por Parabola GNU/Linux-libre +about.es-ES=${pkgname^} para Parabola GNU/Linux-libre +about.gl=${pkgname^} para Parabola GNU/Linux-libre +about.pt-BR=${pkgname^} para Parabola GNU/Linux-libre [Preferences] app.distributor=parabola @@ -718,21 +721,21 @@ END ## [ARCH-SPECIFIC INSTALL] ## case ${CARCH} in - armv7h) + aarch64|armv7h) ;; - i686) - # libxul.so cannot find it's libraries - install -dm 755 "${pkgdir}/etc/ld.so.conf.d" - echo "/usr/lib/${pkgname}" > "${pkgdir}"/etc/ld.so.conf.d/${pkgname}.conf - - # disable stripping in mozconfig.<arch> (insists to use llvm-strip which runs - # out of memory on libxul.so. Now 2.5 GB can be strupped to 166 MB, so we do - # that with the normal 'strip' from binutils after 'mach install' - strip "$pkgdir/usr/lib/$pkgname/libxul.so" + i686) + # libxul.so cannot find it's libraries + install -dm 755 "${pkgdir}/etc/ld.so.conf.d" + echo "/usr/lib/${pkgname}" > "${pkgdir}"/etc/ld.so.conf.d/${pkgname}.conf + + # disable stripping in mozconfig.<arch> (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) + x86_64) ;; - *) echo "no [ARCH-SPECIFIC INSTALL] for arch: ${CARCH}" ; return 1 ; + *) echo "no [ARCH-SPECIFIC INSTALL] for arch: ${CARCH}" ; return 1 ; ;; esac |