PKGBUILDs/extra/thunderbird/PKGBUILD
2022-08-03 12:45:29 +00:00

314 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=91.12.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
)
makedepends=(
unzip zip diffutils python python-setuptools yasm nasm mesa imake libpulse
xorg-server-xvfb autoconf2.13 rust clang llvm cbindgen nodejs
gawk perl findutils libotr
)
options=(!emptydirs !makeflags !lto)
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
metainfo.patch
cbindgen-0.24.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
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="-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 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
export MACH_USE_SYSTEM_PYTHON=1
./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://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=('1c0200a84ccc4124127d472713d72c4ff7ece8d61ad120d5c45c732a3ab4f86a2edfea23a8bf26e4739d24956654aec30e7bc59a28af17fbbf10f3d67466649a'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'328422adac0cfe6af4ecdcd864004b7ada8f8171aa954fecc23a7e883e90a9bb0848372faa1100440dc754922f965e1e7b98c185aa88df190bff1051d2146c85'
'7e43b1f25827ddae615ad43fc1e11c6ba439d6c2049477dfe60e00188a70c0a76160c59a97cc01d1fd99c476f261c7cecb57628b5be48874be7cf991c22db290'
'3526402ccae1f0428f2e45bae8d0b2cb909ac2698bc3508b692b827839ccb21203ce414206039776f6ce946fc53e636290b7870e9886284d5e9d1e8ad050aac9'
'dc1b72fe8c088ac48611678c1332aab525624940c8d9f5fdf1ffcf512837bc003e7893882f4bce724c2c4cf54487038c600e326ed227849250ff5e8cd76879fb'
'97b228149582f5a4608cc2727c22e41253b7b3081837d9d020ac5af32144722c31f5d8d6b812641a43efb3be221a3e3ef66b034ff3e02fca902793d4156d2218'
'c77245fbbe002ab17f7f33d2abaee1f6ce24617845c70fce606380f1013128992e9d818f6f924f5877c7b78dc539f1aa785396eb622caa2037230c68e4e76af9'
'8398456ba9f0e1619fd3311b453b18e3774e3dcc2d11f8808f32d3548aab0c978eb40e6ca707f4eddc565ab09ce808db2ca461608de17432a7a6c31ceff3a728'
'abd355a267bb32ce432389658298d86eb145d2ba9b294b48c0791171132e2754445c01120e1a97ea33c8838724659ea2256d76af8f5cbe684355c93ec95fd714'
'1886bd31b03c6fbb06507c3a1ba44de8e08a74d0265bf58f99ab6f3b12a256d66b6104af43491dcc6127fddb379d653f8d91f55cd8bfe9e53e40ec76ab15982a'
'3aaf4797a6236ceaa7b8c7bcad5e1388bdd93c4f930300e9a3f2ceb1353b49e4184d0eb1398285a91e40180ba84e62967acc1ffbe8b6cf6b1318842d5ebaf086'
'41752b0ac73fb37ce0e39192a8cd0b8fc435ea5e998c369e2a3d8c310b655bdcb50c50773a3f051ba99cd3b7a35a2369edf9a67622cec4070571a310ea1d3222'
'8a55ead4d0c543c1a6520cc19cae49cc79794a32b577e4b1b21e43ff9f8ad50015aaba9a9e9f34a390958183a81011b876fce16a78ec2ed68494305bbef9ad50'
'586000f3cbd70c2e5486f9eed04f953f6e2940b0c9fbde5f9c7884c1b89e02e844741c57dbe0f78a83d24430071b9af83ee8c058337e02b3379b71c946a3d5fb'
'a8362938c7636610f6e0a2fd8cabbd3e6e55d7a5b1170d7b1ba3ecfbe9a30beb7fb17542137138d2a1e13db43d743a0c04588dc925333a916afdfefb7f8ce5dd'
'43956187e276802c44820474213c435d1e5fe6fc60765a480c5fe4cc1a8eff002f924b4d04e0c134b9061274e6d82c4d3d7925975270aca7b3c5047db4b8931e'
'88eedd2151a32acf08e6bc940b98b9819423fce60677fe961a4449583aa0ccf8ad498c8d7cc53a2186863394d0674e0040f56d1bf5742985b156af610601866c'
'a72a3aae42d452468467c62f04c01d9d490d1b08f36853093b621d5d027b12c31cd830b106ee6a1ca0a56cf854516c25b6f2643c121c7561f495130713c1cd2a'
'd47ceccb44f7116146ead95f68551dbdbbf47748ca2fc390fcab2703a96fe779173d9c30bc6ff9c5a4228190624d2be34cea38112082e8e173c0cca814eff3d5'
'19f414ed6cf2d1758a7bea6e653158195af0052f484637677bb984c8589592900bc803f5aa2c66f80c051cc8dfa2bcfe22df1568f550aaa3fab0cfb61b2157f0'
'0de0eda88398bc1cdd44fc506401642d170e5b282af29386cad003b9197461a213fef697efd76dfd2b611169a43a51099893014513fe2f9ce200330672c1958a'
'ad343dfa81507dcdc8f72647c262127c0761d00f7a258e73c27198301d9c85cd0d6d2ed40551ff83acb25c5335f29e24424b8ce06cc13e31dd2a9f405f35b586'
'cc3478807b4ae44f2f1c02f25500941eb8ab32fa4c262c5d22208031af5b7da9a8a9ebf66b83dcc607068f8a4116514568b5d193c00def6a9d34bc45def5fa63'
'fc0b2dcfdbd7465abcc360c5dc8c56740eea9673441d0a5f151032c562c2a18a4f6c348338368ab1a41637f6ee98196bbb3633037d9432a4d792f7b2c4bb7831'
'dbe720213d2a0be92d73613c42917515589ca69fa718212077062cbd837f6bc9f3e57a977550679990274267e2044976eb5e4a4d4be24e2889c8f29fa8775607'
'2bacaabdc0fb54c452801d5f9c0ff9b9d5026fe23466d15ac7bd51f03f5b4c8c993380fffa4a19657ad5cbd60a3813c76abdc327809dbdc811f867b67a80b84c'
'510ac4a56fa38b488145394507d8de08e3d4fa6cee5b5f8efd347c5897f5be0ec4e3426ca17bb375c9e85b8cf03c2869288b0cbba048316bc1d7642233cfd4fc'
'f7f9b942ec7f87ebb876dd3ef1250ca1098fbacb177ac09ce7c1010640a7aeb0488e047e7c50ede726634e21632374b9b447d279f136713502055b65197ab75e'
'2a6184f1beddbd9be7ac38c35e6826714f87cc4a36d698a14a9052c8206f38f6907ed24623dfba467b997aefb4aff3a7e25b3286391003798a53bb1b09f2d1d4'
'53cb109e4c307607829662c852a708ffb4fae02e814e4d80e1eac185de1e8b25607f4ea18be32ba82f84eeeffdefa4750e851036e571785c8f047b95bff724de'
'9bb5a7d25112de53625a2e43bb035a0fe7b2b22c1a3edfb6c270c7cb3658d5e8fe50701ded3c5d15b82d6f69b80c7a759b0a6114456390c6498261d6fb4cabd8'
'73f2c08437b74dbd04c3af4cdfd80c2d2f4a9898c6a954255079705964546d2d6f1a03d66bd662c6131d461ac838c6e6a0912d725cf64b318b32457cc67f89e7'
'3fbf08d73e864697f96778e7291b1b0809f17164e2f1aa462318bd42192f4782e127ca432691672c0cdeb8db636c032953639437e8c695c309573c599cb39272'
'7b11557f2add0d847f7ecc4a667395b0d38b53eea1501e68d115341d5190553c556c7b460b5cb41f245e21dd6769245cf3deb2e7b20df2cd33489455feaf034d'
'5e9cb4c0be2161b213ccb75d55398629706d09487d660dd68373fbdc3048eadd05a6af1d49c5c8d209e392c08b2abd752a708c05cf1691239d399ba8e80695e6'
'9c41993701fc269f3dc6d52d9e532f4f6a3d02749e176f4e3bb850a4825a8b29f751c7a6b7792f4c0a612ee4dc85eb6cb25a15328995b96e3a39cd3ccc579bf1'
'1e13f0d660a2506543a504e4bae4f3a1048fb2160448380e33e278b85a2825187de8acaf3fd560dd17e19ea9c8d9e151306448b9cfb5258129a304554301f776'
'b94e7b056a9ae44fdb138085a5bfd1c9dbaa8cf8a035c9518182c1c7d42d1741529779b7d5eed39a14fca1e663a15a9d04640035f89d58de4635655672a2bf1c'
'e5ef81a967ea84d7204ae7ec1aadae015ca097a2da34106e9d6af6d28088f14bda346612c24e8b7ee3e60b76222dfe2051ba8d1df9cc6de62bf04b1e2802c17b'
'2542c0efff6ec1c0825384c69de225a2af00ff62fef70c9aea32d452b090af06ad3c197c6b6d27380efd8cd5707ff0870b8d2da8fa3ceacde25f714e5d9044af'
'b43bc6b89eab93a58f78fffb2a5edb8c2b048047ef836b86188ed5c2edf8160b46f5c3ebf1335cdcad7a7f9c588558c01af45041609eacc7c4e4eee7712242e7'
'4e2c5142ec936ae24e29ff886a9c701eed53476b546c158b33b6428e1dda6cc3fce993fb60a759aec515456f81766436fd0ae0ffe63e9bb043f996d04864ea88'
'80aeae3cb8ee9b387b752d103ccb5418a0ec1c1678c780e15936838f0c751505232d826a2496f2eb2baaf685bfc629f4ed37ae87289d418be28f956caa72688c'
'1d5803e6401cd7151bd89a332a3f6e5e3df60260bf214fab7c19c1d18ec77846d3d30bd272d8709fe421966d96593cbc5d79c76460a578c1b4b005d868e6add6'
'7c004d28966ac6cc699c3a04cef325f4aa28697484ded21527b9610812edec46fe510fda88033c048e32257be2b2bb292da943a4b1644d2535ce2d921bd3247d'
'3103f1086a2496a3189b8f3dff28236e5692dd77d29e3643ebbbf6bf13ce3d18d38501a0ad424b1aa12152649d813e15bfdb48f3dd952cf2d29e309d0823182c'
'9b3b4836a18a3ebc2274a2fb5d86d4ef807ad8d1586d10d2528cae5ae26c51b0ccfbdcf9eac47bd8d0fce93658735e9de8f56b0ff8f8410dc1aef7aedcdc7178'
'f2ce60169c31aa3c10477c3a150f9241b85e64e3a9c24da7cfe7802f20e179d4982648e29752a0a547ac271b8e83ad69eb180dc069df708d632f295b7df6056e'
'483f54a158cb5cf2a8e24c990797d0178018a4c1a2dec3260796cd25185dcea7739be904b6dce68b3b8cdcfba02c2a633b15784f5ed45a49c2ef82473249824c'
'b3cc4c40b10e0276ba5a0f606d4520686038ca531bb84847d3b6cf7eec4ff0f6105e96727f7d59ea132a4573ed692f1aef0236216c848c020592db6a0d7ea4c5'
'9aae8fb9374643c1ab41d98e23fb22239e2b840173c9ba18ac97aed06465ec9ac574a3cdcef908356d0156a04ad0e3651d86ed32187115ca3bd433b50fd5bdfc'
'4514dbd0630484ce7bad096cba5c36073948e85e7914aa443603bba8af66884578cef70f5dc7ba6ff801145589ed969780f7548c24cc743d1e49526b948b690c'
'e80e0f51f1524b4f8aca2aa04a014bf7c164ade33cd64afb0b3d1112b3fed1aa5d2c22d98752770054d430cc35e5d48faf2afb092cd9e603e6048567a5d36f1d'
'e4be6c52b3c133129ebee33dd183d382a28fabc7dd24900488a4f62d651c44180563ad752e7e4e24da124a7a6adcd72fad139a6a16fad77fc2d42d599af5dbe0'
'9759ecc8585996457c4d2b9116678bdff1972a3a2db2803b2bea0a52ddc2fac1017ba247ad59d4237afb5d3344bba791da1d51002a4bdf75061ff5fe642ac78c'
'f19435c22427dcb54f7c2c5dff6d91affa8468c82150eebecf5bf8d9a937583371c2613be7af5c69beeee3c9cbac430cd0ff4a151cb884191aa15e28b15b4559'
'd3afea20f7b667524c2e70e3c46611776848d9e44462a8f987efef28cb36df0be43164889ddc41177b3cc63ad626a17569df61f0d442b284370cd2f5e639d369'
'9ea2afdffe162cc85941fcfee330d07dfd1c0d18dba72a42d02b0b9cc0d61a3288dca5fb9e089e8978f1b69b28aec3e77bac14d168c97eff961ad758a888f6a8'
'a3f90d270f18265c84eaccfdf5491540746b5dcac5b0484f2fc687a74e6759f7c18ef4328baac6e056dfb9c8d2fc8bc3080dc214ed4e5e6fb79ddb5b3959bdd6'
'0dd67c2f478ffc0712d5b2a63f118ee05a7d9db9e4eda9456a44c06fbd61ba3880db75c64b37b6c3e55c7f6be2dc26ed26c1d9fb9a15e76b830b78f486b90ca0'
'5e4fb6d25816a63b5bbc7983ec4cdf54a2b2eba470010edca6d2df1c0be91a9d09a3452bbf46a09cd717ed11fa6e04347054d70d28b4510d8f1d7f5d28195f98'
'23e503f823c7cccf723f6a728c33ee32412cc30a09d5f51d07a762502a09adcfe458882547c2688b81fadf4edc9ebfbaa72ed0a8fec6e289bef81de12fc8e5ce'
'32e342f2cb3a98941b5d354628d6709c94725b9f0e898e650a12b249986e033625fc42995b6773f1015bf8fee1afedbd289045d18d173dc61762b1fa9f1cb16c'
'14f1763ac46b0684904d86363dcf65e0e8312fb6b6b5f7a3d9d0607f08ddbd1122967b8b5b4eff1a3f70d9dc89c1b68564cd943be998e7f5ea9516d195acfd58'
'5b6d5b3f47851a1f6e8fc2368c0da7e6b5b2237b01c3085116a46b0f9f3d6c53977abae03035e7fb2281d6840664a2db48d91d8f4806d2cfd8df9b03272a27f4'
'3b6b6a428a492069bac13c8cffc42eac316af2ef7c138a517269f11857393546dff3e3dd242f2ee9730db18630f623086aa58577dad43349844a6f542f260ab2'
'b93fb3cd53646394ace88650ae2384b8b4160e7b60975b068d750e0add4474e926e9f47112432d940b90e90180bfe308c999bc93d06ff56f5d1bdbe8c5320d31')
# vim:set sw=2 et: