diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2021-01-08 18:25:36 -0500 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2021-12-15 09:04:18 -0500 |
commit | 4660274f51d6dbb2b22463ab0f2ff40b8fac0ca6 (patch) | |
tree | a68435641bf557c736ecd5fe102decda331a6311 | |
parent | 49fef4a963e1b2163a000a6b65e2f4d61bd171ae (diff) |
REVERTME - [icecat]: failed attempts to pass antifeatures-check
-rw-r--r-- | libre/icecat/PKGBUILD | 262 |
1 files changed, 153 insertions, 109 deletions
diff --git a/libre/icecat/PKGBUILD b/libre/icecat/PKGBUILD index 7e19563a0..89893c7de 100644 --- a/libre/icecat/PKGBUILD +++ b/libre/icecat/PKGBUILD @@ -1,6 +1,6 @@ -# Maintainer (arch): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> -# Contributor: Ionut Biru <ibiru@archlinux.org> -# Contributor: Jakub Schmidtke <sjakub@gmail.com> +# Maintainer (Arch): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> +# Contributor (Arch): Ionut Biru <ibiru@archlinux.org> +# Contributor (Arch): Jakub Schmidtke <sjakub@gmail.com> # Contributor: Figue <ffigue at gmail> # Contributor: fauno <fauno@kiwwwi.com.ar> # Contributor: evr <evanroman at gmail> @@ -15,66 +15,60 @@ # Contributor: grizzlyuser <grizzlyuser@protonmail.com> -# NOTE: icecat (60.7 < V <= 78.10) are not upstream releases +# NOTE: icecat (60.7 < V <= 78.6) are not upstream releases # upstream releases would normally have '-gnu' appended to $_upstream_ver # this build is based on gnuzilla VCS developement sources -# rev: b72c22186cf381d7b1f93be550c9da30865d03b4 +# rev: a43514623e93d4f3fe6d61f5b2f82c5ef29bf518 pkgname=icecat -_upstream_ver=78.10.0-pre2 # -gnu1 +_upstream_ver=78.6.0 # -gnu pkgver=${_upstream_ver//-/_} pkgrel=1 -pkgdesc="the GNU web browser, based on Mozilla Firefox ESR" +pkgdesc="GNU IceCat - a libre standalone web browser based on Mozilla Firefox ESR" arch=(x86_64 i686 armv7h) 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=(unzip zip diffutils yasm mesa imake inetutils xorg-server-xvfb + autoconf2.13 rust clang llvm jack gtk2 nodejs cbindgen nasm + python-setuptools python-psutil) 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[15]='cbindgen=0.15.0' # FIXME: FTBS against cbindgen v0.16.0 + # dom/webgpu/ipc/WebGPUParent.cpp:426:29: error: no member named '_0' in 'mozilla::webgpu::ffi::WGPUBufferBinding' + # dom/webgpu/ipc/WebGPUParent.cpp:432:34: error: member reference base type 'mozilla::webgpu::ffi::WGPUTextureViewId' (aka 'unsigned long') is not a structure or union 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://repo.parabola.nu/other/${pkgname}/${pkgname}-${_upstream_ver}.tar.bz2{,.sig} - icecat.desktop icecat-safe.desktop +source=(https://repo.parabola.nu/other/${pkgname}/${pkgname}-${_upstream_ver}-pre.tar.bz2{,.sig} 0001-Use-remoting-name-for-GDK-application-names.patch - rust_1.48.patch.gz) + rust-1.48_icecat-78.6.0.patch + ${pkgname}.desktop) source+=(searchplugins_list.json - 9003-misc-libre.patch) -source_i686=('rust-static-disable-network-test-on-static-libraries.patch') -sha256sums=('f4334ab97a30bf8e8fe400c55ed00fcea1d44536dc6df1c7f65fec8eae1664a3' + libre.patch) +sha256sums=('edcbdf85d74408420427d2959e1709327fbe7a2ce6810045df4aeb3a70f14555' 'SKIP' - 'e00dbf01803cdd36fd9e1c0c018c19bb6f97e43016ea87062e6134bdc172bc7d' - '33dd309eeb99ec730c97ba844bf6ce6c7840f7d27da19c82389cdefee8c20208' - 'e0eaec8ddd24bbebf4956563ebc6d7a56f8dada5835975ee4d320dd3d0c9c442' - 'c7f867ccee684939c9f0a9c30ea69127077bbe43af545a03f09dfbbdc02545a9') -sha256sums+=('3edb4add450f94c579f2df7c16ac4d9bd9f5c6acf3fbd8a05ce24c21c317257d' - '28029afa3201e1be8138be06f741c59d64869edf0c9e90dbb05cfa6b5fff4ecd') -sha256sums_i686=('068efe37a99561490e6ec7b70a3cd4dd84e89e6bdf19f04a475d06c78fd28920') -validpgpkeys=('318C679D94F17700CC847DE646A70073E4E50D4E') # Ruben Rodriguez -validpgpkeys+=('3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger (VCS builds) + '3bb7463471fb43b2163a705a79a13a3003d70fff4bbe44f467807ca056de9a75' + 'd90faa59dc59f457c5770b3cc1ee4caa5b255e754ab9ab3993af894992c007e4' + 'f9f954fd06739e70a72ccf4774cfa71f349a4b133ec8f5dea0a3bcca2cf7321d' + '3edb4add450f94c579f2df7c16ac4d9bd9f5c6acf3fbd8a05ce24c21c317257d' + '28029afa3201e1be8138be06f741c59d64869edf0c9e90dbb05cfa6b5fff4ecd') +validpgpkeys=('318C679D94F17700CC847DE646A70073E4E50D4E' # Ruben Rodriguez + '3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger # 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 +_should_skip_pgo_x86_64=1 # disable for x86_64 - libremakepkg eval "_should_skip_pgo=\$_should_skip_pgo_${CARCH}" _check_build_config() { - pushd "${srcdir}"/${pkgname}-${pkgver%_*} > /dev/null + pushd "$srcdir/$pkgname-${pkgver%_*}" > /dev/null echo "Checking build configuration..." @@ -87,24 +81,17 @@ _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 && 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 - - # return 1 # FIXME: .datareporting is detected + for key in ${antifeatures[@]} ; do echo " - ${key} is enabled" ; done ; + # FIXME: - .datareporting is enabled + return 1 fi popd > /dev/null @@ -118,7 +105,7 @@ prepare() { 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 + patch -Np1 -i ../rust-1.48_icecat-78.6.0.patch cat >../mozconfig <<END ac_add_options --enable-application=browser @@ -140,6 +127,7 @@ ac_add_options --enable-update-channel=release ac_add_options --with-distribution-id=nu.parabola ac_add_options --with-unsigned-addon-scopes=app,system ac_add_options --allow-addon-sideload +export MOZILLA_OFFICIAL= export MOZ_APP_NAME=${pkgname} export MOZ_APP_REMOTINGNAME=${pkgname} export MOZ_TELEMETRY_REPORTING= @@ -158,21 +146,28 @@ ac_add_options --disable-crashreporter ac_add_options --disable-updater ac_add_options --disable-tests ac_add_options --disable-eme + + +# REVERTME: unsuccessful attempt to fix the failing _check_build_config() +# ac_add_options --disable-datareporting # FIXME: no such option +# ac_add_options --disable-healthreport # FIXME: no such option +# ac_add_options --disable-normandy # FIXME: no such option +# ac_add_options --disable-telemetry # FIXME: no such option END ## [ARCH-SPECIFIC CONFIG] ## + # TODO: this per-arch handling is yet to be re-worked for armv7h and i686 case "${CARCH}" in - armv7h) -# TODO: re-work for armv7h -# sed -i '/--enable-linker=gold/d' ../mozconfig -# sed -i '/--enable-rust-simd/d' ../mozconfig + armv*) +# 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 +# cat >> .mozconfig <<END #ac_add_options --enable-optimize="-g -O2 -fno-schedule-insns" #ac_add_options --disable-elf-hack #ac_add_options --disable-webrtc @@ -180,14 +175,7 @@ END #END ;; 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 +# sed -i '/--enable-linker=gold/d' .mozconfig ;; x86_64) ;; @@ -200,18 +188,7 @@ END 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 + # replace default searchplugins cp -rv /usr/share/mozilla/searchplugins/* . find -mindepth 1 -maxdepth 1 \ -not -name ddg \ @@ -227,6 +204,17 @@ END -not -name list.json \ -exec rm -rf {} \; + # Patch search-engines config + 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 + # Sanity-check search-engines patching local engines_err_msg="search-engines patching needs re-working" jq < list.json || ! echo "${engines_err_msg}" @@ -236,63 +224,113 @@ END ## 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 + # Disable various components at the source level + # REVERTME: unsuccessful attempt to fix the failing _check_build_config() + # these two LOCs allow _check_build_config() to pass for iceweasel; + # but is not sufficient for icecat (v78.6.0) + # the second LOC is already handled in the gnuzilla source + sed -i 's/;1/;0/' toolkit/components/telemetry/components.conf +# sed -Ei 's/((MOZ_SERVICES_HEALTHREPORT|MOZ_NORMANDY).+)True/\1False/' browser/moz.configure + + # REVERTME: unsuccessful attempt to fix the failing _check_build_config() + # also tried 'MOZ_CRASHREPORTER' # unknown key + # also tried 'MOZ_UPDATE_CHANNEL' # unknown key + # also tried 'MOZ_SERVICES_HEALTHREPORTER' # unknown key + # also tried 'MOZ_SERVICES_METRICS' # unknown key + # also tried 'MOZ_DATA_REPORTING' # unknown key + sed -i "s|\(.*MOZ_NORMANDY.*\)|\1\nimply_option('MOZ_TELEMETRY_REPORTING', False)|" browser/moz.configure + + # REVERTME: unsuccessful attempt to fix the failing _check_build_config() +# echo 'pref("toolkit.telemetry.unified", false);' >> browser/app/profile/${pkgname}.js + + # Patch and remove anything that's left + echo "applying libre.patch" + patch -Np1 -i "${srcdir}"/libre.patch } build() { cd "$srcdir/$pkgname-${pkgver%_*}" - ## build env ## - export MOZ_NOSPAM=1 export MOZBUILD_STATE_PATH="$srcdir/mozbuild" export MACH_USE_SYSTEM_PYTHON=1 + + # REVERTME: unsuccessful attempt to fix the failing _check_build_config() +# export MOZ_TELEMETRY_REPORTING= +# export MOZ_REQUIRE_SIGNING= +# export MOZ_SERVICES_HEALTHREPORT= +# export MOZ_CRASHREPORTER= +# export MOZ_UPDATE_CHANNEL= +# export MOZ_PAY= +# export MOZ_SERVICES_HEALTHREPORTER= +# export MOZ_SERVICES_FXACCOUNTS= +# export MOZ_SERVICES_METRICS= +# export MOZ_DATA_REPORTING= +# #export MOZ_NORMANDY=0 # NFG: must not be set in environment +# #export MOZ_SERVICES_SYNC=0 # NFG: must not be set in environment +# export MOZ_DEVICES= + +# export MOZ_SERVICES_FXACCOUNTS=1 # TODO: this may be needed for the sync feature +# export MOZ_SERVICES_SYNC=1 # TODO: this may be needed for the sync feature + + # 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] ## + # TODO: this per-arch handling is yet to be re-worked for armv7h and i686 case "${CARCH}" in - armv7h) -# TODO: re-work for armv7h + armv*) + # clang-{9,10,11} -> error: unknown argument: '-fvar-tracking-assignments' +# CFLAGS="${CFLAGS/-fvar-tracking-assignments/}" +# CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}" +# # export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off" # export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +# export CFLAGS +# export CXXFLAGS ;; i686) # -fno-plt with cross-LTO -> LLVM ERROR: Function Import: link error - CFLAGS="${CFLAGS/-fno-plt/}" - CXXFLAGS="${CXXFLAGS/-fno-plt/}" +# 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" +# export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off" +# export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads" +# export CFLAGS +# export CXXFLAGS ;; x86_64) + # clang-{9,10,11} -> error: unknown argument: '-fvar-tracking-assignments' + CFLAGS="${CFLAGS/-fvar-tracking-assignments/}" + CXXFLAGS="${CXXFLAGS/-fvar-tracking-assignments/}" + + # TODO: this may only be needed for v78 + # -fno-plt with cross-LTO causes obscure LLVM errors + # LLVM ERROR: Function Import: link error + CFLAGS="${CFLAGS/-fno-plt/}" + CXXFLAGS="${CXXFLAGS/-fno-plt/}" + + export CFLAGS + export CXXFLAGS ;; *) echo "no [ARCH-SPECIFIC BUILD ENV] for arch: ${CARCH}" ; return 1 ; ;; esac - export CFLAGS - export CXXFLAGS ## [ARCH-SPECIFIC BUILD CONFIG] ## + # TODO: this per-arch handling is yet to be re-worked for armv7h and i686 case ${CARCH} in armv7h) -# TODO: re-work for 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 +# sed -i "s/debug_info = '\''2'\''/debug_info = '\''0'\''/" build/moz.configure/toolchain.configure ;; x86_64) ;; @@ -300,9 +338,6 @@ build() { ;; esac - - ## PGO build ## - if (( $_should_skip_pgo )) then # skipping "3-tier PGO" "instrumented browser", to avoid OOM problems; @@ -391,18 +426,24 @@ 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/icon64.png \ + "$pkgdir/usr/share/icons/hicolor/64x64/apps/$pkgname.png" + install -Dvm644 browser/branding/$theme/mozicon128.png \ + "$pkgdir/usr/share/icons/hicolor/128x128/apps/$pkgname.png" + 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/identity-icons-brand.svg \ + "$pkgdir/usr/share/icons/hicolor/symbolic/apps/$pkgname-symbolic.svg" + + 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 @@ -413,11 +454,14 @@ END ## [ARCH-SPECIFIC INSTALL] ## + # TODO: this per-arch handling is yet to be re-worked for armv7h and i686 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 ;; x86_64) ;; |