summaryrefslogtreecommitdiff
path: root/libre/icecat/PKGBUILD
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-12-21 06:10:41 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2021-01-08 18:49:01 -0500
commitc119d03f02d8f3f7f8244d27eb48933fcf8ba818 (patch)
treea224638c0157bfd1dbf9a5b21b303b7db1246905 /libre/icecat/PKGBUILD
parent10775484b9735cd754fa9284a6bb75e35827f6d2 (diff)
downloadabslibre-c119d03f02d8f3f7f8244d27eb48933fcf8ba818.tar.gz
abslibre-c119d03f02d8f3f7f8244d27eb48933fcf8ba818.tar.bz2
abslibre-c119d03f02d8f3f7f8244d27eb48933fcf8ba818.zip
[icecat]: upgrade to v78.6.0
Diffstat (limited to 'libre/icecat/PKGBUILD')
-rw-r--r--libre/icecat/PKGBUILD343
1 files changed, 223 insertions, 120 deletions
diff --git a/libre/icecat/PKGBUILD b/libre/icecat/PKGBUILD
index ab4f84fb4..eef0d52df 100644
--- a/libre/icecat/PKGBUILD
+++ b/libre/icecat/PKGBUILD
@@ -11,19 +11,18 @@
# Contributor: Luke Shumaker <lukeshu@parabola.nu>
# Contributor: Márcio Silva <coadde@hyperbola.info>
# Maintainer: Andreas Grapentin <andreas@grapentin.org>
+# Contributor: bill-auger <bill-auger@programmer.net>
+# Contributor: grizzlyuser <grizzlyuser@protonmail.com>
-# NOTE: icecat (60.7 < V <= 78.4) 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: 05adddbf87a5ee11de7cd90794c331a178bcfd5c
+# rev: a43514623e93d4f3fe6d61f5b2f82c5ef29bf518
-# needed for the !(...) matching in prepare()
-shopt -s extglob
-
pkgname=icecat
-_upstream_ver=78.4.0 # -gnu
+_upstream_ver=78.6.0 # -gnu
pkgver=${_upstream_ver//-/_}
pkgrel=1
pkgdesc="GNU IceCat - a libre standalone web browser based on Mozilla Firefox ESR"
@@ -33,8 +32,11 @@ 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 gtk2 nodejs cbindgen nasm
- python-setuptools python-psutil lld)
+ python-setuptools python-psutil)
makedepends+=(mozilla-searchplugins jq)
+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'
@@ -42,21 +44,49 @@ optdepends=('networkmanager: Location detection via available WiFi networks'
'hunspell-en_US: Spell checking, American English')
options=(!emptydirs !makeflags !strip)
source=(https://repo.parabola.nu/other/${pkgname}/${pkgname}-${_upstream_ver}-pre.tar.bz2{,.sig}
- ${pkgname}.desktop
0001-Use-remoting-name-for-GDK-application-names.patch
- rust_1.48.patch.gz)
-source+=(libre.patch
- mozilla-1663715.patch)
-sha256sums=('314171bb68cd8b0fb7b880a77f3a2daa65acd660fc6f2a7d6871c5a5ba44be52'
+ rust-1.48_icecat-78.6.0.patch
+ ${pkgname}.desktop)
+source+=(searchplugins_list.json
+ libre.patch)
+sha256sums=('edcbdf85d74408420427d2959e1709327fbe7a2ce6810045df4aeb3a70f14555'
'SKIP'
- 'f9f954fd06739e70a72ccf4774cfa71f349a4b133ec8f5dea0a3bcca2cf7321d'
'3bb7463471fb43b2163a705a79a13a3003d70fff4bbe44f467807ca056de9a75'
- 'd32c87c4526e897d64453914da43f99366d1d0b7d71e43b4027a6cb5aa274040'
- '28029afa3201e1be8138be06f741c59d64869edf0c9e90dbb05cfa6b5fff4ecd'
- '665cf25255fd240f79d5d010b3c3764f2d80aa81fdc7b6e9a9728e4a7970685b')
+ '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=1 # disable for x86_64 - libremakepkg
+eval "_should_skip_pgo=\$_should_skip_pgo_${CARCH}"
+
+
+_check_build_config() {
+ 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 object_directory=$(./mach environment | sed -En '/object directory:/{n;s/^\s+//;p;}')
+ local jq_cmd='[.crashreporter, .datareporting, .healthreport, .normandy, .telemetry, .updater] | any(. != false)'
+ local features_not_disabled=$(cat "$object_directory/mozinfo.json" | jq -e "${jq_cmd}")
+ if $features_not_disabled; then
+ echo 'Some features are not disabled correctly in build configuration files, aborting.'
+# return 1
+ fi
+}
+
prepare() {
mkdir -p mozbuild
cd "$srcdir/$pkgname-${pkgver%_*}"
@@ -65,10 +95,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
-
- # https://bugzilla.mozilla.org/show_bug.cgi?id=1663715
- patch -Np1 -i ../mozilla-1663715.patch
+ patch -Np1 -i ../rust-1.48_icecat-78.6.0.patch
cat >../mozconfig <<END
ac_add_options --enable-application=browser
@@ -78,8 +105,6 @@ ac_add_options --enable-release
ac_add_options --enable-hardening
ac_add_options --enable-optimize
ac_add_options --enable-rust-simd
-ac_add_options --enable-linker=lld
-ac_add_options --disable-elf-hack
export CC='clang --target=x86_64-unknown-linux-gnu'
export CXX='clang++ --target=x86_64-unknown-linux-gnu'
export AR=llvm-ar
@@ -112,7 +137,12 @@ ac_add_options --disable-updater
ac_add_options --disable-eme
END
-# if [[ $CARCH = arm* ]]; then
+
+ ## [ARCH-SPECIFIC CONFIG] ##
+
+ # TODO: this per-arch handling is yet to be re-worked for armv7h and i686
+ case "${CARCH}" in
+ armv*)
# sed -i '/--enable-linker=gold/d' .mozconfig
# sed -i '/--enable-rust-simd/d' .mozconfig
#
@@ -125,51 +155,60 @@ END
#ac_add_options --disable-webrtc
#ac_add_options --disable-av1
#END
-# fi
-#
-# if [[ $CARCH = i686 ]]; then
+ ;;
+ i686)
# sed -i '/--enable-linker=gold/d' .mozconfig
-# fi
-
- # install our searchengines
- locales=( $(jq ".locales|keys|.[]" < browser/components/search/extensions/list.json) )
- rm -rv browser/components/search/extensions/!(wikipedia)
- cp -rv /usr/share/mozilla/searchplugins/* browser/components/search/extensions/
- cat > browser/components/search/extensions/list.json << EOF
-{
- "default": {
- "visibleDefaultEngines": [
- "duckduckgo-html", "duckduckgo-lite", "internet-archive", "parabola-packages", "parabola-wiki", "searx", "wikipedia", "yacy"
- ]
- },
- "regionOverrides": {
- },
- "locales": {
-EOF
-
- comma=","
- for locale in "${locales[@]}"; do
- [ "$locale" != "${locales[-1]}" ] || comma=""
- cat >> browser/components/search/extensions/list.json << EOF
- $locale: {
- "default": {
- "visibleDefaultEngines": [
- "duckduckgo-html", "duckduckgo-lite", "internet-archive", "parabola-packages", "parabola-wiki", "searx", "wikipedia", "yacy"
- ]
- }
- }$comma
-EOF
- done
-
- cat >> browser/components/search/extensions/list.json << EOF
- }
-}
-EOF
- # quick syntax check
- jq < browser/components/search/extensions/list.json
+ ;;
+ x86_64)
+ ;;
+ *) echo "no [ARCH-SPECIFIC CONFIG] for arch: ${CARCH}" ; return 1 ;
+ ;;
+ esac
+
+
+ ## searchengines ##
+
+ pushd browser/components/search/extensions > /dev/null
+
+ # replace default searchplugins
+ 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 {} \;
+
+ # 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}"
+
+ popd > /dev/null
+
+
+ ## libre patching ##
# Patch and remove anything that's left
- patch -Np1 -i "$srcdir/libre.patch"
+ echo "applying libre.patch"
+ patch -Np1 -i "${srcdir}"/libre.patch
}
build() {
@@ -177,59 +216,125 @@ build() {
export MOZ_NOSPAM=1
export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
-
-# if [[ $CARCH = armv7h ]]; then
-# export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off"
-# export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
-# fi
-#
-# if [[ $CARCH = i686 ]]; then
-# export RUSTFLAGS+=" -Cdebuginfo=0 -Clto=off"
-# export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
-# fi
+ export MACH_USE_SYSTEM_PYTHON=1
# LTO needs more open files
ulimit -n 4096
- # -fno-plt with cross-LTO causes obscure LLVM errors
- # LLVM ERROR: Function Import: link error
- CFLAGS="${CFLAGS/-fno-plt/}"
- CXXFLAGS="${CXXFLAGS/-fno-plt/}"
- # Do 3-tier PGO
- echo "Building instrumented browser..."
- cat >.mozconfig ../mozconfig - <<END
+ ## [ARCH-SPECIFIC BUILD ENV] ##
+
+ # TODO: this per-arch handling is yet to be re-worked for armv7h and i686
+ case "${CARCH}" in
+ 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/}"
+
+# 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
+
+
+ ## [ARCH-SPECIFIC BUILD CONFIG] ##
+
+ # TODO: this per-arch handling is yet to be re-worked for armv7h and i686
+ case ${CARCH} in
+ 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
+ ;;
+ x86_64)
+ ;;
+ *) echo "no [ARCH-SPECIFIC BUILD CONFIG] for arch: ${CARCH}" ; return 1 ;
+ ;;
+ esac
+
+ 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 - <<END
ac_add_options --enable-profile-generate=cross
END
- ./mach build
-
- echo "Profiling instrumented browser..."
- ./mach package
- LLVM_PROFDATA=llvm-profdata \
- JARLOG_FILE="$PWD/jarlog" \
- xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" \
- ./mach python build/pgo/profileserver.py
-
- stat -c "Profile data found (%s bytes)" merged.profdata
- test -s merged.profdata
-
- stat -c "Jar log found (%s bytes)" jarlog
- test -s jarlog
+ _check_build_config
+ ./mach build
+
+ echo "Profiling instrumented browser..."
+ ./mach package
+ LLVM_PROFDATA=llvm-profdata \
+ JARLOG_FILE="$PWD/jarlog" \
+ 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
+
+ if [[ ! -s jarlog ]]; then
+ echo "No jar log produced."
+ return 1
+ fi
echo "Removing instrumented browser..."
./mach clobber
- echo "Building optimized browser..."
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
ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog
END
- ./mach build
+ fi # $_should_skip_pgo
+
+
+ ## 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
+ _check_build_config
+
-# echo "Building symbol archive..."
-# ./mach buildsymbols
+ ## main build ##
+
+ echo "Building optimized browser..."
+ ./mach build
}
package() {
@@ -249,26 +354,6 @@ pref("browser.shell.checkDefaultBrowser", false);
// Don't disable extensions in the application directory
pref("extensions.autoDisableScopes", 11);
-pref("extensions.shownSelectionUI", true);
-
-// Disable "alt" as a shortcut key to open full menu bar. Conflicts with "alt" as a modifier
-pref("ui.key.menuAccessKeyFocuses", false);
-
-// Make sure that Firefox Social stuff are empty
-pref("social.whitelist", "");
-pref("social.directories", "");
-
-// Disable the GeoLocation API for content
-pref("geo.enabled", false);
-
-// Make sure that the request URL of the GeoLocation backend is empty
-pref("geo.wifi.uri", "");
-
-// Disable the least secure encryption protocols
-pref("security.ssl3.ecdhe_ecdsa_rc4_128_sha", false);
-pref("security.ssl3.ecdhe_rsa_rc4_128_sha", false);
-pref("security.ssl3.rsa_rc4_128_md5", false);
-pref("security.ssl3.rsa_rc4_128_sha", false);
END
local distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini"
@@ -309,6 +394,24 @@ END
exec /usr/lib/$pkgname/$pkgname "\$@"
END
+
+ ## [ARCH-SPECIFIC INSTALL] ##
+
+ # TODO: this per-arch handling is yet to be re-worked for armv7h and i686
+ case ${CARCH} in
+ 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)
+ ;;
+ *) 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"