PKGBUILDs/extra/thunderbird/PKGBUILD
2021-02-25 23:59:08 +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.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=('c7d31ab6b2863c14fe7e11df4e805ca0ecd1f6e6b5e7d5ec73939500c5125faeec213b4df25f23a5f152345027926356b7df47efcfa60ff0f9e5b825119f0e51'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'6048bce2bae535007422854affa3cc2cc588e6029ea3083aa4817795beb25dc6e2726df082ed0fe9664f328d68b2f60e2619b87c359c99e73c9ace3dce0f3176'
'e3ed2708b8354015cb3d2c81048d1ce4932d1effbe2b40efa7cf9b45c1b923b9fd708645e2f8aa0136a485a3f7ce6b396b85721aaf535a4a764fd5005fb7e222'
'bbb8b0e7b9c67372eb22e1d6b6b5758fe504ded84c40a076d4a064374a1bf34ac12d5b514b328ac9ca984d976b9e0fbde81e68a66bec915c997d6be0c0917584'
'6a607ca466ba05bbe439b3188a470782e3f5bdd1346c4d24eafd7ca7127c4f456d26de006208affda019a010e4290e1e6940943764ee03af6b4c0933153601ae'
'009df4311c18d408211bbd40179cc566dc248a9ff38eeabf7373b8a5551493c92486aeee114a09ca831f759e1ba321b56ce370f7f4be7eed82f0e90e6af5e449'
'c3b4f7a251b558f5cd3925f99d47e03372ab2512ab538c98451866a58c8c0460230316079699ddecfd0e725f09a6cc0765d4194f5751da80814587bbe04bdecb'
'58468edfcda578fc9b262524d38f31857d59411a4e63a608c5db517bfa9bd7b7bb20261ee25647ac74f5b48bc18c9ff542c8715323d59a63b2f01a0245e43647'
'f28ca741d5860347964388fcbdab173223ef56766c37051dfc05ccde0f1e77184d57fb41dced3636967f895ef1f92119b99982cb37f2e991ae833ff5de00a169'
'60fb3eb0e0e24c5a52ea5b3203fe1a2c83920579607cdffa5054e6a8d861e8963598ff23c24fb7e0fb5febf997e9b79126046b0413a01b5fc067547cffd64879'
'3ba9a8ad0ad92c1f95f60fecbc5b06e9b4afc8e5862c19c5d7204a014b689e9022b05f7f25e7bea76a12bb53bc35fb2daeb0bafff248002490193e5a96091155'
'e2859b10dd6a21cd534ed066cbf45f73b020624c0822ffe7c00a9bd38fced0f1e0d6684e907c855475e68d031934346d8c79a4280f91141b4bc6a6c3684b0f88'
'5df2c6e9d88554a120613839d07d13c7d181dcab4cb45941122ebae16311f810ff82e99464124a5de672c41a1dc99fe89a54da425ceaf3df0053e340049ace4a'
'7178f9d97fabc04d46e6c1b0857709ce88720f44e316868799e92e6c96a7186a5c978635f72f63cc5568b356a03b85a9e4bc4067eccef9bccc8a1e6ef4d61517'
'2b1eabf4fd17d1b99acad9fc0741093dc4d79fd94fab023868aa8f61d9e7dd92b53d2a963754584d2d4cf0ab95a167292cd4cf8a3d50d724f5ba4513c2564334'
'9753aca2e05439818e5d45a6bcbc64c48f3342a3ca7414378fd8edd72304637404b29581833ced3320640b8cb6bf66f5410a090f76df331cd56beac013c99a9f'
'ee301f1dbdc7c687b6825e7636121c583a6410465bef77965b3230638a4584dd45caa75b938d001a2b378a58a965e324912637fecb06a96b841aa0f11897899f'
'd79aa21d1b0296554f53bd79074f9ef2aba38496ce6ee451bdb274a6441493fac455e43ed23dfbc83b184699c558658cdfde970d2969cf112b12d86629dd7da0'
'977a2dfbe08e86b5b15c5165d77a0c8b4218fd3a77c7c26b9d6ed60422ca2467e661b0fbb9a5e7fb0e791fb2e6c58743a2a540bd10b0efe077cd3f2a24f3c515'
'24e84d2b01313466235fc0979b8d2547a453d4fbb5db42c606c3e95241a1e0047aee7e130f5095ab57a71a3f581c3bb312aac8a92c7dfe0b4f8b89d1072eda75'
'9cb6647db768f9693e93b9dc81f2fcc13c87465dc713661ef26f0e238bc7d61fd393749e26e85aff434fb5de253f8435cb81ade6637456cfc6a5cf52ad362522'
'f00eda0202e562e64e0432978d2b0ab778189d28288c0e7afbe91a9e12d084b0b0e3c8b19ec329ab0112155713c67876fe9d81a9218e537d8e751b59a57af9b1'
'c1cccb2c151496009e19e11003f0ecb9b790a8d38eee729665ee5f0a60e8301a42187a6b7d6994cb01f429d282d4eaea8f8456898eb3ed02b35456e9aa029e80'
'1db2d3a5315ef3354d62e0d3137f6c3a67686379b57d77db37c9528e9d7be2769fb0fec69923de792cd1c2e6f9d2021d18ab335bdb175f12b46dba4d761f29bf'
'be36ab1dc00f94924671aa208e5d0ce9026c207a905943e6858de8c3d1e5c3f3cca17090e43371802069079e05eba7d3d1fdd1a076d3f998959fbc1fe33a97fe'
'f3ca1e2a43f67b30ece5ca766c6446a09ca840be153677947a0648365a36d863e2b6f9696856a8a0be489c3162c80f61b9e47984c6f139f9dd19841af2b14ccc'
'7c1f1f955dbe7c93179e5cb0d4868af1c99947202e886016d74018aee79d29fe93a1fceba7bc14de2ccc354532f9a7b0bc27554041cd78a4bc064ba2ea5993c6'
'2703e48c68aaf84c7da1c71f59784e9df8cd0986da9e3174e968e41300acd51ba28adac97e293eef2f41c32fc7818037bb0e6df7ac9ef9a6e502cc1400107df2'
'84e4695b4d68b4adfb39a6937857473cbb03385f7508cd3644888ec27c9508e4a7fb370d80731ba319187dfaf0af62e46030c36b872dcca7995abfdd2caf188b'
'09e7c9d85e59c0bb4a4c4e767fd240bf28a0271c4146bc1a77bb77fb5b23307fea046c711c1039e9914944f62287b2be749a2c2e1e1632b6726e6d8dbca6192d'
'04893aea2509b5d36283700a028e85399a25543308f70cae30d0023bdf580b3bba1aca47a042170029cb670d3ac16d5b4a48aeef7c29080a4c1c8e68050d74d8'
'b79e5658913c27628ea94a3c8b0d52aa17dcb9009afeaf138dafd4d70945ff90c466666676f634c9f4c5808dfc71587ef72628e576b1d6389e6bd576130d41a3'
'779b0fd7be93ae028d3af8dfc1b90852fdd39eed6beaeedfef7608dd9b7d020e692939d441b0c59fec5f3cfceefacd36e2aaf0fd7b10084df97ce5630d59e069'
'e1416db889b9be0c023b4578cdba75adcbf9d4b88b29f6e00d5647c09aeaf1ab1afdcbd88f2fe2e3151454452b4077011e20fc5517d3ca528f36b2cfdfa67ca0'
'6c4e2c9ee83130b64b150e85446df8b979af5984630de3a32e0f11f5a39cead50068a532c5a5971ee93ee9242190c176bf2ca4ae81d48d140e4fbef37bcd7a41'
'22024982614c700e1fe7ef048b83859e099d40499b57559758a03a8ea116dd36c1ab9820fa7ef550558c09f9558515b12dbe786f3d7b6d27a3ec077b8fee4d4e'
'92f2590362935cada2769cb84e3f27395353953493bf15d1e8e6cbb8875cbeb594d071a3208d040ce4c79da501066ea2c082923ee8faefc46c3e158a4c1a23f0'
'2e1b468fb2f74cebb4c8d1978549a12bf2472b8dc07581281e8eb993b2454c5c23c1fbf99adbc4360daa00b4f6744b1d7e45d165e3c835a1a656f0dd22976e9c'
'0e454ea9c7a87d34235d11ba843e9801bbd2a093366f5d845a2eaf0cc7e07430409f266a09f8608750e2bc78564e8a0a24591b95ffc2880452546e60f94b72a0'
'ba07b4ea6a9e46b707306cb18074bc67e318195a1fd257d2632b90ac6de8c5c45db178dd04e51e2b168a9021ff278bd487597bd6840da1883f8874a37c0be17e'
'1053066a04e48dfaab69e409389cbc248b03aa32b9806c77f1c5ab2e69adbc9fa5d91142f4b87d8407d01daf958a035e73d44f7f0c3d1c13c141c79ff19ca9a4'
'1c08b8daa87b50ba0474d55a4d72161796e58e76e23a88e6c88035bf019aaad9834a625f8fd45cb42d106043252b15f346296573fdcafb7d11643ef2c73376a3'
'cce74e59f21757582e83ee05035682dc6371f3e171226dcb20284c5528f9415c07254a3b1643e74a9d361f1d2441fb6b4d9194fc84630d58a35213bbc3bc3394'
'bb6c5a9d6895de4faf6b19500d9c244976ec11fa88b16226c15fca17264a09f1ee7deaab7eb7b2b9b22b176c959a05aec578d9b28b4c0415f73e42300cc6d097'
'ec04f1ffb87cb5c83f1a0d1fff72d39e01621e35fd506344cf50217ba056428f6afb52a89824d89ae2968041a9f4a316532deecb10ea4621ac9eb93524b0299f'
'1bcfc9d9139fb30e0c65b688b1bb483d9c0cad0830840dd56b958c03e842400922351a5152a0c3d7a3e843fde35a51a26568a18ae664697ddead2a37c2fcbebe'
'7ba6221fb3282b13c399aacb5d68063a0bb4755d222099f74d63970a4b9087170e40a87c190b1201f1cbb2a932479bdced737cb52ae29715b64df0b827e18aaf'
'79a8c316282f73bd2c717f8b01cea00d7899fe22b0e295c31350d81a1c4ab7e663d0489102284355daebbc58c3b1377a7f8495484a128cab9f5cbeda99bb8682'
'673d7a600704c4539acc6a7e800f0403197303648633c860f38d330112ce6e17a99132019f95f011ed4f2073221358a758765577980565d6b941547daa0e83f6'
'44438e9c6fd938630ebdf768659acca14067ffbb7831e889def33109e09f24d551a5f181925587ffddf7d54c8abe5a4320c8c7110459bbba44f3b867c450d1d1'
'6fe972a136683994b595743527640d51f4d0bb3880b794df5c4c611a349dc56f5968a651b3fd62bec58511a6fe7c6ef7d30a77e7c469b20f1060b4444be4e2ef'
'e9e9b22d813f5b825f660a977d3107caa7efabd6c9b8a7a2e9371cf18d5dbb3364bf400dce589864fd4252f9513227e3396589561939595e19ae575bb4b3d2dc'
'0026010d0aff81ae619e1db8e9d595e1c51177aeb45c1e98d04d6ed276f3dbe4cc4758898d1982a6443f35869d0cdc89cb44ac9f2367a00fa2ecb350e294e0f3'
'1c25d41ceca01c6300c9cc42d643e59a5d97ed73aad810c148d2845dd51d28561bca1342f4d86da61285a511cba39aeeeb455325c38334586d5acfcd1d1e2768'
'bcb6026d3deb8490998feae8504f729bcb559ad6c7dde330d6f8fb2a1e4eeff090e7ce1313fd2a6a7e8a44fcad519a4f2c8f2f40d739b4ad17cf0bd795ca85cc'
'7ef6dc592b7f1be9227bd26372c19c22d7c3449774c98db1628a46ef3b74e5de8794427665f1dd0139c1c3d1ee14ca0d7cf2b8947b0e329d1f718ac6e1b32bfa'
'9bdf8e207003bfc9b82919794d7c8d94dc27d4acef4527fce2dafcbd8721f92c63fff72ae0f59f8f44d16d993e85a8c32672a62be8767172027565b1026c324a'
'cc9a7ea3cf683c91066072121b1686057bbaf55d5e43a63deefbf40df8a14491e37d3c361babb38fbb839ac24aa31ff2a0cc9dbb48848a4bcd2047371fcc7bb7'
'e98b5772218608e5355635a80dc49156ccc18297c59368e5e4a6c5a40b3716b240e67e9ec3f69b8f230b8e7ed4b32cb6073743e843242d67e16c11937adab50a')
# vim:set sw=2 et: