PKGBUILDs/extra/thunderbird/PKGBUILD
2021-03-09 00:27:16 +00:00

291 lines
16 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
# - revert change for clang that breaks gcc build on ARM
buildarch=12
highmem=3
pkgbase=thunderbird
pkgname=(thunderbird)
pkgver=78.8.1
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 mime-types dbus libdbus-1.so dbus-glib alsa-lib nss
hunspell sqlite ttf-font libvpx libvpx.so zlib bzip2 botan libwebp libevent
libjpeg-turbo libffi 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
)
optdepends=(
'libotr: OTR support for active one-to-one chats'
)
makedepends=(
unzip zip diffutils python python-setuptools yasm nasm mesa imake libpulse
inetutils xorg-server-xvfb autoconf2.13 rust clang llvm gtk2 cbindgen nodejs
gawk perl findutils libotr
)
options=(!emptydirs !makeflags)
source=(https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz{,.asc}
thunderbird.desktop
vendor-prefs.js
distribution.ini
mozconfig.cfg
configure-fix-passing-system-bzip2-ldflags.patch
thunderbird-78.5-rust-1.48.patch
arm.patch
Bug-1238661---fix-mozillaSignalTrampoline-to-work-.patch)
validpgpkeys=(14F26682D0916CDD81E37B6D61B7B526D98F0353) # 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
echo "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="-j2"
CFLAGS=`echo $CFLAGS | sed -e 's/vfpv3-d16/neon/'`
CXXFLAGS="$CFLAGS"
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 RUSTFLAGS="-Cdebuginfo=0"
}
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
./mach configure
./mach build
./mach buildsymbols
}
package_thunderbird() {
optdepends=('libcanberra: sound support')
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"
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=(
'ar "Arabic"'
'ast "Asturian"'
'be "Belarusian"'
'bg "Bulgarian"'
'br "Breton"'
'ca "Catalan"'
'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"'
'ko "Korean"'
'lt "Lithuanian"'
'nb-NO "Norwegian (Bokmål)"'
'nl "Dutch"'
'nn-NO "Norwegian (Nynorsk)"'
'pl "Polish"'
'pt-BR "Portuguese (Brazilian)"'
'pt-PT "Portuguese (Portugal)"'
'rm "Romansh"'
'ro "Romanian"'
'ru "Russian"'
'si "Sinhala"'
'sk "Slovak"'
'sl "Slovenian"'
'sq "Albanian"'
'sr "Serbian"'
'sv-SE "Swedish"'
'tr "Turkish"'
'uk "Ukrainian"'
'vi "Vietnamese"'
'zh-CN "Chinese (Simplified)"'
'zh-TW "Chinese (Traditional)"'
)
_url=https://ftp.mozilla.org/pub/mozilla.org/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=('5158f7663acf3d00f45b457d1c172dcc95978d6782775faa4ec3995d3a799dfce668302e2c4b963a5607add831314fac76d516e45863a1971fbd4a6b0c4bdb10'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'6048bce2bae535007422854affa3cc2cc588e6029ea3083aa4817795beb25dc6e2726df082ed0fe9664f328d68b2f60e2619b87c359c99e73c9ace3dce0f3176'
'e3ed2708b8354015cb3d2c81048d1ce4932d1effbe2b40efa7cf9b45c1b923b9fd708645e2f8aa0136a485a3f7ce6b396b85721aaf535a4a764fd5005fb7e222'
'bbb8b0e7b9c67372eb22e1d6b6b5758fe504ded84c40a076d4a064374a1bf34ac12d5b514b328ac9ca984d976b9e0fbde81e68a66bec915c997d6be0c0917584'
'5f77f0789a4bfed84604372f77a7907c5ec2b7ad1e09c6be3ec2caaa9616270b4316e7df73becaf08fd458dd730a077d5a004af6b44e5d6aac516ee2b5d70323'
'ab1ecede6ac20ec7ee75a9c644d2bda0f694fa85780b51f3ae8295e3c8dde2b4cb92260230d658bc0f41e5b810b768c679eb5e6b94cedd492eb86611363c08cc'
'a99d0b907674714dc00a5e993ff67ce46903e0b5f3a116da14295097ad18c8b042394485359ac5eb71aa692537b7c952709cb56c4f0d0d832e6f9fb6c46471e2'
'a6a6b5811a9155ae7bb173de2acacd4185221b3a1780a00f528df892593e680b9e962bd711120bfe6786ad9b7964fdad2df7222c896f09580259295d76c51a69'
'44f1e9ccd1857809ca485b1c75a340efc5524b1dbbe6dc072de0103125475f8777bfb605d42afaf2a0b89d345409c01316d846b3acc89b36c10ef44eab9b2883'
'14f1ab8b6117f077f86f22c4ce57159849342db02eca271044d7658962980a670e22435cace796ada45fdbf61921796f804afe88084eae21c82b8cb09784cbbf'
'a63e5aaba15350978f9da72885a2b1e817a0934fc3f3aa87b2cb7125601befa703770dce2c870580992515992fbe80d3655bda90a3ea073c1d7658fcede783ec'
'fde9c3131e245461ac865fc2866bb74552af4853ccaa14a4f7ead9921bd29e9ffcb70de84549e531f9682a2e40b27ef10e0a8f1701573f66bb2d034a3a459036'
'a97a7af8cacd95e650fc90464fba1e9223c13002e3198e8544ea46bdacab765dc6f6b0d2b9768fe676a5c273cc639a0323f41313f478284e68d145bb7c5eb398'
'314c26d7578f86cfc0fab808d53fcedeb906265f7e75ea7b8400f5de9f01764e434227eedadd0c8a298b9936327166bb42f1e6dd054f1c11240c58787f2503e5'
'f976f8238f99f470c3ba608377c371146009dd5d1be8ff15610287b467ea1109815e81b623d35a25b5ceaae2dcd0ddf9e1cc0860d4bfd1333f3e1db9d0bbcf91'
'53247e8a7cbb158495fb4fc5f0fc6282e04647f7b39c57c108e0e083e23e8f9e5df1c3cf4efe8adeeb30290785ccb19be298bfc3513a2618530f7f78fcb5e459'
'388034965f8e3b2544e02d644f98717007c9f4b94d0ba36a96f06b4fe1abe126bf516c773aecbfae1fef4c50a9be34f9501ebbb1bc6a68911c44c5d9dc942e8f'
'0ee64bf72b68a603507779a1fa192d1e19d0fc76a53d8e4eb7d69cb6e25530917e437fef796667981128daf14f581eaad5051d2453c246c7bc8e7a069201b380'
'6dd23a62aca0a3cda52b8a2ce7b46e9254b3139ca2bf87516c79bb675b907e24203e490973299bf44715652f53dc1f088b11f920495f8723a12dbd34c5ce1310'
'429b7ca28412b6fa30184cfe08885a586a8b25a7da2d81cf619b8c8268b233e85a9d2149d8883968362125ee16948c70cc0e342c91cb64a891208278b21c2f4a'
'2b8114d86265cdc434e36aebb5530119da120c84b15e08146a95f94ba76e461297b007ee010c120c5f05ef72b4d85a7152263fbe6e3a87914b42901280ddbae1'
'c10e643a228a43596281f4d5c8f544259fd6d7ad99be6cc128911ea3b8b960c6a349a8c786cb2729a422e1628bf2af36bfc854b8ee7b623aa46a0d0626155ae3'
'71fae224654e032d0d3d52c63d4e69b0e3de105014cbe096147fee6e67002108f53932a62a1df756424e2ae4e1cd64a4aaef55895fa29e4c51d483f432a2a211'
'0a57c85e2ae821e1fb6f51a8fa6c1ebe8d56919943e2c3842e7bc815f497d7f40a7307cbbe20f01411144ffeef7b772ae56eeb8cb86d45b9f7207818776dbce7'
'e4d5a240ae3c15a1a1059236bda269ea40d58656ad4f1dad9b2fef0473d3e35ae1c29e0629f7284b76997b6a5b54fec37e5805e09a50c43d0275a2d7b602001e'
'd6ba4b286557a529b0206d7d12d5b653437e6a6119d5c83375f1a1bbbee2e06936fe7dc2de134caf5668a049a64be80222708d94e723ff72a2e5b3769e516e87'
'f5992009185a7e930de7a7f71859bc5d5cb019df98ce1cb4e4a19936c14fd642e5f2667b6bd1cfc6b1788b52072a7901b4e687ed93689eda66bb47534b03a56f'
'53c2c559024df96d42ef4b1679c6d20fa529905f24e9614098cb4888e07d36d87fca305aad5e825613bc088e91172cf68c982b1db1ccc277965ef2882905a718'
'a83ddd38c33211a8875718ac922ff15df858f572cb6cbb8fe0b58412a277f744796168ab099dae28c24867200cd350961c0e4923e7de66db441f69d939723376'
'7de4674f1d421b718884c23939f52358beebfcce4e50df4b8706386241208901464d375ed9b6b3e85a950371bf0999a102691008f8715364ab94a596f864ea59'
'0a9354721e1f2a680a7e578b2b5696aa674b101f82a8f691ad482bd28d08c6181185aef373d0e0b8efbabb8d5821706450323b000c59739b63d5e06ef3929fb1'
'77fec037c715383ad7a68a3f6995431633ca519f973c7ed738537db771c7f1ba1fb24d694413f59173418d8f15e5b67bd46f888a5c5dd92b3457cb06a9d6e134'
'd9a45ff151cc8526d58f9ff439596c5bd56b7f7a076224588747c0438819837b1a4209f141e4681f65ccd32ba16e46bfcf9c5767e9ad9e2a531e6b101a180343'
'81716fd41cc15d0a9abb22a0182958aa029adc07b181b806e01d020feb246d06f6150f66d7598cbb758888c0f0ec70f1d157eb1f63a7fb8b2a9176dd7038c706'
'46d63a393b549363d764e8de404b68378496114146864f30c4e97f97dbdebf851d30eb8da69beef10e20bcf8684380ee85eb3e8a842eb9f238d95559102d0dd1'
'9f1a74f0de48e683bd05eb6b9d6ad03efa65243bce1f6372ee12033d2a4053d1ea0c98ed698bc565efbd39df6a27bb165315df8bdb094730dcc19339809d3bbb'
'f6a2bdf804fcedfa4dd8069e66a62e55ca5503d6765698de5d72cf4756289870ec71e3ee562a1846d825c68d49c2a8ce93463d5535c854165483b2f0aa05293f'
'88078b489a9d6ea0edf80fdd98a5b291a9589c55e244d068be01e6f7abccc20c5d101bbeb660947c93b62e9969bb4db9b7dc4926fa8c5e730f5790655151b226'
'e7284ede9a124f6ad2ef9e6ee328e5bafe963be43887a230708d8abdca57cad8e4a3309d0001f69c2e120619131ddb3d79a3ae82232d0a60189e20320d8f90d7'
'744e9b029b069762f63ea12543c85eef1e56314040bfe2950d5bdd8469bed5f31192509f1cc4ff7a2a1cc624067eb9cc911134746aba7c8ec076e7284df79472'
'7ecdecd2f7dbe332ada1d17f99b6de9929a4f488af9ab98ada4db280af7507598116bf444e3c845246240ea95dcdf54aeb761a8032ee960f2b78a5933cb0c7b7'
'b8e15ddec6f906c8f8a108439c61ad9c3f2aca166e6574c4dd69043e6b4a395bf48dd97866453641dc05a847669f5486e21c2fab82cca87a2937528c9d55a2f0'
'57ce48d26938d244f49c114980fca32a96f619e2b7f464891b8c14a2f3221fe25171ce2b912856158c494f19300a64920a9007b02c7d511b0b6fe0fc70759aec'
'61808cc790e9e45c63ee63d5a0a155ab5cf68a6acf1d415c2485f6d92a56583079b65b5fe8e41ad7e9df8dab7536d2366b21c4aa77756569f66270bbc5ef50c1'
'726f5ee8d7d1869c4a209094d9f3cd37638458497b54b2f9e4a59c3a0872f01f513e8098dbf57bd3e5a86d9a830d88aff1317380a99075e7a900c948c1395c83'
'd645dc76c3f6940ad926f07fda7b53403107c453f303c773deff9c3531ba49b6d4f397121a6b3c0f48f12c949df2312ed5d64aff368fe28bfe4fb5e3fc020e26'
'bf54de92c1f8731d8a2180eebb3e9df2d60c66ca87acac45b60afb484478ac97246d1620f551a51a2a5821319c4cb3decf9b5b53e1c89f1ffd82fdd726bca83e'
'88506d70a15eca7dbfb04761396d14bc1b387edd37c39820a7c0fc67f5de6883978c277f5b059c8f8518281dae61df09b4cb1218d8af1f7da1c6f653474d4f17'
'99f448b236cc687912e43a5bb488f3bc1336ce8f01a72e948bdced5ecd9ecb3475224af208eef1d214e9447cb150afb2b41669550a61cb346488c45696bc529b'
'e8554e8421f51c1e514b2413ee64b3c90ecad912781cdc297be30b95fb43b3f759f923cbd4b9ec376226666a30b3d2bc614b5fd53e6aefdad4eb11000fcaa019'
'a42a693ef5d411f4e8b13730e20d396c66a5ed8c077608b86585f0b2136b76ddb73096ac9407c3b63ace5de5830607a04d6fad06952e3c94c4a88c183958c66e'
'f2bcaacdc1bf026c22fc4cde95dc2a5473ed6e6a99bcefb439efa608a4f6a2a87ed28155a75b518fbc84b535c640514119759cc59263a3f8d0cbaf038f814fc0'
'bce05fcb1557bc83199a8f9ef83847bdf20c60ee3afcb5e25d9a974a3daf2703e08ae82bce136b2addc89a5249192805227b97e4dfd05dd1fecb75defe612fdd'
'16c46860daab93c1350e9d7aba442bfabd9ee69df94cc9239afb7214c28ae2e7f3a7983fa60867dcd8631ba33cc2c5af4b38f3bd67863a754f563a2922f4a34c'
'8f8afc401592e89202dff50777db0ef8b24cfee6aab6d082e2453cd85c02ca4b23647fe561cb2dc6efb1becae1aa98f7fdd4713ccc042a0993ca8be4b32e48cc'
'e6b489bc98236bc726a089121d70eb34b1445799ff9df5c43be0350edf7a7dbeee0be3027ce4e6f30d89a4bd229843752996fbcb746aee09c91ab26cb2c3663d'
'95c9b9c4bf973a9b09aff80fc480509d17c487cd32a087befe810eda8169778e723fa6eff09bca13aca5e8a1b87566e3913d1eb11c03593a4c55e9ae3ca1113e'
'67636461fedbaa03c78f3e8015cb423c9186459fdb7dc4ebfc23b6b8caa079d873a726ec875036afbb9458cea84b959f1242e2fe9917a4d53b55b428172dacb5'
'86e3f9c6fa84268ed79568cdb3003fee3420f2f8205492fd87eee972bbda94556f2e3c8d241bd028b174834f84f957738e0ef1f238a963c49aa589b5d9563aed')
# vim:set sw=2 et: