PKGBUILDs/extra/thunderbird/PKGBUILD
2021-01-27 23:05: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.7.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=('feee821eaf1f18e48f9b6f88dfa0ccf1fdb9b7087d5a0a1a284e4c8b931fdf765f9b34d80fa26fdc0f4f3b8a8d7ff0eb66ff093defa18999ff8b7082bba5c85d'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'6048bce2bae535007422854affa3cc2cc588e6029ea3083aa4817795beb25dc6e2726df082ed0fe9664f328d68b2f60e2619b87c359c99e73c9ace3dce0f3176'
'e3ed2708b8354015cb3d2c81048d1ce4932d1effbe2b40efa7cf9b45c1b923b9fd708645e2f8aa0136a485a3f7ce6b396b85721aaf535a4a764fd5005fb7e222'
'bbb8b0e7b9c67372eb22e1d6b6b5758fe504ded84c40a076d4a064374a1bf34ac12d5b514b328ac9ca984d976b9e0fbde81e68a66bec915c997d6be0c0917584'
'46eb357273c79a3077d91086bea0795bb03fda771812f905fb9ab8d76a06cb735f73eb314ae044a1c92d31492616da8b58b6910eb61e21b5cb807e7e3aec1578'
'2c8f16d8d58f0219d52954b4a327fb21edd4dd3c6e88d991d162f6f5a1b712a041e7fbe1f83a00af67f19465bc0827a8c1728dc1c1706cc01e022bc728b184a5'
'17e94de33e10a35d9111c49eeaa6b73776e88777f11398c6145b8449e6fdb1a538b0df2eb5abf632a4b46fdf2b3a1bcc6827e0eb8bb2b43bbca9098e1e9a32e1'
'e50cd129c09b497d09ec890ac93e53b90cbc46867c2fab6c3a6efef36b8119494ab004136de1c9b9b49f57451c7d1b79889f91e4b51a7c852bb14d9b0604ac71'
'314bbaa80b29fbcbd724eef1796c6090629297d35966caee32f6bdbfbeeecc53fe15dc4509f96787fe8af264933c29c8bd68afc29c90411d508f6be467ae93a0'
'c5ed332b1b0cfb67e2a07443e6be5ac439d4d34eac1c9064a76267589a99cb21a728ee64ee3e35939b097bb2b5095361841b15f0ab8b5365e8c993a0112a22ed'
'f62da5ccd4e75fae19753b9175a94ef8212735219309fc0a132db9256c5a59238d4522a8c12817ab2d4d886f68caabf63a66a7a8368c7515d8973be4db70776b'
'e76d50997157e8dbc32c7d861e9a30209f9c03e3506562050275550cb16e748093504f8cc812a07f8da47b9b6d8b8328d2a71d66fbca97ada432d645fc2b01e1'
'54dddbcd396aa7404a7ac9fcf90997d96a833cc301744019ba201c55409f351a4b69784dc3cce03a87e62cb2c8690a52536d4dca019bef9a24a902e69988d0be'
'66a1691878667285f388f0728a92e92328c37bdd558d7df78f0ff638a967921185380dd2a307180b5b478830ccfe62094789c8dc0336833abbed3e4a55b539c3'
'cf5cbd9ca03c78601f9b0f59ec75c8edbdea6d44c8b420a9d70900d4467701a6de40c26fb91681129c3ca04e997f118c967916a277075e30b5166b3df95bde1c'
'75be9791ddab68dee817ccf473232c8539256a468ed8b60112866804a9ce28f6df882c9d9f1c9205048a4e37608d10d664f3aecc68086570a0ade129b59b4b9f'
'760173b34b2ba2356267806acd0afb91b9eeebe494219076f28cf6aaf60839e55c31fac13e12c154c20a010f8221a66d713d44ef70cb29b9a76219dec55126dd'
'd27ff3193de2ae5895456d3c72e74d8323a2e5376530f62e45843b767090c0f8301fe430fad99799ecc1690e0b820acabab2a2545f837087933ba40b9db07f2c'
'c8411955f23ddcec630af93973371f5cdf9ddf7ddfa268ba6ec8b159a18346d036e42d365a44157e6b5272ec54712f0a7417bfb8ba90504f091cecef13c542c8'
'e04e386b37cece87c874e6fddb45825fc44c1e334a4799e3bce3e5c0b26d089cbafdd62569a780624dbf5cc9bfa79f30032d4aabc8e4f97eb10b15fb1a893c5a'
'd220237a1430271be4201c33f528b3f9d4c10bf6598b160f007a72ba306e50cd8eb3e1cb4ad82e5a451af0fe9636158512d91296df919ef31664740813c1b1d6'
'cd03f32cb6f9417716acd03fc9024fb1cd82df57edf9cbc357f50d5f4f966813e16c2a5239765751eeed28a2c67cf9014c928aa54a54f33c468f36aab6e865db'
'2c88ffd7bbb7ed51b49dedaf7bba910a68c72acce20add7774de0f58c0e418164d97a3578cfd13c231dafaa79d7bcbcdb2cafc052d63efff376f03081e9b722c'
'7c2745f182205ed84bf3cd79b6b730d7d2f4bd6e9dc0fa9c05f2f3cb2667baf5cbe4f39ada4a22e785dd2a1e5420206d8a5268259b181008ac5e14b4f650f6e0'
'0fd3ca348ac46c30674195c39a15fc66fea5d05f7696596e07d8c143e8e3eb495b3194a74f7bc32ca056d2fc6b0495739be125dd677ac96234658e5bb5db4799'
'44512989d82ae5d9d325bc3e2c3b4a4b576dbcbefbf1aebe532d13fac8522ac3a08fbaaae5b4a66c14b1306718fed3d989edd4ce8b5866f41078c8c78dea1869'
'd6834bc72b618339936c15f7800ac0d4e86b8891041f93572703131cfbfb206536760ac7f180ed74aa2907e7698780c4622c374a2dd0835225a3468c797f543c'
'fd6a368250f4a1a51df0053a3b77e846f4b18665e0ffc076117027065494d2040d63244a89b9b788a171fa4da73ed0fb407c148382317bd8c4a788f20c67d79b'
'1f5a3f82819a545d0db8e5d8529f7ee105d40d21bc0f0ea0aa731793a28e4374cc8bd58c0ed74551e290c3eb679c6dea3aeaf36c2561b486b6e444c3ad53c4b6'
'b56ad357ba8c76df0941f78a137d25f94b1ffdc125d7f261dab4752559bc1fd54356e38494f0c1551e1767742a68d357ea11991916ec226cede0aebd19f6e8f8'
'385fa1061f1b9fbf122cd0ddb1a97336dd9c272e875979f4d8601db8518be1e673e01895c692f93c7e7cee16edd175c45d68097067eab1fb9b7aeb2c7d7886e5'
'8d9b2583a17caa711bfc7a2308c05641a3ee210b95d358f2de3c0ecdf2c7d103d4a1e9b7c09d13143d527d9592f5cc61477d3e95f520b21b0633cc97c2643029'
'5eb7566b8ebd680a028e636ed5851aa74957eb33187e640d7e0da71bc89d4246cf49a510baa12143827e1cfc23f4e7355f6e3351c3cc86e5de3f7982b10bdb43'
'd3115d72df2957a31cba44b570fd7d0700ece87c5add41ae80b1634baa575d8884cf3b6a8ea11b0b062d0d3d4fec6e506a03379733a33916060907fdf8cdd94c'
'9a5b5bcb7242e37154ef6f46141a72133e7159f705e4c2676e627753fb62a32638cb86d3ee5ec361123112707a3904f3695c8894b27ce40652a3c94dc0a0c262'
'9c0b758184dd1c53af798bc0fea55c64a3f030c085ee407afdbbbda9c9f55c0114f1ab9249d35bd8286cccbe458e844c01530313c26c69500cb5aa2615396783'
'4f3b1c107204348209b3bcac63678adca11031ed1dc503023e08578af332f1a6e92e2dab37b90d5e9b04c461a72b059d8d6e05e852aa0b7bb650707c7a8091db'
'6dcb96099fd88bf72ea4f464211e89757b5345b1fe234392287bf8ecd0f95a405f27c8642e0031279771c9dfbdc0f6c20535f49063424eb51b7331e765477eed'
'8f468ae676edbcf4bc90c4ac8f96fa26f9ac5d3d6d5c6466151b4aa0e148f0017685df7ffbe0fc86e40313c3edd196b48b532d773c160c54fc0cd27221d633f9'
'5a5adedd3370287485e38fbef50b2bdd0baecac5f467c540f74337923046b6e46c36090271f9a3c252885e30fc403a88379e3a4a09e526f3a77f1fc53a307290'
'3516f7e4d46d7151cd1f0500eedde9c3e131d3defdfd601f34e012f41e713528446f3af7db4dd2a05eacba015325761a242584c2b65de6185a1f50243e98bd8e'
'bcf90707d5f71689335d4dd29330165dc6f1e7f5e74ca83d22d242568b2b30de013e710f64c434aa80321167dc3067fd468e280d8dfaf947598f8d34647536fb'
'f6662a43dbffda267f470d70e8532ec93cfd8741ec4d20f2ea1449e22925e93d6e6ce209e0db0f89733c1eef60538e866ef48c1c5536d3c5763ea71aa8c612f3'
'd82c4aa7258633b0eedf1a55f0417e88876cbf3c8ad2f6af5ec2f9880196e9685d37c8945a675c00fdb72f3e7b4a9180bffa15efb48b905d22467a4485b116e3'
'07e63b237ed40a75aad8093eff19d1a52a34b8cb1b92cb4e1c874d754842cc9257e2fc4fd199c9097b830b37c3c8c646fd5c56d8ee7c81153fab8d00460755c4'
'ad198963e587b8228549822e7800320dc8d87f6e753424320cb910160d540ebae3aac7b74d14b76ffc976d46aaed9eabaadd0bd05a469ee5475b7e76c822c167'
'5318ad999dec2e219d08f609aef312f2641fbbdf90c9e3d960b6e8adc59380575b2b3a4ade9f67fe130fddaeb807ac862862d0324f8093a5893a07e087882b2d'
'c3b969a1de384b4e35db3bcaca1d9b79e7b6b75c864d44dcb969ac50272364749dccd7adc069138ea46d0a08b41f02832b35b594f169e1da6ced72b5959de95e'
'10284670d5bb2d10661cbabe7b2e05731ca03b19163b6472d4600f979d49b51ffcc6c12a308ec5a9a1f796d7eb9a1fb960d74dcc4d0eb13085c9d81451949b12'
'c63b27b2f67b80fdb6e9b4d928505b1722f26950b5b99bfcd511d6fafae2e6df141d31329b8440193b8d7eb4db182c0c90ab8a2d01dadbbde4194caf4edae71d'
'abb5a67c25146e6b9c65db70dd42eeed909b6008b63fcf02e705beb86d66ba4fc9ee883972cf2aeb6d47526c5e906d2d68be7c868c463dadc0bba84c17e2687b'
'89709ef8815630f9e397d04640d5a84bf0299786fd5af0103d5a08f6c7f3aecd028255d7ed311bdf4ed81d36ee60731336a20aa6fd4fef6e0b6d16ba3308b216'
'6d9025096227897d4812e72a13bf6943ecd0f06680d83064726311603cf29c019855a1745aab2ef66f3f335269f0d2a0e9f46d55ea4a4318bdc8a68268356cec'
'41e8e66c5aa024924fa4639299316947c8b7cf944e8301f26032d5cdcef9d8c0556cd28d6cae75b63647f0643ce8ccd25f13e930f1cf0103732c47691a5a3a54'
'4e35e4c5fa6153a61fba453f956e595a331ba0b0c9afa52f3210bc3c0db404602fc9c89b1ee634b1b2da693ee41156fa9e1e8614c9efa06011d71f1882d77a49'
'b6f9e0a1389a4a027ba28a8704acd145678690e375bbee8b92b62fb9bdd8998c3e02746c49b109345ec527f510ea2574ccaec2f2c786d614520fa249a7c11028'
'4e428ff8b0598ed38d7f26e736db67b30b727fa0b6bc9c35de7d323a22b029af8fa8eafd495922e551883bc06794edf554785c8febc6e090cc5168f1937ee3ea'
'eecf33fb400128a5f949a4a62043ce45f352ace129b2e6cda5361563ab852a986e84335b2ffcd566ed0f1913519e3ed61f0b7c32d481695c83fa32af003d20ad'
'67a0f5f0f57cc7a87764289332090f7ed6b42ba834175cce5402e40f1d963c2166e8fa76ad34dbc943cc450e558d205ca245e12b1fa0b3dc5162d384bb60cef1')
# vim:set sw=2 et: