PKGBUILDs/extra/thunderbird/PKGBUILD
2021-11-15 13:12:21 -05: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
buildarch=12
highmem=1
pkgbase=thunderbird
pkgname=(thunderbird)
pkgver=91.3.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)
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="-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
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=('4938f676ddeeba37da1f2086d76a2ef2c870738169f7e10b35b83e4ed772df634825ee25c28232df1ac1e3a18a9466e97dc7ee318abbf43f1f4ce6479a13975b'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'd6d08cfa221cbc4ab8ad3426eea860348e9fdc5b7545cb220484315a05fe1d475fafe60888b8ba16ca281ce08ac3d39bed85a40b8952a19923c9fc995c9602e8'
'7e43b1f25827ddae615ad43fc1e11c6ba439d6c2049477dfe60e00188a70c0a76160c59a97cc01d1fd99c476f261c7cecb57628b5be48874be7cf991c22db290'
'5a123d817a7ad13597ff586746cb4ddb3ec925d9489cf1b883fc1d24ee40eac965bcf5673e3a395c9e8f726e5a2cad8f83ecb5a0defc8b551070f54a4184d58d'
'168fb07909edf1f6388da073a2d98774be3105c067743666bda131535943d2c9b24fc56f368884e06410f7eb81d9335458737667c1892ba80f367a38fc9dce88'
'f5736c877d353450908de411f09dc7543a9ddc963ec6743352d07bbc7861724b4008a160567735c8a1d99dd3d820a8d8d2c36e3537f746b3fd779c7da04d7933'
'f88010bd6018736ccca7b1a8b4ff72503bce54c8244db4f55ba5fea3348808f2af7a52f5b89586fded985762ce849f530383cf2052e2f0e301cbebf7f24c798b'
'41dc23c3c53c9348afee3f5f6c0f31c103289a733b362d643b07d627270e76f2aafd7b8ba1db2bf0c4b144ae5c44c2631f23d079cc7c3cb37c10d1a3ada452b7'
'dbebfb8366899518971d06dd738a867bbbfc2c5716a0abab393fab89dd6e5f3ecf16b0b7be4c7b29fb6bbf3556f7fb5f4cd023b754c1f3da6fb91acbd83d7247'
'c70e28a5542176d8105ee329feb3af3eca165f4daa5cf0d246c9c1b78c073eb3e43815ae763f7e9dc5e99a62ee626d7c5b3b76156c04bae74ea535f59012b0c3'
'06c82064b2b7d65987569b915fc943226530430b9acd546c075736ee8a648b3dc4144b6c1f76e5d0e4cc727b83f53535b2cf14b404f9e8c4ef4ef3ec87a8f2aa'
'314558a583f8489a6a34c97277f3d55a1a9f421899b78172958498e6ab13b0d8dc346582073a26620cf62cd9e3942460bc894e7ca2873b0558a85719eab80fcf'
'20c3118701bc348b7e92f2e3993008508af15c61269e4ec9de9124d08941df732cf922b7d1b8b5508812a5c6e6681d264d8e23b193eccca6eecea51b6340aea6'
'f418d15bf33fb64bcc89ff4b8b38e7b490429999e8a53c11b4d54edb840dff3d521e351499e49535f2c0dab4750382d1ab47b4fe01e32866442af3427ef71137'
'46422f4441dd0baffcec39ae7f1964dae1674b613316447608e1ae71c1229c2b5cbfdbf4f31c05b6c68a98cd97cbc7335c0e1295cd8de0b1e0428c2aacbdfd67'
'462352e570d81925ea4ddb404b9837f8bf6fd446900b905a87dcd38025095be1a722383856b0a1291ce012c908cba35fb4ba5ea355a2a7d7142c728817876909'
'7cd702d24a068b7de86f788cb0ec77a617555d9a22ab5a99b4c9550de0d5f357af915a7c6a3af5b1260f0c518b3176209b1e18054fa5bea0fc6960bd4d4d7c95'
'4b8f54321a06b02edb53fd83e1cfb5ed83bf5110cf07ed1a05540c1dcfded030f228837c04ba1e402fde2bbb5d63593fa07076b847a87dd48672977615ea4105'
'3154d905fc42752ecd0f3846eb31ddf68cf351e90574346e40f4fd03ae2f30164ca77cd5399500474463c935d133b7d570693d20477c71443ab016f3e3b2bf7a'
'b72ebc12a6e2ecf7c9ec63c6704e56bb47b785c71431b5d67d7f68f592f53b9c52e184c55097f35cec6d3a0a18f5ad99548257712366ffc03296cc340eac8208'
'3b64e93a1835b5a11f5d1978157d1d1089fd4d5b5f52b2059322ab8afa3eb9011723b9a1c4c73818e0b9c0a6a97e8eb5a2a12fe28d552ecc1a9dbfabed5d3fd0'
'c64cf3df9bc80ddb6497dc2fc629816571956731eb5a49742c244bca4bd7ed04e7175091a178c70e04f800f5cb08daf7946f3df57bd3dd2c788e1244e2d123e2'
'c9e748190eb9dd2a3a0b746c9d6f5aa093b03815da8f48c0d6306640ded9d17334d532460f972142505811139e329749184447619f016d841c033d7143b0062d'
'3fdc9b1d2b880722f98d8671e488358e85f9eca9fc589342cb185bea278dd9b8122e8af862c7bf14cd1659ee85b0971921b9d3e6fe29a0e34e79a9cd2acd8b95'
'1205403633b5b4d8ee758656d48e16de1e69a6e0a60754d582f72481983cee9f8dd3bdaa5f0c133336bf796ef925939f97e03331ce317e85724ab808f66681a5'
'88756c2b54bb2246bed6da072fa9dea852379dc588a3879a60403751bd9c3db40603bea3ff232cff64eb846719d40fb00b67e29b656d60802ab84e5cb32dbc8c'
'b109c298926a8c3fb69855a8573e004d5deed48627389c00451007297811ea09b7296b1a698d7c3b756872494a2ac3120ffa0c15563bfda6ed1dc2cab8a87cd2'
'4f1f696ffb139cf6774011f426bb1ffb1a5136065415fdb54dd55e4b7b5278961ea7a1950d8f7c1b207abcf063a30c96c60c3d7f4fcad02d332bc922e34bc385'
'b21e91fee3990af8a05a4e31bd97e691f2994d0c071e35143bb6994713f5059d7b31791b795bc7c0b5037e8745141f88dee5f8474ca66465b3f124b3c3d0eaa7'
'059477eaa6415da2fd8404ef8506bfd2683754a73d64fd458e3358ef9129a4a9539f0899be8c5667ba77476a2029a783d73bdef50653fb39e20d3be80de6d7dd'
'0b2c09eaca6bae8b00d04249071a37fc950869da18137abb2a3234d5490b77837417896741f8b0e873c237d09879110190c1e4f63cb4f83d6295bab06bc890dc'
'00ac03d24fa46dc7566e851ef2160cdd443eb92472523e5c0e3d60f217917059674540a509b49dfb3c3cddc51988e6610db9b103a293b58963c77a93e1a3482d'
'c084303cf61356c671882a76e5e0cb0d898833116e60b2660af3a406bd72da3e9308dc7c77b08bc6bafdaaa55bd3e2563e37176f978ad8e2ad6b4a57baa0964f'
'fcbb30fdfc58eb02e30f69b1002d5e18a635ade4e6fd1b79f9cb284e46a5a0b60a9552eb99e336ff1d88e94ee8c3b1dede8854fd0fbb9ec0f3e263e866e678ac'
'edc8bc5d3126744a1d4a524cd59c327baf9b6c6dca7cf1344f314adcd53d74715bb08b8968ed6ff18e0003ae364aa45671399b3b9d2a28f211a44e814f6590d7'
'dbfac12a7393b536a5d4939f24838674334be073a52ed34902ca19f6d07160e20eae647d75192c493912c98172e7a60ce6e5204a887ebe561b6f8b85cb7dc163'
'735458792f757da0aeb2c88a24ea7567ff4fca457f2811e463f5f5ca9e0b16140994ef9931d862587bdb1722fa7c97fb5935f5b1b5cc4f8139b746ded3109bab'
'18476465f1df86ab6d1995d56bbf9ee542acf975ebe46c59442f3f4765cd61f1ae28ee17fdc9c8f9a61b70c3832eeae9581220948b083fc4a6e91542fdfb8e4e'
'c03612a9a1884bbb9d3c81e65a65334d07d75195a89b7c940ba29fdcef2bc449d6c0bd5d7e7a708b02c67e51d67cbf48f2072b8ec21df0818352776b9689c311'
'28d1d5080f016ac1b1c60b4325bcdc2ba3fc492722a1f1b585b3b80bb19b0ab33dcf0b9c1119f4cf7fa1d3a8fd4523b543b293967af5bb27aa1932d996ed36cd'
'e43929d7fd3fd6e4c7bc04cb9c666638c710e84f2b4768ac3cef485944bf78f55f82c1e6fdfe583f1e1e3cea380b190fe8aef3c0cac2594fbfa366ce2a708aca'
'3c01502de4f1c4941134a8171a6be3a57fd76f9f87abac6068bfc45dd5d0ff86664a147ee4bfee36ab632028b7eeb1e8a440abfa0e9b3b9f167404c46748090b'
'822baedd2457b4a88b3f29a94c7299fce71e2664f28bc5e008dba465613530d7a7832b23b4f428632ec72c09141b9977d46d72bf8ef504c60ebd8c3da58d04d4'
'f160a11e95eeeb8cfd64a769394dee0fb018bb29ebdfb59a7c81fbe983dc879c29e970da21352137854348ca9ff989f2347c2ecb27b09e4d270fa271f3a77721'
'8fec70b79305c3f6993edd0d61b083f291e8d6607baafb7502d45ccecb235513ee1251b30c7b656c61155efa981aacd08a4083f5652ff641c3e76a195c423dff'
'51b4f92f6d1a428b8ce02c6f7b31893359932a52a269ec66e3a8cf8ca04e1bc5d021eaf320f1ef74f107c3918bf087453f626280a96406c2c3eacb1c03277918'
'330d42d6b3f489fcb0ee8ea3e14153effb67fa98f71246ce99c4c3b9bd425ae583325007f83d3e273fc7b1798b9734f42313cbaf3651b6e668ef3433ef887cf6'
'd461c5e4eb87bc6d13bb2bf61062732003e61d98292a7ccbebf54ce9df49ae43455584bedb7ae19b0198096d55396ebe733cb5f8e368618e1ec403bd4028362d'
'fab743e4aca700160331bb2886e4da9c72a6439fa8ca73a12eeb572a2dc12260c79d48e19fb92a5088455a04a741f5bc493ce9bc08f6f0619654a7188cdb470a'
'cef3805b6a28dccc7a211c7bbdfcfe6071ead9a5e16bf5bd88c2d5715ab18ac577cdc0c94bd0d032c3f517967f8943ab5f1b62235b7bdfd3f3945be76a692ace'
'0acfdc983214e5e5e3fd617c8c0dc1ca6e138c85a8d7ac7f45db0336d47e1756bf73d1ef69ea19987633482dcace49ccf16a1ee1afd73bba60fb3786f4bde8bd'
'328759757b1e99be8f03b4d31de01fbfc45009719a2977a1391a298e9b5e5ddd98321f273972c3a372ef07e06f7d1c4ec376e0f4d77a5cfed03f694184ded20f'
'889b038fcab1f5f30efef09d05cf9f81ea6697ccd4ec3b754a20974b3555c53daf82ab13db288612b5f3b8e5a1a0a88a2eec09441d04477b0ca3f7359053f639'
'19b46e08a26b9062b739b064dd267d77b5153d6af3a19ccde2d26b88d635d6c042a5b3527d66dd06a30974d08ffc24b9f2b016f116d90ee71df560af6ecc6691'
'63717f8c65637d3d0844b9d854824fb38c417de697d28349e27cd52f854184a4aa2addbde1a1cccb77810686584c61a4d81c39543e791856a41f8d7cfe9dc0e3'
'2232a13dcdebd60beb07d7aff295f4fc717cb471aa602c345fef528b3b243a901d9ef5987efa5f6ad145f18a82d22d7e5dd6de8d09f5a88810bfff6124d50547'
'd5fb405ce939c906ba24c3e06effb1fb56fd01a3c32333b6a2ef052d220d8e28ca225750d05b7bc1be87ced61037c2e56aee04219d5a44d6a6ef36ae0e8a47d2'
'bf8f1da3d6afcb23882541c0a1a49f638327e6c96f85d03f92ce17964712a0af250bdb0bfa8757ccd2e4ad58f0ee8e2c36d1fac50e145fee32809629fe55ba70'
'ed3a638507b09ec9e02155e7adb221e67d2a47afb20adab86d1390b69dfca43d7688b6ab8d9bbae80765af44337d2cc8e9fd2751f704fae10ec2e260c8dbcbe3'
'574b0752364f2aeac8b300752ce63988c0fc984dc1f5c7e6f115e62342b8a16031d48c9dfc7b93aed2911a8e71cc748ef85a08011e4711fda88c591f52fdff47'
'3997e2b6c898fa88dcea35a6a3e31cb9afb11cf6138ecfcb307fdfb00b1eb818709bb43be9cb16f7f781b52295fe3b19b86025dfcf479442c731982936bb522a'
'cb7fab9e45727cc6d6801df1804bc3bd1313597af4bbeacafa6bb29de804a848635cbc3be783b804d9d8d540ca14e08ebd0793657aa9279d8d4d12a9e1baf05d'
'2096aaf6f277ceb207cbe331f610a59d27a295a7b992bba2348cad5fb9b96e24540fb728cbd51fb79ce980734e14b45c9954a6865d04273ffbadb6ff7394f3e8'
'1babc23023da7a6811dd1b1ad73165e2deadba18070b4c271395652e832486d9555d6b51e549bbcf8cc29b18d7971da6cdd625e971543f3500a558afa1b7aa0e'
'66556244cbf6e700dcbba0b61d0561ed848941e9e929e37e96c47060ce8c98ec3ff064d7e1c95082fa2b6e6e9e29b8f9a93eab7623b4ca62d1b4a84c877585a6'
'87610a5e557a04b3e0bb0fdc1970fa294681d0f7607b46228980be56e7737698e3edad46647c8b7be67d22d7c3033bff5d6d7dab6ae8fea2284ccbb0f5516b93')
# vim:set sw=2 et: