PKGBUILDs/extra/thunderbird/PKGBUILD
2021-03-25 22:55:57 +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.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 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=('fa5f9fee79c19810682b0848c2a9ca9518ca755b47689984165538d4d2a3d29423dd061691d5d227869472ca7275680e03f2a2b75766707cab264a9733d064cb'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'6048bce2bae535007422854affa3cc2cc588e6029ea3083aa4817795beb25dc6e2726df082ed0fe9664f328d68b2f60e2619b87c359c99e73c9ace3dce0f3176'
'e3ed2708b8354015cb3d2c81048d1ce4932d1effbe2b40efa7cf9b45c1b923b9fd708645e2f8aa0136a485a3f7ce6b396b85721aaf535a4a764fd5005fb7e222'
'bbb8b0e7b9c67372eb22e1d6b6b5758fe504ded84c40a076d4a064374a1bf34ac12d5b514b328ac9ca984d976b9e0fbde81e68a66bec915c997d6be0c0917584'
'97c5d201e881643f9a7dfd282548063e09799370f631f6f0516c9953404c8f2ea98266000e57dfb544a8e5fc691ce18a5620b94e580a992ece8994949da566ef'
'5063dba84c3877fdabf0b5c619da1ca8adce88ee87effc7f5bf200a03d824f3e7f370df35e6a075d2461ef66715b5069bc6f95e047f8951bfed7b0ec6b41deb4'
'e94afe457d1faefb5d931d3015422bf98eafee448a2ad33b4a4486b89f5906dc962d68f394ed1d7212d8406d259a2ca06b82968cf75d903cb59f000af23db69a'
'fcd90ac526e613ed3679fc7a09b8f23e9612f1fd8d114036d4098c118174ff0ee06b1546bc429c9fe63d7fdd2069c1529cf897221462a81413b01e34b4a5f2aa'
'16460190add098c7d226cb93091972cea4df4bc35b3bc482d8f9ff9b044a1e4463fd6ad6da8d6e6351efc064191430a0a9fc7e18b3e9a1f0051079855b6918d0'
'e681a9c811f7619ae39942589e993725bf4a6c60395b0235ff193f3d8ed9b64811a6a1f135413b17cf662a94faec88dbd89499ce0330ddc72bef64fa3e3d165e'
'957ecae3023b4fbc2a68bc93840b979831a93a002ebc9917ce5420d6ec41cb6aea7184beea32d5abbbd58a7141fa436307f3294ed01d53359aad60177732dfcf'
'a0cb8166c3cd7c040e99c2466e0f240bf54347716ba08eaae7d43464c6a4fb00085aa06deacb64e1f6cb4141d91f1834fce738570ab15f1df64d8a59f00201fa'
'b773210ed3589e5f4751e6c7d840de8fdc79ae6518b13fe6e0ce1557a5a3f039faa8d9ac23cb52db45ab6e80982830cb79b8c20497709336cd299558fef33edf'
'32551947502cd22e574c6e1c927d1ca345a380fb310aa74daa150170b9b41f0b395cefc03fdb79b28190dc1a7c52c3d1af520abb7f664758aa4e17fb9b9e6c76'
'88ba3d7d219545647c2e089052ad083cb3f7a192b6bd08485b2c27e89b397430def2c7506f179896bddfc8613653d435d2ee707e74cba6f550216847027e24bf'
'a6c19306f0beedc03253d104a0bcf9b427626d140e7ad25ee6aefed620c544a64eaf4cae9eb5665d2e62d0f9d2119c0d4135ec43c77516d64bbe669ad8c9c9c3'
'e19fa80a5df2b75747b3c8fdd40f756d1150a0a8573545a349c3f5a7606b3a7d8646090c2382cc4da5e01d736457df7f38c8dff3ec8b667838268a6e09bf91ac'
'bb92f00b478b450a6f32b2271f3fe0dea0e5834ff490faafb4f5e2e58c62c37d1c5ca7b5e8db927d557830b520ed980355e6b59a4e64d46f8637b03023c275f3'
'10f6b1fe4429c0bd06b0958084b2707590a488b97f5dcbae1bd4c9789fc968160c13402b997b3eb18a0f4d0a88df885313897f6a9d16d1da2c4cf2bebbdb6a51'
'e4ed0a1af4477733d3ab47a63c621aead2724c289ae90509f543898c691af0fa72a6fff9c2e4a75e6c93194e4abbb567047fe81d079aa6c5e5a94b4cdd778dd7'
'dac4322bf74aa6fbeacad934d70c0bfb31d682d9f0cb58b9beedc6db3e8d34a69df28cecf2b4d99c1a59dfa6c7f600fd6bdadd79058d5e2743f31534d18cf6bf'
'febbd58bd34007b6c06c646b4ac9b753d63cd958c937ea4cc67c131907c133cb0a86598fc8d114cf708cfa585c7c1332b4b7109fb88870c5e334f0ea4ac41936'
'745133e2e16d56ca655c8dbeabe772ea30315f8265e6552a63bf0a83819d650059930402cbbb30bdae86c1db2a4806aaf8e47144e7eb2b60ec691012cc1b6bd0'
'fc2115befcce6f27062a9de9d84ed54306a3f2ebdf2aeb0853e643982bc32a79be0aad81b9ccd835288186a2db19b939019013cb56cea47ed0be39909844d60f'
'89795c1f4a2b782727c6d25b9d681638b8e03b480e4d7fcf9bc4a3c2d62d73eda0c50be806c93803af6dbafc45393458ce7028839cc1a7c41e6fa6cc99492c2c'
'd1e161f9b84719eba75d39949cbda2f2bbafc1d4e7ca3584fd2a3deed16312d177552ea99b4c39e017839423808e283038bbce6f5655ad735ad76ebeec96fdbc'
'3837d40c3f17327ca95592079598f1cdd194dd8a97526a5a978b2c295f74d89d5751f2f2db614697bd4134ff05464b845a5520272f6ed27a37f20d39bec604dd'
'e6248833d5357d1124f109358af24a9050c45d30c2f709d325f6f61acc27f0cdb57178e9fe8b7c2e81f2a318d4c2373b98ec3c128c0be438b24730dc60929cae'
'e4b73d00e219776988e1507c981a46e94ccdc31a2195b21adb9abe6440e19a5fdc2dde5007d3c63b989c6d94102fa84f0635eedbc6c2a3931636798b5d8e7d6d'
'227474c623cb5c10da5f778f093ab49065d1afefa1ecee8d186632a469739aec49f839467a356996bf8edd5f0abe5482c8b69054b076709796ad61e540f382bd'
'eda0fc2d3e136ea5446ad017e4932227c353053b3c87044576bc31e03da9c7fc1631214d2dc474b75d9b8c59f370dbdf1611528603bcc94fdf2ffe39423e521e'
'a07d514349a5539aa080711329e38138ec9fe9c28970f4434be8b254a4c60b56d675cbe180d6c88535ba3c86452befe1c43190caa9407a78f77d70c342230acf'
'0f31d01c40a454629cd829c456579f16667f961213f1b8ec268fb2b1007a3affda41917e5c41faf53f4726098060e4a8c96980d3ff8906e1a3d39e8f633b13d0'
'c7b56a3aa46a1c41beb67a22f0b8dc6b5f3a2523c9eddc3772fa36f3e81138ba6e34b6ae6c03c59e3b6d5e3284b91a0418c3f0785ccec0318e0d963a85bc604b'
'5d1ff65d71d96cffe844e436d7996b50fb59e2c0cfef22c18de2e0ad2b15e9c50c6b7ea85a3d956f8ddfa9a1e688519cdad4b519b770936b2ce4158710a96863'
'a22fbadad674af66ba74c37ab260a30e41443612fc4d200978240051b95485a56f582bd110e35ae0483034d2190b1682c51c053c6c9485b641390021c2716bdd'
'7211a3b8d3f28f6497b782094776912959cc58700bc216732ea94d2d6a2a15099ed939e0118aa0527cf02ab3fbd70c86585ad8707077cc4bfde317ae311a9413'
'3371ef7a780e6b87d65ae3d4e9ae3f808e7335ae81e12dc0a43163b3aed9c8529b9e4e42d7533a9c743e4c7d61fbee99ba1efe2f2910a96b79c3dc6522043973'
'8ea6f9ccae828c4a8b764820d706aaae541cc4962db73fec56488741a21f7d9a64ff12c3ecbe1002ad71c670a085f9919c8045c09f6d635d2ca9ade99e1d9006'
'5978d1e9b08a7850c7b7d8428d650e27f3969fefc6dd418ea91f329e1b9dbedc6ac7da759d4ea1850beb31ee94b91c4d39f98a2cb499408703c94f0f41337992'
'32be1a358ec34537917eea0478775e259f0b78d13f9309183b12e866faa6a3334132258f062628fd0e35fe8d977205c253316fcdaab66f185e883a620de3860f'
'd1d197ee83f12393fca25161cf875b6727e4885f3ddd98136b99212dfa6e88697f05efd744fb6b578a5ab484398bb0b36dd870e0eff89d194c84433dbd93147e'
'2ccc3ae5f1b3cadb8ca7fd6f720b51a8a855ee3d220640ad8f77c383ba63e4d7e18a140c60ee779dfadadc8b9f5822741a2ee8d6fc18794bdf153b528bb40563'
'e4fe83bf7b7011f0d3e1f539002dba72740e19765273ea6af565727012ec7ecc9eb98c128a16cd5b48d20957f7d5312c29ebd1c8c18d6222630c0bff57ddd458'
'c984e7286f38c0a3c1e5f509fc5a18bf090fcac61a91f034515955b8d133c29749131efe68018d81a49f17cf812cef383481defc13ba4cadce13da4cdd9ab80b'
'77af201f6d46b677efce2ea9fb52a51da71768ce9a835bbee7be04aaf20783fd2d30978eb1f60b13fd0fa0e3cbd1ade97f6c631637bf1bd0e35916f06b92399e'
'21438384cd02dd6e3ed356566675b6d530466145f0e300227bc41fb3d3356069cff1c45d0ac55c6a88797a4d2d59972a5aad211f1934bfc29285ad59754d5d58'
'b1c3933700b5e58f36af446ba93dea1803570460fc55d5368d8c21f49e7f01c37e3fd330299d2af5e2350134f1fead5926ad441f0bc6ebb2cd318d3621cbdc98'
'b5bc4f9da3abc0b7a9397f21e67ad38da336e41a96e47b9ea5b00a9e96e07111777ce3e9b5c87cc5ea44398880b7b027e42e5526ae9b4d7fc1752f1428834585'
'7462efe1aebe0537a59c94aa80cf0728a7015a9ed92d66b3207637add1b449dae7569ca264ccce071d2a69d430ad885bf43562fa25923682d48a161ae3909196'
'0bc427bd428f78278d36dcc9eec7f903900168c3df4fa32cf81c42d5b7505860913eeb9a72ccd6bd25000596bde64c0dcbd8ef699acd131589d2918c4d9237f9'
'f7e057e2842af335a17b11241252aeeb23850d285e55ccfec52f50217d69ee00e3e6c8963e6534619a270f9b768c2902af4742d192c7bdba7342d8aa27192191'
'3b22a6f4def7c9bb4b20d99b4d03ecc9307302484ccbeb56d72598a5cfb1b7195003cf4c9c9ea4d0c60194a2975d57c961cf28f11679712b9d11f57cca37acc9'
'14f129299d13f990b94831a48dcf30da22a6ac56c19550634611785a13066b6c6e8ae3150e9ce5c0ca3b6402a8dd710ee54c22072e6043c2bcbb5f45e77fa484'
'32dea4625116fc5c4911e16beb534255df8c269db7d1310cc08732b996ccd8a94af69bfa8a67e2ca8fccda732038cb1ac19e91be5fb0543d421aef9267fa6252'
'59ee4e93299b09b4204f99bd7d1460dfa34fc986a2f3b8d5f2ecfc4549da1abdd757d9d2175e40f043d60d54197700b04c30cd61cfeaf040a5bba014dc5f784e'
'af00e8cb4fa1be45f979f671a69f6454c2d56abae6fedab331607a67f85a3218c2c7d798fb48f418bd3e35f189e571d90c55310b21e7da868eb051928ca8780f'
'69e17fe996d23478a1a5741b49722b0beb0a471f7617db8181baacbae8e9fa20ba776b9787d8847b8dc16797420c7bf52e014e1376048f342fd2a23028481533'
'41d1166f75f3979c7885349fe58306f7e64c701abf6ad57233fb7e6c62cd6834e9b5284cfcd0d7489f742a28b5e60e8ac4fe2527ad742cf4df21bff7187c4587')
# vim:set sw=2 et: