PKGBUILDs/extra/thunderbird/PKGBUILD
2023-03-15 14:46:46 -04:00

318 lines
17 KiB
Bash

# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Alexander Baldeck <alexander@archlinux.org>
# Contributor: Dale Blount <dale@archlinux.org>
# Contributor: Anders Bostrom <anders.bostrom@home.se>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - mozconfig changes for ARM
# - disable rust lto for v7
highmem=1
pkgbase=thunderbird
pkgname=(thunderbird)
pkgver=102.9.0
pkgrel=1
pkgdesc='Standalone mail and news reader from mozilla.org'
url='https://www.mozilla.org/thunderbird/'
arch=(x86_64)
license=(MPL GPL LGPL)
depends=(
glibc gtk3 libgdk-3.so libgtk-3.so mime-types dbus libdbus-1.so dbus-glib
alsa-lib nss hunspell sqlite ttf-font libvpx libvpx.so zlib bzip2 libbz2.so
botan libwebp libwebp.so libwebpdemux.so libevent libjpeg-turbo libffi
libffi.so nspr gcc-libs libx11 libxrender libxfixes libxext libxcomposite
libxdamage pango libpango-1.0.so cairo gdk-pixbuf2 icu libicui18n.so
libicuuc.so freetype2 libfreetype.so fontconfig libfontconfig.so glib2
libglib-2.0.so pixman libpixman-1.so gnupg json-c
)
makedepends=(
unzip zip diffutils python nasm mesa libpulse
rust clang llvm cbindgen nodejs lld
gawk perl findutils libotr
)
options=(!emptydirs !makeflags !lto)
source=(https://archive.mozilla.org/pub/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz{,.asc}
thunderbird.desktop
vendor-prefs.js
distribution.ini
mozconfig.cfg
metainfo.patch
rustc_version-0.4.0.patch)
validpgpkeys=(
14F26682D0916CDD81E37B6D61B7B526D98F0353 # Mozilla Software Releases <release@mozilla.com>
4360FE2109C49763186F8E21EBE41E90F6F12F6D # Mozilla Software Releases <release@mozilla.com>
)
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Arch Linux use ONLY. For your own distribution, please
# get your own set of keys. Feel free to contact foutrelis@archlinux.org for
# more information.
_google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM
# Mozilla API keys (see https://location.services.mozilla.com/api)
# Note: These are for Arch Linux use ONLY. For your own distribution, please
# get your own set of keys. Feel free to contact heftig@archlinux.org for
# more information.
_mozilla_api_key=16674381-f021-49de-8622-3021c5942aff
prepare() {
cd $pkgname-$pkgver
echo "${noextract[@]}"
local src
for src in "${source[@]}"; do
src="${src%%::*}"
src="${src##*/}"
[[ $src = *.patch ]] || continue
msg2 "Applying patch $src..."
patch -Np1 < "../$src"
done
printf "%s" "$_google_api_key" >google-api-key
printf "%s" "$_mozilla_api_key" >mozilla-api-key
cp ../mozconfig.cfg .mozconfig
sed "s|@PWD@|${PWD@Q}|g" -i .mozconfig
if [[ $CARCH == "armv7h" ]]; then
echo "ac_add_options --disable-elf-hack" >> .mozconfig
MAKEFLAGS="-j4"
# 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
fi
echo 'ac_add_options --enable-optimize="-g0 -O2"' >> .mozconfig
echo "mk_add_options MOZ_MAKE_FLAGS=\"${MAKEFLAGS}\"" >> .mozconfig
export MOZ_DEBUG_FLAGS=" "
export CFLAGS+=" -g0"
export CXXFLAGS+=" -g0"
#export LDFLAGS+=" -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
export LDFLAGS+=" -Wl,--no-keep-memory"
export RUSTFLAGS="-Cdebuginfo=0"
CFLAGS=${CFLAGS/-fstack-clash-protection}
CXXFLAGS=${CXXFLAGS/-fstack-clash-protection}
}
build() {
cd $pkgname-$pkgver
if [[ -n "${SOURCE_DATE_EPOCH}" ]]; then
export MOZ_BUILD_DATE=$(date --date "@${SOURCE_DATE_EPOCH}" "+%Y%m%d%H%M%S")
fi
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none
export MOZBUILD_STATE_PATH="${srcdir}/mozbuild"
./mach configure
./mach build
./mach buildsymbols
}
package_thunderbird() {
optdepends=(
'libotr: OTR support for active one-to-one chats'
'libnotify: Notification integration'
)
cd $pkgname-$pkgver
DESTDIR="$pkgdir" ./mach install
install -Dm 644 ../vendor-prefs.js -t "$pkgdir/usr/lib/$pkgname/defaults/pref"
install -Dm 644 ../distribution.ini -t "$pkgdir/usr/lib/$pkgname/distribution"
install -Dm 644 ../thunderbird.desktop -t "$pkgdir/usr/share/applications"
install -Dm 644 comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml \
"$pkgdir/usr/share/metainfo/net.thunderbird.Thunderbird.appdata.xml"
for i in 16 22 24 32 48 64 128 256; do
install -Dm644 comm/mail/branding/thunderbird/default${i}.png \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
done
install -Dm644 comm/mail/branding/thunderbird/TB-symbolic.svg \
"$pkgdir/usr/share/icons/hicolor/symbolic/apps/thunderbird-symbolic.svg"
# Use system-provided dictionaries
ln -Ts /usr/share/hunspell "$pkgdir/usr/lib/$pkgname/dictionaries"
ln -Ts /usr/share/hyphen "$pkgdir/usr/lib/$pkgname/hyphenation"
# Install a wrapper to avoid confusion about binary path
install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END
#!/bin/sh
exec /usr/lib/$pkgname/thunderbird "\$@"
END
# Replace duplicate binary with wrapper
# https://bugzilla.mozilla.org/show_bug.cgi?id=658850
ln -srf "$pkgdir/usr/bin/$pkgname" \
"$pkgdir/usr/lib/$pkgname/thunderbird-bin"
}
_package_i18n() {
pkgdesc="$2 language pack for Thunderbird"
depends=("thunderbird>=$pkgver")
install -Dm644 thunderbird-i18n-$pkgver-$1.xpi \
"$pkgdir/usr/lib/thunderbird/extensions/langpack-$1@thunderbird.mozilla.org.xpi"
}
_languages=(
'af "Afrikaans"'
'ar "Arabic"'
'ast "Asturian"'
'be "Belarusian"'
'bg "Bulgarian"'
'br "Breton"'
'ca "Catalan"'
'cak "Kaqchikel"'
'cs "Czech"'
'cy "Welsh"'
'da "Danish"'
'de "German"'
'dsb "Lower Sorbian"'
'el "Greek"'
'en-GB "English (British)"'
'en-US "English (US)"'
'es-AR "Spanish (Argentina)"'
'es-ES "Spanish (Spain)"'
'et "Estonian"'
'eu "Basque"'
'fi "Finnish"'
'fr "French"'
'fy-NL "Frisian"'
'ga-IE "Irish"'
'gd "Gaelic (Scotland)"'
'gl "Galician"'
'he "Hebrew"'
'hr "Croatian"'
'hsb "Upper Sorbian"'
'hu "Hungarian"'
'hy-AM "Armenian"'
'id "Indonesian"'
'is "Icelandic"'
'it "Italian"'
'ja "Japanese"'
'ka "Georgian"'
'kab "Kabyle"'
'kk "Kazakh"'
'ko "Korean"'
'lt "Lithuanian"'
'ms "Malay"'
'nb-NO "Norwegian (Bokmål)"'
'nl "Dutch"'
'nn-NO "Norwegian (Nynorsk)"'
'pa-IN "Punjabi (India)"'
'pl "Polish"'
'pt-BR "Portuguese (Brazilian)"'
'pt-PT "Portuguese (Portugal)"'
'rm "Romansh"'
'ro "Romanian"'
'ru "Russian"'
'sk "Slovak"'
'sl "Slovenian"'
'sq "Albanian"'
'sr "Serbian"'
'sv-SE "Swedish"'
'th "Thai"'
'tr "Turkish"'
'uk "Ukrainian"'
'uz "Uzbek"'
'vi "Vietnamese"'
'zh-CN "Chinese (Simplified)"'
'zh-TW "Chinese (Traditional)"'
)
_url=https://archive.mozilla.org/pub/thunderbird/releases/$pkgver/linux-x86_64/xpi
for _lang in "${_languages[@]}"; do
_locale=${_lang%% *}
_pkgname=thunderbird-i18n-${_locale,,}
pkgname+=($_pkgname)
source+=("thunderbird-i18n-$pkgver-$_locale.xpi::$_url/$_locale.xpi")
eval "package_$_pkgname() {
_package_i18n $_lang
}"
done
# Don't extract languages
noextract=()
for _src in "${source[@]%%::*}"; do
case "$_src" in
*.xpi) noextract+=("$_src") ;;
esac
done
sha512sums=('0de88cef22e7b239804e27705b577dd34a86487512bb2af29804b358d056628c14034a34cbbdded75612bda984fac2c04d116cca8040b9212a7fb0206c07c440'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'a34dd97954f415a5ffe956ca1f10718bd164950566ceba328805c2ccbb54ed9081df07f2e063479bf932c4a443bb5b7443cca2f82eea3914465ed6e4863e0c0e'
'7e43b1f25827ddae615ad43fc1e11c6ba439d6c2049477dfe60e00188a70c0a76160c59a97cc01d1fd99c476f261c7cecb57628b5be48874be7cf991c22db290'
'36d9662fc94cbf7dcf371adc13a9cda679bc75df961d86de019d3c8ebb0be3062d5ef762d175fab58696db74758100a65de45d7832e0e2bd4e15c901f72d8349'
'26cdfeecb18a14bfe01902987b9051b2d58b1f4bd85b45e90ca86eb2929c5387077b146f3bf681b80268bba2d048be15bc11124d58db1176ea2b6b487d9422c8'
'1b4b2875783cb9681343baa268a6d9ec788e366e09e5e2ced5838e1e3083b664f771c5e788cfd1c80410ce029f46c70a48014024e41b6d98791cea95d4801daf'
'1f897917ac1ab4513040275d195c207fc60904691415b64d2cc768877f4a4e04e5d953d734c867700f5b32e614de6c57d6671c08f10e4c72d6c8b8d23682a07d'
'638354d83f4308cceffa203ac638b0272ab39a49eed122f04ecf4a502746ef1bb4b813111604a0aad18f27c34820d81fec7aaa4f01b157ec7f75c572005e6654'
'56b2aa36c4802c7c64d10ef69ec484ee7eaf72ca698d9f3d4881efe1575058d244efff3272ced304a6f0527eeee0975c79c862bb4c690eff847625f3fe414df9'
'67510da0d9124bd6e3f56b833846b95bcace979ac8588ca5d490427a3012852b6b74ea926e3b058965fb6c0f0807b921328ee4ac5479973bc984d18c60273e94'
'df76e4b699f1e5e6021186b20285d3a1aa35969fe6ae23ad3d154f6ee26f23988c67d777fdc85c9442a4e4eaf06bf2d8bcd0e71727b0c9aab3c3bd458c465169'
'12b5e00d64b19c9a3ac7237b6f97e081ccce6f96d6090252dbe9ec278b23a7ce05faf1a64da688d7605ad54f52dfd80ed50a700561f8779be3471552bb584869'
'b3bbbbb19b46cf1674994d27d0457c3c0ac25ec10ff9b4ec12405e5bb8a49045f215315531b281c702006a99406b351c840b6b330f1f874b05d426ca48334fa4'
'3591d840dd4b7ff68f6e8f575541e9b4a44d86f3d937fb140fe093adeae9c6b45a8fd1540f2abc679fd8fffe0692c4eaf1f445343ca3d537ad9c026ef3f7718d'
'1d9caf0809802720d16727c93921844d747273323cf2fb662a0d3ece1929ba4c141e792962bcd797e7ace5590305ab62862858b5b19fd3dfdba06beeb4f9dcc9'
'4ae58445fb12603517150dbd4746e30745a3906ffb7da839476eab8f99b153824100bb08e19219054bf7b1bb9d89d9c4e9d199943686495fd8cbf0201db29d35'
'5d3782b4fbb229ae4cdc34da6b3621c58647f0becbfdde0b7c850a853535d8d70199c770b579c1b54d3f2b102c68656e15f5141db7bb407a36c83617e391a7ee'
'97c50f7625d32dfd5395936afa0813cc0df77539608927a790fb2fcbac30beca9ea92fbdaacdbff902392f4f4e148ffca1cc872decb99434f56082b4cdd13019'
'8a13d3663d9ce6bb5d41362420b9c39ca71118e1f12c2d413ca2ed87870c958bb61831bebb071c81bd410299503bf072b96cb5ecb3fa6029e7310eae5e0214bf'
'3c800502190f796f02584716added5ad40edeb8eb4c5f537fb2ed49b42d0d7388b18694d1ff4f4e5478a2b84c15b31e0641ce438bf999a93b80799ca8d7aeb9e'
'19fdb6279e1b55578c42a2f8dfaa3a52c27016ccf65cecb41ee1d3652bf9967245f2588569098ce19c1755c5a58d75cb06d9c47fcd88be58761cc7e131beffbd'
'7652fc1f0adb9fd2655b4a59a1dcd7c7ce8e7f5cfba5126ea3f5273a4fd0d343f6c5e016fd8e3d08f2374cbe1cd580177759e92d54cdb9eadc4ba8ad53220831'
'6039f42b803211aab591077ea769b589a37d5a04db3b4b708b35062c607836301bc0c3c3260b0c62ea66f7559b1930e6552408f20373f1bbade5c771ca7bd699'
'484652c74312809ce55b889cdcc2fe3acd13ab0ec15e1ad0ee8ef57ce7281982c1221635d99a53b47d472a69c2895f69d6fa0dfa144b4d3294932dbe46de1c29'
'1b68c656cc81b57eeb408aebd6e89bcf58901082bc4841cbd52bd9514f7a0b0b0ca507b49014b9d296ec633a0eb37970d22699f4fa133690d211fbddb728e6d6'
'e53383c9ca14d340b8201e108f514ace073714225556aea6023b4b6c9761e1281f76ca3f05cd92bd1211d09ec8c4abe5d0e00bce10224f727ff26a7657540afc'
'0c4cb41b3c3f11b3b0af5f771fe34f2e23770b28e9521e6a1c4244703562630d6abf4a7e55c90136dc5d57bfa1e85ac6067da8454edc3f9701d921ba86f689ce'
'843a297461ffc3471b4d72708c9c8c1f16432fc9de610ef2438c64ccb0773097cd394204b40bf33f7414ff3b53e3e6c8aa6c478d092c7a707918853c680e91a7'
'd4a47fb3d49cddbe90ac42d5b41d851070b3afad79cadd74a4387501212b140943aba71b5b06c6904e63b3566abc7b6c561de6fbc1eea5ff3e1a2e8970705d47'
'60da77b16acf7569a26b68519d1e11e4c2f61faab7341175a31919470305fb1cacea061ffb839a0569606070ab766d57506e6a7d1cdcb6bad5ac47c8da3d2658'
'60790257dd1169564b0461a3e599a5f75b1e56b701d4bc77e1d4d6869f556568fe42d0f08e9ff0757ffdb0832c39065d34207722c16e4fe110f0b7385d2066fc'
'e5c01d683f44f7b19fc591047d40f7e6bf3d18c1b0dfd5dca0cb0d25449ebd48f1df1f3760eeb6ac12bba68be06ae80b016f3cd66fa337e2464945a763b431ad'
'2002b599fc0afcf5196c6c6dd0c920c3835c5de9106f2d77be9e165cb3153d30687884d355d8e808d18f678c1cd5186f73c49453559a943fb2ae97c22f74f47c'
'b86eebce7143637a4a145d4e6d0f8eb208346127cd126c06f6115e8a62fe282b622712d9524d8702c01207560d7b8b994c35b3b11a74df4269706762a5e50ba2'
'84dc6477aa40e327e6260c36ff8e68c78fcfd22be02961d35abb01782322f987d8f6b0694e68e5feaef8cb9c5380961dbafeb57f691c4b4b5ae097ef0452b37a'
'fc92ae6e2843bf9cc1079888b57acb1e41db839523d56ddd6c6d5aa9705f015b78a1bc60dee55303ce34ff3274a718deddaf0c5ba786c357095311eb11461a16'
'620b4299a68477ddba5e25c27a5f492c811faa51db24078621aa17ced787f6db9165d593e47b90113d6c1532dc0e06c69e06868ee8111b243603894e5cb31322'
'8a42b42c870ed6aff52ef1d0a6f1bf6852311ed75aff9c38cbd3076258499612a8072a260cc9910aefcced83e0472bdbf8223f54dc46d1b7531adc28ac1fc96c'
'd3b0273595093dd0b6cce355d8b3b5089c1abbdbde619c1dcd6af68ddd09ed42a5841e48d8f8cb7d8806a8bd639108a6aa1414a1875f36416ed83dc1b0a5f11d'
'675e1b7f719f82f15d8dd36ed7c8cc93c39c0a1f47ea5604501d4a74dee44d9fb72fd16d1e4b7c2450f8fea19ac4b9167bb5294c78cbf885afd34aee8e017269'
'9f1883da8e525adbcd49debe68cbe3c6b35dd2788c64e5f9c0e3d16a7145fd2db84b75f4333ebde1986a4f934014f7740d8b6fe592e1b95904332eb52037e4a5'
'16c3da47c6aa86d3ac14099346b8d3ff8db889507c4bf666c2f483daff034730dfdba8ed574e2f197fb5144143ae72752d19147c83ba14a4073f1bf79a77c507'
'4165e5b63fdf4122aef171dd37dc7f11af6cc9d5776a6ccac7d8bcf981d9e442d192453b06e16c7be393a1ce738e74b4bede074ab9caba4a0b3d5b03e3ca48ef'
'a526b679ab7a326603a04a4a3e81da96098cdc582d2a1f07341f96f9c1aa8ab60e2b80fbf6cb24b4301939ef1f49a5f5ca1ed6505e2fe708bd6bd4f5e949d384'
'7ae1acc1cd782af5ec2054f2f09278418b1df65b8f44b83a40c3480506fb3b364a8694d46099095cabd2420a79efe83dbbc971290f1dca576f9c83fc99f10252'
'2cf73b40c1cf1c282221dbf4639bab6462cbcc7a08a86c50ae4003c073c0fd31d7df3907c5c583799e18c8f1157d83f2083a886303ffa754956af9277cae48c0'
'f6c11412fdb85833d5d7cdec1430676df8bd61f8ef52233e6a6ff2356452e418cbb41e00af20f4ceb8f64e5da6d0e4a59e1932fc9f8ed2d50990a4c30eff8505'
'b64256e796dec231421c7b895a8086b324275799c1bd53fc35cc3d05457c36dd95509d27889f3bc5faa0663b8004d9a8a1a33e921f73f400d6ee8dd3b66db843'
'7aaabe4dce42c679c3cd79df5337bb6d5608be79875dcf00b56f734ee0c67eae519f093b1ea9891020074f0eef580fd134999af531dbd90dd5b89382fb88c765'
'199c37b5dd4211fbdf3e92bbbf65d436ef3d56c542a3e18394e29d1b5843fd2946782963135323b6794d921fa32a55ed299b2cf85574209557dbcb36249d4830'
'93595647d48e6becb102e9a458664e585cbc7255c89316ee96c1b625fb54b2221b70df09f6c00d019f4869b8cf9e3c1198df6051e4aebb76421815ac29065e98'
'de77732eb5e9ad3cf24276ec08e5b88c4c6194ecbdeff16ac7cc3fffa498c6f1f575fdc6820d116f290b9e217d840b0c1311857b94490c3f4f977fa5a9906e1f'
'becebcdb6ffd479219b41ad66d312b150ec1043f0e7b74f5a9ec9f2e0ec5469562d04342b7ff4c2c2ec064f75d9c90e54a92763518e10e1818cdb901cc28402d'
'95430fc08d598692cd60dea87c34dc0e3f12ab38b89ef7ab840a8da6e0e54abbd7d91911466757d65c8ef711a3096b1b355c851f7cd60e8438938f7b577a0d66'
'e9edb09d0ebc16093544c0b71629819285a8c453ee598dc4af6f293783d310eb64479b1a687ef46a967d98510141ddadadeb8a4e29d524e4a3b6e5564e0a451a'
'bf05155d59531c81e9f644df1217d42a7a127adeb68821b072e6c94745b56b5decdf30cf546c3aab7f3abc71d9622df0f311a52763000a14c953f267374d6821'
'dbe48e9c334df0983605829b062b1eb543f7d58575b7a19a30b48aa6d91bc5fd5c89ec64bea4478842c445c88e3863b6705e6dfeb427f41f448312a9fcb00008'
'71d697523c9ffa45b644c3afaea4cd84a1e01227e52a6e07430d6cff4678908c2a4eb2600d68987c7d0fd84675ecc5ae4d52f60de6da7c9c68badb6af0039a44'
'961e444a81d29ca45c01ada9b2b391287f2f0f8edf8313810d46eb7151b3cb70148e72f1bd7c9d51b2a36959a6cad8df2de8b2f9512a9da5b0654ea6a350afaa'
'bb81d682522102fae7e078acc37f6c71921837515ed332f9031795105fc7b4ea7217397b1b3403480e984b038e2be3e9b3039801bee5c748d805a76d0a290b3c'
'2cbf1138666b3207ec8403ee6462b6ba588128a5e5c7954734ec34a10ff37415a6192930f572ca6af154860f2d24a5b850683b9fdff71be0fa14ab06121a6723'
'35f10916664de17427fa614562d33f1a7de7291d0ae013629b9f0e1fc651fcc73c1cd4cf2044ac76fa29bbb427b4f4ad7d5668143aae63c18caf9785967bbb29'
'63943aafda95c437ad3f2c786ebf0354902fbab81e28e69b62894943bf0870f08b77819f5214d43f461f6705713021762a6bd7acfa53420690042994601972b9'
'eced56f72cb9f0491ca6484ecd25208c18a40fb414c9ba290bc093f4b547b4f8750ce9035107fd5d1dc7220aed5a2087d2513a9907c5fbb30d42f3054a6aaeed'
'7869b58f862f6e5823704741ef1768a2135f167f91f1dfbe0479480077f173bbaf8d6c4ec17f27131132f3238f00dd76db5e14f5ac399e3170b6fef49293ed8b'
'997880258871dceb5018c8fecc8a61b20a051d322ca1791ed014ca1e573bcc653e7eced939968db01fa00befa82ff3bc50fe8e81f871331290d63043aba91a57'
'dd902d37b4e695fb1eb8e1e39c95bd9cee94cf66814c418cafbb48965b6d0d9e9600d0afce309ed36f3bfde32c5a225dba480613ca66468d2370303de68c4ca4')
# vim:set sw=2 et: