diff options
Diffstat (limited to 'libre/icecat/PKGBUILD')
-rw-r--r-- | libre/icecat/PKGBUILD | 323 |
1 files changed, 173 insertions, 150 deletions
diff --git a/libre/icecat/PKGBUILD b/libre/icecat/PKGBUILD index 7e19563a0..e2d101649 100644 --- a/libre/icecat/PKGBUILD +++ b/libre/icecat/PKGBUILD @@ -15,62 +15,60 @@ # Contributor: grizzlyuser <grizzlyuser@protonmail.com> -# NOTE: icecat (60.7 < V <= 78.10) are not upstream releases -# upstream releases would normally have '-gnu' appended to $_upstream_ver +# 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 -# rev: b72c22186cf381d7b1f93be550c9da30865d03b4 +# rev: 65a61287a5142a9403ec00d973cb5e5d658a3c71 +# with parabola patches applied +# https://git.parabola.nu/~bill-auger/icecat.git/log/?h=parabola pkgname=icecat -_upstream_ver=78.10.0-pre2 # -gnu1 +_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=(x86_64 i686 armv7h) +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=(m4 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) -makedepends+=(mozilla-searchplugins jq) -if [[ "${CARCH}" == 'i686' ]] -then makedepends=(${makedepends[*]/llvm/llvm10}) # FIXME: i686 configure fails with LLVM11 - # rustup: error while loading shared libraries: libLLVM-10.so - makedepends=(${makedepends[*]/rust/rust=1:1.47.0}) # FIXME: Sandbox: seccomp sandbox violation -else makedepends=(${makedepends[*]/rust/rust=1:1.49.0}) # https://lists.gnu.org/archive/html/gnuzilla-dev/2021-04/msg00000.html -fi +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') -options=(!emptydirs !makeflags !strip) + '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 - rust_1.48.patch.gz) -source+=(searchplugins_list.json - 9003-misc-libre.patch) -source_i686=('rust-static-disable-network-test-on-static-libraries.patch') -sha256sums=('f4334ab97a30bf8e8fe400c55ed00fcea1d44536dc6df1c7f65fec8eae1664a3' +) +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' - 'e0eaec8ddd24bbebf4956563ebc6d7a56f8dada5835975ee4d320dd3d0c9c442' - 'c7f867ccee684939c9f0a9c30ea69127077bbe43af545a03f09dfbbdc02545a9') -sha256sums+=('3edb4add450f94c579f2df7c16ac4d9bd9f5c6acf3fbd8a05ce24c21c317257d' - '28029afa3201e1be8138be06f741c59d64869edf0c9e90dbb05cfa6b5fff4ecd') -sha256sums_i686=('068efe37a99561490e6ec7b70a3cd4dd84e89e6bdf19f04a475d06c78fd28920') -validpgpkeys=('318C679D94F17700CC847DE646A70073E4E50D4E') # Ruben Rodriguez + 'a7f5ae9f018678a391739365329a5a5b527b536bc9aac441c73ae811d2fa530d' +) +sha256sums_armv7h=('bc00516032330760444939c516a60c78f868631e1b37f075f0fe71a53737b966' + '2d4d91f7e35d0860225084e37ec320ca6cae669f6c9c8fe7735cdbd542e3a7c9') +sha256sums_i686=('2f0c81a38c4578f68f5456b618fe84a78974072821488173eb55e0e72287e353' + '10c5276eab2e87f400a6ec15d7ffbef3b0407ee888dea36f1128927ca55b9041') validpgpkeys+=('3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger (VCS builds) -# PGO requires networking -_should_skip_pgo_armv7h=1 # disable for armv7h - always -_should_skip_pgo_i686=1 # disable for i686 - always -_should_skip_pgo_x86_64=0 # disable for x86_64 - libremakepkg -eval "_should_skip_pgo=\$_should_skip_pgo_${CARCH}" +# disable PGO for 32-bit arches +_should_skip_pgo=0 # for x86_64 +[[ "${CARCH}" != 'armv7h' && "${CARCH}" != 'i686' ]] || _should_skip_pgo=1 _check_build_config() { @@ -87,24 +85,20 @@ _check_build_config() { # 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 mozinfo_json="${obj_directory}"/mozinfo.json - local antifeature_keys=('.crashreporter' '.datareporting' '.healthreport' '.normandy' '.telemetry' '.updater') + local antifeature_keys=(.crashreporter .datareporting .healthreport .normandy .telemetry .updater) local antifeatures=() - local jq_cmd=( jq -e "${key} != false" "${mozinfo_json}" ) - - printf "\$mozinfo_json %s - obj_directory is: %s\n" \ - "$( [[ -f "${mozinfo_json}" ]] || printf "not " )found" \ - "${obj_directory}" - - for key in ${antifeature_keys[@]} ; do ${jq_cmd[@]} && antifeatures+=(${key}); done ; + 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 ${antifeature_keys[@]} - do echo "${key} - $( ${jq_cmd[@]} || echo "not " )detected\n" - done + for key in ${antifeatures[@]} ; do echo " - ${key} is enabled" ; done ; - # return 1 # FIXME: .datareporting is detected + [[ -z "${ar[*]/.datareporting/}" ]] && return 0 # FIXME: .datareporting is detected + + return 1 fi popd > /dev/null @@ -117,35 +111,34 @@ prepare() { # 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 +# # https://bugzilla.mozilla.org/show_bug.cgi?id=1667736 +# patch -Np1 -i ../rust_1.48.patch cat >../mozconfig <<END ac_add_options --enable-application=browser +mk_add_options MOZ_OBJDIR=${PWD@Q}/obj ac_add_options --prefix=/usr ac_add_options --enable-release ac_add_options --enable-hardening ac_add_options --enable-optimize ac_add_options --enable-rust-simd -export CC='clang --target=x86_64-unknown-linux-gnu' -export CXX='clang++ --target=x86_64-unknown-linux-gnu' -export AR=llvm-ar -export NM=llvm-nm -export RANLIB=llvm-ranlib +ac_add_options --enable-linker=lld +ac_add_options --disable-elf-hack +ac_add_options --disable-bootstrap # Branding ac_add_options --enable-official-branding 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-unsigned-addon-scopes=app,system ac_add_options --allow-addon-sideload -export MOZ_APP_NAME=${pkgname} +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= -ac_add_options --with-app-basename=${pkgname} -ac_add_options --with-app-name=${pkgname} # System libraries ac_add_options --with-system-nspr @@ -161,84 +154,83 @@ ac_add_options --disable-eme 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 - armv7h) -# TODO: re-work for armv7h -# sed -i '/--enable-linker=gold/d' ../mozconfig -# sed -i '/--enable-rust-simd/d' ../mozconfig -# -# # https://bugzilla.mozilla.org/show_bug.cgi?id=1463035 -# patch -Np1 -i "$srcdir"/mozilla-1463035.patch -# -# cat >> ../mozconfig <<END -#ac_add_options --enable-optimize="-g -O2 -fno-schedule-insns" -#ac_add_options --disable-elf-hack -#ac_add_options --disable-webrtc -#ac_add_options --disable-av1 -#END + case ${CARCH} in + armv7h) + sed -i ' + /--enable-hardening/d + /--enable-optimize/d + /--enable-rust-simd/d + ' ../mozconfig + + cat >>../mozconfig <<END +export CC=clang +export CXX=clang++ +ac_add_options --disable-webrtc +ac_add_options --disable-elf-hack + +# https://bugzilla.redhat.com/show_bug.cgi?id=1641623 +ac_add_options --disable-av1 +ac_add_options --enable-optimize="-g0 -O2" +mk_add_options MOZ_MAKE_FLAGS='-j2' +END + + # 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 + + echo "applying arm.patch" + patch -p1 -i ../arm.patch + echo "applying build-arm-libopus.patch" + patch -p1 -i ../build-arm-libopus.patch ;; - i686) -# sed -i '/--enable-linker=gold/d' ../mozconfig - sed -i '/--enable-rust-simd/d' ../mozconfig - - # test failure in rust code (complaining about network functions) when PGO is used, - # TEST-UNEXPECTED-FAIL | check_networking | libgkrust.a | Identified 7 networking function(s) being imported in the rust static library (accept,connect,getsockname,getsockopt,listen,recv,send) - # see https://bugzilla.mozilla.org/show_bug.cgi?id=1565757 - echo "applying rust-static-disable-network-test-on-static-libraries.patch" - patch -Np0 -i ../rust-static-disable-network-test-on-static-libraries.patch + 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 +ac_add_options --disable-linker=lld +ac_add_options --enable-linker=bfd +ac_add_options --disable-lto +ac_add_options --disable-rust-simd +export CC=gcc-10 +export CXX=g++-10 +export AR=gcc-ar-10 +export NM=gcc-nm-10 +export RANLIB=gcc-ranlib-10 +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 ;; - 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 ## searchengines ## - pushd browser/components/search/extensions > /dev/null - - # Patch search-engines configs - cp "${srcdir}"/searchplugins_list.json list.json - sed -i 's|https://duckduckgo.com/|https://html.duckduckgo.com/html/|' ddg/manifest.json - - # Removing URL parameters that let DuckDuckGo know the place in UI - # the search was ran from (like address bar, context menu, etc.) - local jq_cmd='del(.chrome_settings_overrides.search_provider.params)' - jq "${jq_cmd}" ddg/manifest.json > manifest.json.tmp - ! diff manifest.json.tmp ddg/manifest.json > /dev/null - mv manifest.json.tmp ddg/manifest.json - - # Delete unused search engine configs - cp -rv /usr/share/mozilla/searchplugins/* . - find -mindepth 1 -maxdepth 1 \ - -not -name ddg \ - -not -name duckduckgo-html \ - -not -name duckduckgo-lite \ - -not -name internet-archive \ - -not -name parabola-labs \ - -not -name parabola-packages \ - -not -name parabola-wiki \ - -not -name searx \ - -not -name wikipedia \ - -not -name yacy \ - -not -name list.json \ - -exec rm -rf {} \; - - # Sanity-check search-engines patching - local engines_err_msg="search-engines patching needs re-working" - jq < list.json || ! echo "${engines_err_msg}" - - popd > /dev/null + # let's use icecat's default search-engines ## libre patching ## - # Remove remaining non-free bits - echo "applying 9003-misc-libre.patch" - patch -Np1 --no-backup-if-mismatch -i "${srcdir}"/9003-misc-libre.patch + # let's assume that icecat is already FSDG-fit upstream } build() { @@ -260,12 +252,14 @@ build() { ## [ARCH-SPECIFIC BUILD ENV] ## - case "${CARCH}" in + case ${CARCH} in armv7h) -# TODO: re-work for armv7h -# export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off" -# export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" - ;; + 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/}" @@ -274,11 +268,18 @@ build() { # 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 @@ -287,16 +288,18 @@ build() { ## [ARCH-SPECIFIC BUILD CONFIG] ## case ${CARCH} in - armv7h) -# TODO: re-work for armv7h + armv7h) ;; - i686) - # 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 + 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) + 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 @@ -334,10 +337,10 @@ END return 1 fi - echo "Removing instrumented browser..." - ./mach clobber + echo "Removing instrumented browser..." + ./mach clobber - cat >.mozconfig ../mozconfig - <<END + cat >.mozconfig ../mozconfig - <<END ac_add_options --enable-lto=cross ac_add_options --enable-profile-use=cross ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata @@ -349,7 +352,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 @@ -384,6 +387,11 @@ END 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 [Preferences] app.distributor=parabola @@ -391,18 +399,26 @@ app.distributor.channel=$pkgname app.partner.parabola=parabola END - install -m755 -d ${pkgdir}/usr/share/applications - install -m755 -d ${pkgdir}/usr/share/pixmaps - - local i - for i in 16 32 48; do - install -Dm644 browser/branding/official/default${i}.png \ - "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/${pkgname}.png" + local i theme=official + 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 -Dm644 browser/branding/official/default48.png "${pkgdir}"/usr/share/pixmaps/icecat.png - install -Dm644 "${srcdir}"/icecat.desktop "${pkgdir}"/usr/share/applications/ - install -Dm644 "${srcdir}"/icecat-safe.desktop "${pkgdir}"/usr/share/applications/ + 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-wordmark.svg \ + "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgname.svg" + install -Dvm644 browser/branding/$theme/content/identity-icons-brand.svg \ + "$pkgdir/usr/share/icons/hicolor/symbolic/apps/$pkgname-symbolic.svg" + 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 a wrapper to avoid confusion about binary path install -Dvm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END @@ -415,9 +431,16 @@ END case ${CARCH} in armv7h) -# TODO: re-work for 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" ;; x86_64) ;; |