PKGBUILDs/extra/thunderbird/PKGBUILD
2021-09-07 15:53:52 -04:00

309 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
# - revert change for clang that breaks gcc build on ARM
buildarch=12
highmem=3
pkgbase=thunderbird
pkgname=(thunderbird)
pkgver=78.14.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 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
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=(
'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"'
'fa "Persian"'
'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"'
'si "Sinhala"'
'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=('a6b70235eaa5bb334bff02591e030cd19a6c13d0302d12a83966a93c97bbdd6557c78418cd26b486fd1ce7b7c1b84cbc2397cebb29682ad1b45bc8de120cab3e'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'6048bce2bae535007422854affa3cc2cc588e6029ea3083aa4817795beb25dc6e2726df082ed0fe9664f328d68b2f60e2619b87c359c99e73c9ace3dce0f3176'
'c25883c4860e511a99d9fbfba5b824145c0862729101721605725f609ca2a41848b741dd100eff390f57031dc5f14af3ea30133de30f75cb20197c420ae20972'
'8ca4f72f1fc0a7fc128f05112d8f77be5350826010069ee3b787989131f02b82d014a4781e97ebe5694852c4bb5e87bb5313e562cfb7cb2afb6f904124027e13'
'aa3a55984141b42f8f76eb6bf3cdf6f77cd49e3ad20e2a2d2f7858eeae8d70fec05730543a263e730541707044596ce25aad512f11deaff6fa13e6cb9b13c4d7'
'c0acf89f17545c8619b22f1cde3d1d15c503cbfe0e1f860d4c68b27088a2b1536200d031c65d5bd4836c1538f27313672d391d2de7dc836755bc6827cb8fa0df'
'f88e4154f99a898783ad24f9e871aaa4a0954368686fdcc7aa0581c4f3f97ee234842c32d4acd51ac5559328dfa5817bbb4644049be413ad4e93b8a36d316f34'
'b18746531c0cda0c404aa671e07283786b208806925ff4a8faf3bd8b6a7634ca40f9780424e9f5715753640e2acc999cb5f6b450b9c5d9a2b830b51070c9b53e'
'00802c72d35569cd0f1ae565e008cc0535e0b8c347e4e2a1a3cf7c2ce7a3e3ce850aa014202841642caf2cc55d1f9b6fc66e8e2f9fecf4f61ba45d5adc88d5f5'
'b8067fe7948c9b36bd89f36ee205b7d532ffe52e7562422e4a1e625d1f966fced7bdade0d151947d4f8e812ea1abd0ffdc04f50f8c674e1a1d7f0312e2cadc96'
'a9638d094f36a923eb818660928fa3d091c672fa1c89d10dcbcf05445dfe85076c535809e0d48b7dfbf7bb66bb32ede191fcb9e129c385ce69f15e09cf62fe95'
'501f176ee8907ff55f8e1541d603f82c12a890a7293d813cb20c7bf7c22a1cc451c73c4da3a211f2ff1e22920c19a595f2abf38698be2f90cfdce59bb8c55042'
'8824b22acd409532fb029626f99f0798357bd020d1673ec77aaff6a850d8d176bab3860273b9554c43624fe138d511200c3c5f6049fb62ca9c631f411a76aea1'
'8435af58c4399ac752222836994d9e92f0007417981c2fd1ec5ad01d4c87f184630a281d788c599369310c4c26dfe14c2f220c2cc03ccd51102c647eb117d27c'
'53e3e3dc202a44a9247738c75a6b17f0509bf581bb483f4df7279c38cafca623c72c02edfbe0609dc31271cb20e779445b527167bfa3920f1aa1ab35e6e7335c'
'0b4edbc560024b6d788c57690f6579b570d0f1d614efec2df010efb733f5a45e3b7cde14f2e9bab264eb14dc4f018bf5f70b42a94b19bb599e82db85bd68b203'
'8573e57d020e08e2b3ad8e74fb622cc79f76324693e0fc09328c4351e59c66abe008652e34a867d22939a0ece9c56578165e0ebb8050f2f8044c928732656383'
'934807383b8503f5967a280a912ff90412e6e63f801d6bd01bf0412faee2b6fd3dc169218673b0b89502e64e3499c6ff135f3d820519a7d0c928a56d984f544d'
'766e9ca51dab32eaa916fe023fcd9d9a2630775b57798e7942505ff496464711a481286647cf75ec599adb1b89b8e843a39625611ff09f583beed31d76b9a67f'
'611d68392c1a5f4a2f2833f9deab7b482f5d7e5050b675a3b227680549fbb8c24b51592021ed46ab32a5c1f6e73dd697ea09c0a14cf7aa8bc2c779ef4bd0a493'
'04c0516a4f0cc6930ec6e3f0114d0ee969dbab1cf1f36d889a3b9ee9c9a7cdf93669ad506ca7e3ab8dde11cc09323151ec90d9fbd6692e5e39807d9f40ae07c1'
'71f75d8acba15165b11963f8cf5dd18285aeb5741584ebd2d278429ceb2b2c98bcd4f1b047252685c84c08e5429ce17b50da314984c4a35d24620582994bd572'
'2f0c33770ca10b157d4bae6f1e99e2a3e0610be8894d0dfb87c380a8eb6a20198490947cceb0302ed9ba071a564d07a5983e8a5a9c9786faca33a7dd33edb970'
'a18dd4bd2c0299b8183cb60e7ecca7b914142999c7792bd6906a60e12ae2db005d5d1f047aa29524bd86824829e91cc3dded6f94a91e559e12c0a65ec3579f42'
'19aceb0f6038e24891a1beca0811eb5980650a909b2328c8c3cda1894954e852f9084eb25f259f60249d5383e59eb5e9b0f96ab461a78a2afcb15ab5592335b7'
'a0d46a6b059290769867630e0dddc06ba791a4f13a56359f744f31561b927843e99b1bb663e68b85996a29f677a84726b96c479030c7a2b5aec1c1cdadbcaa0e'
'25c0cb3f8969fc160c06d543d95a03c4ab489f0baeac68a553460ac3672b56aa7ee4a237917a79f1206aabefb98a78bcba209b74143c4daab91b8553acc4b43e'
'7fca64a122c06c8513c8ccf1fbc11448b332a58af153a4de67324fbbfd1917f3e607c880bea1fd24848797b0a7ef08d3deb7423a402502290b68bc94d4efa705'
'9ce1a905e041ea463bd3f937991fc2b4b4ad9ee94b123f486c8735da03c24066a216b25f247803c341e33870f7bbe8114bc7e09d9eedb795ac1139662ed49aea'
'b255c97b5bfcd8094061cfd4f3645a307b5dfe082d7b9c8ae6ff86ab6da9fb2bb357f5950c205b3a720629b16f3c78acf1339a79cebb452180e1067a499c167e'
'e9805d4e3ec4ca981d2bb7f502fa3bb71aecc76afdc1df0112c883266454d3d2d69ff4dc7a14936aecf4e1266027503742644687fae845224fe380358b15e2df'
'2b96748021731ed290e9681bb6f910142137c91f6a6a5c3785bacd677baec9ddbd0fb8132aec7f0e0c75aeb4d02be606a7bd2d66a487278818bf5c51d71982e1'
'088f68803fc404597eb08a55558eac2fd632c771e4b695b99c61ecdec06e2217b4971dc96f8a75c516497cd2831ce10058e623cbf856232d8f62a96a0879b43f'
'e896e20394c9d6f3ecad834e8372ffc3289dcc763385cf81af8aa60bc0b278f190d986ef1b4e7eb0fce88749ce3c89b554e37989d04f8acb650727ebe930efa0'
'8672d737e3dfd6e7cb7ee7a4d202a64ff4c8db62d17994b3def2e6e673a4c17a5c43fb28b7fb2dd36150b6eb96c9dbcfc36ca58a58f6084bcc02eb3247c2e8d2'
'd9e78aab16e2c018a9d0429d68c949ba2ba12f9a9534ad24f5a64018a7333f15d7dd87f3b966f97c85f74a72af224c5915c6d411497fb4157c77236ecbbde0a3'
'3bba3d43b2dd298eecb56b7b21de2a5d2342795435e6870c8b32f87decb4d9b5d4cecad5be92381e9c48449d682e05eed4fb86a24c0d33cdbaea5d24b0690ea0'
'dfc6ae3a98e4f90da0b7ddd54d728b2d83b82d40132745ecc7e8bc25705d7d25a6d01c412b27a54f175bda122075051e53a96ef706b26c8f7b505e242a9aadaf'
'805ecdef806b5c50c3a9934b23e450d37eef0d9eba84018f2205a93d2b2d3d7ffc7f9ed8e86718e7aa9a232953a1cc8faa0dd231428b6ea2bf9d70caab6afd2e'
'b4906b216741f9e2c70aa7297f81c4f3934fb05bfd0b798a9405b1022f5c20313d81045292d49cc2751dc1ccc94aae433cd87300246d22c518b4c3b18e729beb'
'bcaf7eadbfefd816486b6cc45caedebca49a2c53cf1e88679a940b522ec99d4d6be340438da7a1e4a9fc9e8df0fdace37916c9203956946450497c2a64920fd7'
'1a5bac32c29e73236802cd4733d9bc0b1a6689335e1daab32b7cf3b332dc332370982451a325b3ce293d74f960775cf1f8b8077239f548aa1471f9e3fba1d93a'
'1726e41174b24315c510d8d1115f3dc459a658d40482952b686a5cd21f7149d532b547424baffa5d4d436f7fec8b6ccca7986090ae8248d44b014a5ff54b166d'
'd494e370d729bdc9ca0944009df0630b64f4a5ba4bc17f2ed7b6914edac17322472e93abff5b65453e92cfd7c803763575d6e870c9bf78ad81f91288890988a8'
'04a9e206546447a87cbba335053dd2f1375ef2f80f3ab52c8411548661d6dd2e600e0bbc4bde073e980e7fc8f9bf84a66ae974fc314f15e8918fad54e9b1282e'
'7e1abc5836080b35a61d3772cbef3c23d9944ba2a59530441febe24c886281498b2bea2cf464531cd6bea8fbd4dee293cdd12273cef865d7fe1f18f38891011f'
'e434559d5dd5d7e4b3c68371395257e43f7831af422d11db533fc436f27f99d7d48198d6e09ffe8ca678512a9aaa5f2edc39b7b1394bda48bbf66e81d615cc47'
'c4231682b10125bbdfff6d223c870afa838231de48a8aff7559d5f07804ac0bc91b9b8c17711c8e4178acb569c32c996fb176092fa6e2cdcd55eb5cd73c3df63'
'4d227012c317132c929f4eafe1d7a0e10e1f1ae5dc973af1f4a58e59934b5d84aaed37e3abe366c8ea020161c5ddbf85b1bccf6577729919e5b88f655d91c5fd'
'172e8330a60fe6ab6113e154118c29403b91becc59fb705ad7743b039f4301585521d327b014648c097cdfad3c61f714c0309e37bed29319a1def3cb5acf583f'
'35b9f42135c69442407c3941fe2aa9dd084f7874e502bddaec5bfbdd6389f1c249f6e741094bca249d703b12a723483456cfe8f6d380ef4dce7e1159521b6a42'
'3a3b7001bfc4f1be61aa417a4a3c82093082e8b2a0e2b96ab7f2ae16314d2f048fae99ec9ff4161c3f5c8d3554189879acb49f6c9756e78dd652529e5c624633'
'f86f1cea3febf01835b090b252b1c7de4229c9bb2c759df9235ea3953ea973dc3d0c16c4363f4fea01f4ac643497f5692ee4397ef800aa45e74f037422ad9d9d'
'a74a97ee82b3f89b4edc61934f313cccea45533307114d397c2bc7f5b1c66c557540bdb9e5b7ea537a3d3324cec6b393e8052d4b45a5f53afbb0010914d046b3'
'1caddffbae098a9f2ed6062d333f67551a82c18d1272f612a11f77060fb3d7b802bd62d07cb791a151d097fef9be8e879a8277ce9668f5f156caa3d7c372d499'
'c45bd949334ce0978307a78f26967e966ecafef64c3a2e9790be2db2ff115ac3b8e9147635f4b70d97c024506c44a4f059d82d60c6dd677aa00c7d03f7722620'
'859b9f4f0b513d1fe93d949d07e08776e92b792422e27f1fa69b15d1840939145371dc183cbab03ff4a5401c59c5cf69fe6dd86b73b30fa41922f5b3ecf3b2c7'
'0febfcbec6ca3b268774b16a54cda826b442b33ebf864a01b7b29518b006fd581a85522688bcafe1790bb976463dc42ad8157a6116c465b040d7078b147d99aa'
'f191e0d9c9bb7cd7bf75d861c03e71803c618311935b3886e6e38952f8490da7d03562abcd93a7155f310138dd6391995b1325c264c7dfb1d23e9d52d8fab2ff'
'be2f69677213dd871feb35d00d515dd28736b8a233b9ddefee1d015681db2521505c5d5d55d9880cc76824188dbbfce27a6c4e3b9d04543633db21eaae1b4c49'
'7da839a826bcbdeb24fa296de7fda7fb7ad04a0a183ccf5d7323d2282d963ce53bc3d04cb79ac0b776c7449768a1ddca527af039912f13cbb7bace00f3df7972'
'045e87e73ea64cb9c0e0caa9fe49b9e72388e997e2b27f176a3296ad4f9cf6f7a802c2c76373fd7c9ab252919a44a3cbe138d41c44bcdf69be652d7ac47e6847'
'256d0793855a1bd3b47edccd5324c11998b7474a59aa22e0d9f7a6570a588111204dba42b11f2133759e894071577e0f08fff130ba3f9cbee65424d3f4efdd66'
'd646bcb92bcd46c63f08448b03ad88067f2d12f2624b0b2b382e18a2475fa4ebf0199c83640560fbe319f7f71e80b2be7d0e27edba118d707b41715e776707fd'
'bc1e6d57cf1e85c1048c14e3ac0047f7beb6506b03a15c2ceda2afe295a5ef5f7d15773d6b9c292278317bfcdb9bb4630251c4937e7dd81a500cb995e81e612d'
'75d17de257443a8d053d01ea0618d9ddaa7a2f9fc3e7865c334c03cf39847c9707dfbc3c9be95933cea9aaf97ebf28720ad6e61a8d8962972a7fffdb76f6afb4'
'e151a566cc04bebf64aaba018a4330935dcd2455335e250644dbc26990f8b90f48b51afe2ee09507cdb219093098566d71817de2ff7585847066409a95053737'
'cba980ceba034dff08d0e97902f7ad5dfb4931b269fc16f14cb00ff2bf23391a95086be6b5df9944ba213d18e58071fcfcd4060b5f453a2dd2fe84e8ea9d2899'
'6b4b37123881c42b0a70727ad73929e026f79214a0b4ef0b9ff2adc45f10c6025379375db60dc3ce56c0f15bc129c1acc2426d90957e5c2dfd6ae0ca249ba526')
# vim:set sw=2 et: