Files
extra/iceweasel-uxp/PKGBUILD
2025-06-22 20:39:04 -05:00

189 lines
8.7 KiB
Bash

# Maintainer: Jesus E. <heckyel@riseup.net>
# Based on iceweasel-esr and basilisk packages
if [ "${CARCH}" = "i686" ]; then
_pgo=false
else
_pgo=true
fi
_pkgname=UXP
pkgname=iceweasel-uxp
_pkgver=2021.06.02
_appver=3.0
pkgver=52.9.${_pkgver//./}
pkgrel=5
pkgdesc="A new generation of Iceweasel, an XUL-based standalone web browser on the Unified XUL Platform (UXP)."
arch=(i686 x86_64)
license=(MPL-2.0)
depends=(ffmpeg gtk2 libevent libxt sndio hunspell)
makedepends=(autoconf-legacy diffutils xorg-imake mesa tauthon unzip yasm zip)
options=(!emptydirs !makeflags !strip debug)
if $_pgo; then
makedepends+=(xenocara-server-xvfb)
options+=(!ccache)
fi
optdepends=('speech-dispatcher: Text-to-Speech')
url="https://wiki.hyperbola.info/$pkgname"
replaces=('basilisk' 'firefox' 'firefox-esr' 'icecat' 'iceweasel' 'iceweasel-esr')
conflicts=('basilisk' 'firefox' 'firefox-esr' 'icecat' 'iceweasel' 'iceweasel-esr')
provides=('basilisk' 'firefox' 'firefox-esr' 'icecat' 'iceweasel' 'iceweasel-esr')
install=$pkgname.install
source=("https://repo.hyperbola.info:50000/other/$_pkgname/$_pkgname-$_pkgver.tar.gz"
"https://repo.hyperbola.info:50000/other/$pkgname/$pkgname-$_appver.tar.gz"
mozconfig
$pkgname.desktop
vendor.js
LICENSE
# Application patches
0001-Restore-risky-system-libraries.patch
0002-Add-iceweasel-uxp-application-specfic-override.patch
0003-Uplift-enable-proxy-bypass-protection-flag.patch
0004-Hardcode-AppName-in-nsAppRunner.patch
0005-Disable-SSLKEYLOGFILE-in-NSS.patch
0006-Fix-PGO-Build.patch
# build bustage work-around
0007-init-configure-patch.patch
# libcubeb patch
0008-Update-libcubeb-to-a1200c34.patch
0009-Tauthon.patch
# Additional application patches
0010-remove-malfunctional-searchplugins.patch
0011-$pkgname-install-dir.patch)
sha512sums=('4513e30b38229654f1d02a6f4ba7914408d2169a95884560a9b1024a33fab5292dce41e113be2959fd2efbd8abd0763926352ee4362606a03700cb3ac53aeffa'
'f78df3239819b5be0887757fba3c1f9f422f2bd69299d76d15f2d5c71b3fe69492ac962a447e5b0fac2a0b3c03d77b72531dbde31399fe1e31a20e72ae7e0b2f'
'b81e56ff312d22a9c32a9719fa8dfb1b3d6a3c94bcf697aa77b0df62f440a82ed49684de8486993c38940af1ea6ade44f9d5dcdbc41450a7157a8c2081363c5c'
'42f0003895200da7a311226d6a14245c667a1ed1c643b7a2a0f2676d2b30e0881c6198909eead14777584bb6f81733205503e6a15c78ed581d39d5bfb6b95ec4'
'eea256d545108077f90d0351ec6e43029c1d687bf532795176504b8e35e17a68b45f78395126f32f091e54adfd9209b22d361e8d07085a0b2eaf5edd3ddcdb58'
'5b49d98ce0740ced95de8b8b39a886ee8bc5071302c4c20dbe0421b27dd1ff1aed13115819fc5fd8309745f91a94cf4c8038cf993c6237a536010185727cd7c9'
'45bb48b4d8436ef0d9535d3891848bafc3c80ff187597591533eab70a0b160eb2825c4856698e813e5858f8baaf9f054abbcd5ce6d2763a374ef3d1917952f27'
'21b137b200a3c2cd91ae6b80a704d1c82c03c590d7f6215135c7bf32a8d4c6ebf7526fe7ec52321e9a2513b11d18418d2aaddea4171a31a3c726a2e02b761118'
'140dec7c094c04a1180655136d85b0f921bb7461298ff1f5d02721373be838a732aeb9684550857574ce4d056f26873f28bd7e4371ee602dc73f64d0ff5ec1fe'
'23e1c095820165a3d35f10c0eb2e4e4cf62296bb8b16d18b9bf4aefadd641539a710bb4907285ac6e014a70d6986ac9c38ebe718d11fb3a8333770dcf153ffbd'
'4d87565a2ce99a135130fa4340f2f6ab29330d7b7e8eb40607c69951b6e807733e4dc2885bd0082c658605809103ac445d67849183ce1d5ed5aaf21dd412b1ef'
'787e271adba2f802737e381aa370331570b2d5254e05d524dc0dd1c941839f9e38a725964104c1e51ba41bb0d585b295eb864477bb66768b19646fb0815ffb9d'
'090773648376a996f03094309dd66c3b868a8923d544a02abc44eb8c374603e0126ae72182d9f6c9030fbddefc5d8cdd4d7ca7c817ac02bceb9fba6f3bb27f33'
'76f4bac91536785eadfc4bc5a220b586f34acbe36e22b16d65163c0bebf767740d1c65e0f86fe8db550749aa53736d1c735b78b879742834202d7ca9e01f98da'
'07a2e719c372efc56c595a70a7faebccbee80a15739ffc8da4a47e054f914b897f8998a83852d39840a223130b521f2b58328a547994cf58f7685afd6238e63f'
'e39f63f0f9adcdaf688b0d91030fb5aa2690ee8ccf97049b84f3bc19a61ba0ec09a3b61df2c15707674eb3aaf56e80fc2cb6709c3f6fbef3133c92f07faecb82'
'30d607ed2e6c0da75930a87191c4a703f47ca918bb33748bd5f62e3f7fd6846605b65aa1f3825da48bb9828188ef784fd3c953a0673c60a28dfa8a74a13195c1')
prepare() {
# Move our application into the Unified XUL Platform
cd "$srcdir/$_pkgname-$_pkgver"
mkdir -p application
mv "$srcdir/$pkgname-$_appver" application/$pkgname
# Allow us to build with system libs (this is not recommended/untested per UXP devs)
patch -p1 -i "$srcdir/0001-Restore-risky-system-libraries.patch"
# Apply Iceweasel-UXP application specific overrides to UXP
patch -p1 -i "$srcdir/0002-Add-iceweasel-uxp-application-specfic-override.patch"
# Uplift enable-proxy-bypass-protection flag
patch -p1 -i "$srcdir/0003-Uplift-enable-proxy-bypass-protection-flag.patch"
# Hardcode AppName in nsAppRunner
patch -p1 -i "$srcdir/0004-Hardcode-AppName-in-nsAppRunner.patch"
# Disable SSLKEYLOGFILE in NSS
patch -p1 -i "$srcdir/0005-Disable-SSLKEYLOGFILE-in-NSS.patch"
# Fix PGO build
patch -p1 -i "$srcdir/0006-Fix-PGO-Build.patch"
# Apply configure fix (Next release)
patch -p1 -i "$srcdir/0007-init-configure-patch.patch"
# Apply and update libcubeb for sndio support
patch -p1 -i "$srcdir/0008-Update-libcubeb-to-a1200c34.patch"
# Apply Tauthon patch instead of using Python
patch -p1 -i "$srcdir/0009-Tauthon.patch"
# Remove bad credit records for some CA issuers such as CNNIC, StartCom, Symantec and WoSign
sed -e '/^# Certificate .*\(CNNIC\|China\|GDCA\|StartCom\|Symantec\|UCA\|WoSign\)/,/^CKA_TRUST_STEP_UP_APPROVED/d' \
-i security/nss/lib/ckfw/builtins/certdata.txt
# Remove further bad credit records for some CA issuers such as GDCA, UCA, vTrus and TrustCor
sed -e '/^# Certificate .*\(GDCA\|UCA\|vTrus\|TrustCor\)/,/^CKA_TRUST_STEP_UP_APPROVED/d' \
-i security/nss/lib/ckfw/builtins/certdata.txt
# Remove malfunctional searchplugins
patch -Np1 -i ${srcdir}/0010-remove-malfunctional-searchplugins.patch
rm "application/$pkgname/locales/searchplugins/"{gnusocial,invidious,invidious-tor,searx,searx-tor,yacy}.xml
# Install to /usr/lib/iceweasel-uxp
patch -p1 -i "$srcdir/0011-$pkgname-install-dir.patch"
# Adapt Iceweasel-UXP version to $pkgver
sed -i "s|52.9.0_YYYYMMDD|52.9.YYYYMMDD|
s|MOZ_APP_VERSION[=]52[.]9[.].*|MOZ_APP_VERSION=52.9.${_pkgver//./}|
s|MOZ_APP_VERSION_DISPLAY[=].*date.*|MOZ_APP_VERSION_DISPLAY=${_pkgver//./}|
" application/$pkgname/confvars.sh
# Add missing versionField.textContent in aboutDialog.js
sed -i 's|let version [=] Services[.]appinfo[.]version[;]|let version = Services.appinfo.version;\n versionField.textContent = version;|' application/$pkgname/base/content/aboutDialog.js
# Load our build config
cp "$srcdir/mozconfig" .mozconfig
mkdir "$srcdir/path"
ln -s /usr/bin/tauthon "$srcdir/path/python"
}
build() {
cd "$srcdir/$_pkgname-$_pkgver"
# _FORTIFY_SOURCE causes configure failures
CPPFLAGS+=" -O2"
export PATH="$srcdir/path:$PATH"
if $_pgo; then
# Do PGO
xvfb-run -a -n 95 -s "-extension GLX -screen 0 1280x1024x24" \
make -f client.mk build MOZ_PGO=1
else
make -f client.mk build
fi
}
package() {
cd "$srcdir/$_pkgname-$_pkgver"
make -f client.mk DESTDIR="$pkgdir" INSTALL_SDK= install
install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 "$srcdir/vendor.js" "$pkgdir/usr/lib/$pkgname/browser/defaults/preferences/vendor.js"
for i in 16 32 48; do
install -Dm644 application/$pkgname/branding/${pkgname%-*}/default$i.png \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
done
install -Dm644 application/$pkgname/branding/${pkgname%-*}/content/icon64.png \
"$pkgdir/usr/share/icons/hicolor/64x64/apps/$pkgname.png"
install -Dm644 application/$pkgname/branding/${pkgname%-*}/content/about-logo.png \
"$pkgdir/usr/share/icons/hicolor/192x192/apps/$pkgname.png"
install -Dm644 application/$pkgname/branding/${pkgname%-*}/content/about-logo@2x.png \
"$pkgdir/usr/share/icons/hicolor/384x384/apps/$pkgname.png"
install -Dm644 "$srcdir/$pkgname.desktop" \
"$pkgdir/usr/share/applications/$pkgname.desktop"
# Use system-provided dictionaries
rm -rf "$pkgdir/usr/lib/$pkgname/"{dictionaries,hyphenation}
ln -s /usr/share/hunspell "$pkgdir/usr/lib/$pkgname/dictionaries"
ln -s /usr/share/hyphen "$pkgdir/usr/lib/$pkgname/hyphenation"
# Replace duplicate binary with symlink
# https://bugzilla.mozilla.org/show_bug.cgi?id=658850
ln -sf $pkgname "$pkgdir/usr/lib/$pkgname/$pkgname-bin"
rm "$pkgdir/usr/bin/$pkgname"
ln -srf "$pkgdir/usr/lib/$pkgname/$pkgname" \
"$pkgdir/usr/bin/$pkgname"
}