PKGBUILDs/extra/thunderbird/PKGBUILD
2022-05-21 13:22:01 +00:00

312 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.9.1
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)
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=('997751056ad44367a128aef13ddd55f80798f262644253f814e6e607b3bfc3e33070ed072fa7062586378234cabc7ad106efa26befc3ecb843c5dd02c1498f0f'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'328422adac0cfe6af4ecdcd864004b7ada8f8171aa954fecc23a7e883e90a9bb0848372faa1100440dc754922f965e1e7b98c185aa88df190bff1051d2146c85'
'7e43b1f25827ddae615ad43fc1e11c6ba439d6c2049477dfe60e00188a70c0a76160c59a97cc01d1fd99c476f261c7cecb57628b5be48874be7cf991c22db290'
'385d5fdd3cdd86b5ece192d912d662e0f0e4e7b9a90e623841f6dfc80c0f361f7e9256894150ce571db387e76f5e4661c1ac14bdac287c8856fba45c131f7f30'
'7b9a8eb206062ec4393a72d8b3f5e0f36791f69a13ff0fab42ff190b4b2fda52d9f106fe23a3e40cee0c4f0796e5d3546bf8b6306316371998f57ec8c28644cb'
'9565939eba6df79c91f01d6c1f2243c9c5e8a70653eb035050e037d8e2eae79ab92a1dc272cab2d76f4617366c616b5f58b4e7a16ff3918cdb5ba7783f75a025'
'71163e8bfc9666a517c18e92cb18d232e4aa3f6a09669081b74cdb8fec9302749f26fd18f554f079fbcdc4426268a502bdcd3f5051955dec95edcf913d48671c'
'c2405e0405bc6209063f9bf079dce4b3a322968eed0e9ef5d476ed3b498bc933e96d35d307bea5aa8ed6733c946798abcaf278f5bb1fa0df968adc0b32467b84'
'1f668bf485cd342aa5b339211458e15d620c360e06efd088c74b3a3d26f21d9ec3af7bfefdddccae2f076d55788a6f0262c64eeec050ca293c4cee7ae0bfe593'
'fd795bf9697a2f002f6b5c4d86bc4c5cb066d316abed4b2bca30592e9b811dbdb39b94ef15d7f8a64df957398618abce675039a3603ef283c2dc2504c4b6f651'
'aa19c3b22989cc6e82979d99c2a447915fcb0e6a99fc3613232988aa3b1c41109a3daafb4b5fc92c1cd9428b444ea50bdf982960d799bffcb61575820a2b80d3'
'75dd853af0c8d8fd79fd668b17b6ee217a4577d62297002c251ff109fa6e548026971fe1ef0ad8288c357b7f5a4a3c56b758b8330aea8520b6f10e171096dacd'
'31ad1017dfbb6eef93a32230b668d9af36224a4582a88ea228398b4e355f04187dc330fe8f4477a5cdf29a0e8816a7c36cf2d83b45b87bb6c0416b6b02dcfe65'
'27da057c3321f520dde1bad74250892f6fddbf1759eef8366b24fac69bd8c9adc4ec93fb9ae68e95e77f3fb7f3bd9a1c5f93d4c5a886878639443486f6a63603'
'be2298bbe647ef2f62df3a1536f100188b42791debbf41e7e9b5dc852550e999fa2b03fae1a5c0ec2093d1aa91775f0fa993e3cff055fff2c83873100f8dd0ab'
'9acdf60b776758744991d7041fcfc6ba8472779135938b87959413dabcb652d8bfa25c990d729dc86f1bdba7d63d97440a468ed7d623512077acc6a5c766437e'
'b7772f786376988e434c0c3066804889618ac5f74ab06fe24bae7b0fa754910650d27ebe188d9201838e6ab1378b378b67559fb456dbabdd138040112eb357da'
'b1c5aa23ebdf2e0ec0d2c8be7bac9887099ae0a40694f295edc0581aa932903113f0ca21c6417738339556650ba506c83fca7a04e025f4856743af6fa3be22c5'
'7ab87df8b0eda3de20ded7365e2f098f0ab0b38993791e73b0128ac0afbcb1b578770cadfa66b53083da4491c58f1a88457f0b67b4a133c94cc6be75264c62ab'
'b24726a669ad477561a13cf395bb465967949aafadb109dfa35f67dc4cea28b5d59c8786f80b141310b58821dd35a58d6bf4cc796200f53d654ecd437a04f2fc'
'8513e63b9e0b94072330a85406fb98a339339b14415be2c16f1ad03fd8066d8a63b9725bd4487f6b82821f81c539b1bcb3b1c8e737b7921070d37f1423a65998'
'a15037f342aa0778b4e57b194eecb70c660b81293eb773ffddc4b21177f255c585e9d9c21605f7535e9dd89340a85e9f7754bb518c80364046f0e3f64dcc786b'
'3c61329a917f19d9939bb6020864b6fa457b45c95268b350ac39880295d01d034b7f196bc1628dc216a94d7f333035039315b0fcecab0a801b4c26fbc29ab6b2'
'98e396ea2b3cb59eb937d4c60b01a91fec6c4909f79fa7daaa44dc335e81b976dc935e278de6171ac696b4724fe5abb641c8369b0ff9084a470ab40f63d129b0'
'7bdb65bab847e02ae18ea922af2495ee61a4da4e1e57da8595ce230edb6315a84ceb1c322ff1027c11062bcaf4535d7cb150cffe47397eb1025a67d5b25d456a'
'c76eff115b1cfc49ec41562e9e55909f68e8af06896e9923280be54bf8edab5d724785acf919e3b2485755a2ee1b3ae3a1cefeb698f879779da9abf357b49021'
'17cb8a170b47dde90aebf6ff8c20035ef3bffa55a4df753967fb502976e657ac76b66a7ba62dbc33c90941edfe93914fffee15c7483bfb59ab7d092d85b85af0'
'9ea0aa90c5665a5cd04f84df2ea807c920edce845ed9d95ff1807abf0611a0e7996ea5d5a64bafed692d2dc5afe5a3800c33c2bd61ee48a1dba7c36ba79f807f'
'db35938996f5e6237de1225c36a3ef9fba539157caab84dedd0549606bcd57bfcf5365a05306d1882631b27681ee2e3050af6ca149934759a9ab359c17507e55'
'e1370e1033648a19152d77881e62fbbc9544665069729257df0ad393bab9db4365063b15f424372b6b3ea4b235276b94c52c309d43500345f6e667349d51ebc8'
'2b4fc0dad676165a64e641f4ed5f381363559ca878d265ea3c490c35a493b659ce0e8b4ece983262264721830561acb7b5322e313cdbda625182e7f5fabf6788'
'3ddf1ef864415fb60550b7f86cee89d52f8f6e825b38a8d7a83b5803dbda572f885b26f7f153328c7140e4f5d93f7373a4c69797c1430ab466aafc1997cfcb0f'
'd4660cfc2994c35c37e98d5cab8e48ea5504dbc89786abc1d854b33ce24cc89c5f3b3833cb1562ea184d5b49ba71c618418487d752c2e91e7159b36d6c91a5fc'
'22bb89d2db903f7f0a022f1ee68f6c22f44203ad9c74117cfef7c92c2311d446ad71281e79e0308cfee702ecf960103bf9c69cceacfddc714856621ac3568e9b'
'80ecf20682a1cc04f3f288a9a1afd834fd542e592ec6558ba0c28b39e15c7b59b1e462d485f48b03e850ccba84151a6afecc87bce35ea3958e663956ef94c1ff'
'f5f675f914e3ba43a112412e3842de9874e3cd88975768ea1b20559f4f2729281d27286b91a6690c5d2c61e2bb04b721ec5970b597313c6f3e6d9ff98221c783'
'a63b3825150e98f2e82b521f7a21f5ea8d47a5a9a85af9ffb712c2e6dac5da343f57644253bedf20d7a09452725d68ba61bff7423b7a3adffebde22a4d5aecf2'
'15f06c7088e84bb2c770ddf4335efabc6c2e76990bf3b326778d110a9e9d83450acd4514f762724ec5d1f0e2345263c7b2bee536e0f88e38d905377f4101f55d'
'59d4accc8815d4817cb782174506f542a19ba80631cad3f3f638c2d87449ddcbeda9a2ec83b2df895d2b26495e708250b7e4d4b514326f614d65adbe2b69e9f1'
'342b5d39c5ea517b4eb97b5fbf84f2454e9d098ff75c368ae051b7902b6421b74b07715c2a807534efbfb2da7268cb74631aafe7be3d41bf09a11276c7824b03'
'77c97845d2d1d41fb5b58fe875eabf48c7946003408a9d67d4b85424fda9c3337e9d26facc785fd88916b2fc03a51a3447412273d47ac9b271af66a9934fe68a'
'8cc73fc0d8da4cd8b896786dafb467fdd30d291cd1553d1557b5a809df077945137df83e7bfd93ba7f5be6cf2ec7f17fc06eae6a207aa4fba6f16066973df23b'
'9296cbbe8e73c3c88acb7b02f076e7dd2733eaf47a2485601278251cf11a625a38e347f72a4e4c2ab11d8ea97fb5efa8523cd2d90a6cfe9bbe344611dfcc9acd'
'406322e6b6237a82887976247e3b4d24438b63effb7130dc2cad38435b49117082b2cd0ed70ced012826a97a81b3d4ace7a2b14907d442cb1ae71b5f71a37d6d'
'72d22e6b761c049c7430b6dc2f069bcb7b3f29a7b7bcf4199bcce1555922de6434ab09e5af679d85d83746f074b5e33f746013957e8bd2fa467e7cb0fe76687e'
'bc6845ca9012aefdc07b305306576cf136801e51518d4f8b1283469c9f11cfa855dd50fdbf527725eb9fb030aeda157336406c6847dac23b50bbb0d4d57e6bc7'
'c9f40334bf1b222d3e4c8c4e48a6e5ea70e1fcf111df1724d63b11761d5570212b2ca66a670275e48feaa472eaeafb00ecae07752e0e1731ded2f6c7911323be'
'65f3c15d07a6e6bdfa8bf335d965dc530916447e2f90f64244e6d0f8960533c951d5cb2009a9f325b4a8cc44aafb10dafb0bd1309a771198e6c3b6db3dadf7b7'
'9cf348d63b7098472bc8e577c9aad903e89341dd3827d8a82fd56fe4afdfe91eded4a147fe28c3b5cc2b9685db42f76fbcfe7a86deec7ab0fd638362747b08e7'
'fde6f143ea678fee61413c6c93e1e3902675ff1ab2352b0006ee4b251a152b06efc4e1e55b99dbeea61b5073f14ca37dbddb156f7c3d30e9a431cd2ad4b6f779'
'12e23beb7b43410cb2869efb14cd7d9fa4fc2e3c4560f51a26b14e694af21198c168e17ffce17b0d2ff68b0fe8cc83ad5057db30cbd312c6f240ddac779a2cea'
'e300eb471a72fd3a0482b71f8590b77fb8a07727788a3924cc9a8be76aae44d3acdc35bef7d0a50303c5fde7c8c0586d3d2b08e1bc624afec01cd502f3b07be5'
'535bc341179a2f18c1b646b426a2dde88a102a79fe8587c7ab7464d881f91c382e3bbf01046a48b1dd4f40772c4e305de43ce7e545bd64b16abd80c788b78643'
'8ffd9ba79d42de23c7110f3bc21d89111d34be945431cf780fedb09b58d6160cf3f3e6ce06a73628048b8852e594fdf5a7c64008d83aab36dcedf3317de035d4'
'84bd3b264395b1116edf9ddbbd5d76632ae8351dd5826b84632cd65e5350813a3e56cef41ff818729d6a19ad0883b57b03f9adaa81376d6055f1d76d705fa6fe'
'05043cdb08f166fc63f689e934c77636bc8d434a5ec73620efb0a4bc660b2fa440a42291572d59aa9dc508e2217e5108f755261591e7f7657fdbae598d8238bd'
'77a04271a25e0369c28f6f02572c048d18046f6e82da715c98416b2b1c4f80830bbb610b59133bcc6612081fc156034b05e6b6800b81e3ec526844b20a87e9f1'
'2ca0721d1e07f5fc760df49fd85179fe78ecbcf70e050fc275cdb6b294cc1fc65b05eff1602ad1dc72d39e138e1e7f0e84bcbe94ed8d9996614463f0bb6c2d85'
'a968fc6c2906ba3d78b6c0d991bc057d1f317de4fe93e5f6195769c3f4d918828a0d1caa848cc42743475489fd325c98d42e587ef13dddf5b2820ef009be8065'
'bea02a251dc77b7768fc543af1b0991f80b9a4b70bb682ce0383e2648c35afc2e1ef575d679f01997deca4213ac0e3fdbcec4e3b18bf40098a2e9745f9fc2c48'
'8020a0f816545730a3ddc462efd64152fa911c0f88d778bb45a7b96d7514e62193875512323acf31db97abdccbe5165ff1d6b12e63172ef9286b31c557ba79fa'
'00377f433cb9ae5a0d715ba2e3bcff8316107e05695013fd9939f92c210d49fdfde489f7641ddac8d351996961dbf1798eef7d7fee9b5c041cf3c1ac8a293048'
'0bfaba54cb6a1605046ccfaa08e0899a75ef2ac36ca28af6ac2de198722faadaf60cfa38585a2464f8efbb8ff02a1ff37f64d398cfcd9db85092e6832a7b78c7'
'f135a19434b91ed6fa244dc475d55589c7de578470a492737caf189efd653b40316dfd1aca77d94c9086363ff2624ae9d34cb87f346bd86c63aa6be8865a5547'
'64d5693bd3e16aa75b8ddf3ae6ab7a0467f49ab956c3e94e14a049f7bfaa250faeda0d141019a177605159aa24ecfa959ee2d37335cd4e32c098801db7cc6255'
'5cdc661cf55268f77e462df6dd0465de87753e078ee67d8afbe8ed1ffffeb18aff3aa225fa8a053acba6957fc4f54eaf4f350ad008c5e2094d413391a223e675')
# vim:set sw=2 et: