PKGBUILDs/extra/thunderbird/PKGBUILD
2022-02-10 01:41:01 +00:00

308 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.6.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 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="-j2"
sed -i '/cargo_rustc_flags += -Clto/d' 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=('a11eafe1390141ee3508eea06ba8ab135d0725513977a3b37b3b35f413a1f825dc14fef530b9ac961840804be59291c7f5cba3c93b12726605d4a7255660f749'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'328422adac0cfe6af4ecdcd864004b7ada8f8171aa954fecc23a7e883e90a9bb0848372faa1100440dc754922f965e1e7b98c185aa88df190bff1051d2146c85'
'7e43b1f25827ddae615ad43fc1e11c6ba439d6c2049477dfe60e00188a70c0a76160c59a97cc01d1fd99c476f261c7cecb57628b5be48874be7cf991c22db290'
'52f1ab3d9b0762753f1bfea9b5f307867dad910bf456035aba925b320aec02a41346a5f37d2c89d4d2dedb274b3fb18a2323b68e92e250fbb4e37b0bf9fc2409'
'31e45bc21929d2334431059d8b6f68792bcb4a1bfc8988454ebfcff3df3d4d855ffb54c0907f5e89dd7169a566be72c3acad9ab868668f06fd9b800d1fe2885f'
'878600750c6c0a97a41c7c32c230779238ba06aef71098f17c6b3b218c1c5e23a902c077c25a9c70230d56aeb4febf49c073bd1ff6e7cc134048eae7fd87e37c'
'76f7807075fe2dbfc2bc788667a0d6fc24fbe0e160abf8cad191416a45385c3efce5fabbc4aa8e64514d584b13f7a8c080faa1c7641aedfe033f1223e69aadb6'
'3614f34a2d162eba1ea477c45122659656c4558231d155ccf93d72f3387c9ec167c284172097c77c8710ab9110884b2ec41e3d4ee1a242937d6200d5fe03690d'
'4cde1cfc30f49c369fcef8c2452f16f475e05dfbe5709de3542a1eba27bcae422934a763affc10729cc8059e15e61c067f1a8fa167cfbe00c88bfb42e50ef0b4'
'4c7b6ecffbbdee861a1bd6c942b9db92101f430be9d5a216a64a5c1f69668e5a5c8890bb569f888c909abd7ecea64545a78c6bedf096ece064a2c2c3eef25d95'
'32a24679580fbbad8a4967df7ef57116ff2b46bb6494a668bb94edb60599be0bc30e4781ac1fea888676bf06b5e66cb24802edaf24be056fabace6abc6c4b028'
'2038df1b2842e4852d573230be3f3dd031839267aa527835cc1e311045a3673eb19f392780cf5f3ea6bb1e3895cacabdb2aa5096b6be4ae51d4cc69ddfccfb50'
'c0a1055b76b9492f138248f1807158c20c5ce63257f27dee8e42320f4a4deb2af6fe3a87c0d4e257ed65a56093f783f019daf109b0353042f71899cf21b0eb61'
'f3b2f7760f1fae3472dfda089f4e0dd653c404b90ad09028dcea903619a87e745cc9c087d44fe05a1fea69cc8498cd2f146014a19f1aabb10458014f35784730'
'9609756e7d15f3395ebd4e95c0092764b0e0bf3b3672ce3ac79bfcdf9ecb5712c5899d9b519be67b71ab38e1a4aa188458ae990f7f3cef6bcd735d51ca73086e'
'28e2fb3f46d4a4651a836e839c3e7762439f2ea49c535327133133deb9a8aac63f32d47fa7d2a9487dfe4f2a87555f8be539765b676ec8342ac83ad0792cd113'
'bf7c47db902a449195427efc408e212e41dd4154c277d24510dac251fe942863bc8a8c85e838173d61d108edbf39d5962dadfdd7b513ebd13767249be325fb59'
'b39443a05ece20925483be3ddad4c80caac865695bd344042f8309f9401e3560749f637a8b1298e011b19c029e65db1299694b1b921b43d686dd08dcc660cc0f'
'3e324df2aa4b955ffd24a40b8a4d82cd55ac314dbfcf1b9f7a65c0121f621a40a1438cd9fe979b59d0b51a613f38893f2d0e8727ff30a897b0c5dd70d74c6307'
'216d356d3a6e68baec10135fdace216a88e6903206a6634f8e0d5362c61c995a179fbf5ac34229302338d0571125067a2b1de10003f8098f52b3e7ddf7ebd74d'
'2f6d32f6650cb7f6d37ebc0f6591eb8cf3a6147cad1c945341b7fc098e238c72309f5916ca600e896bb564c8198b37043515ed3daf5418d762cc86838d241138'
'fee5259f0b7e71e102216ad47d59eaf46e6c4ce098f95d445aba9015f10c3af807e22cd2b6c77764c9d7aa00aed47b1044fc55ba9f66bc87dda72a878dea596d'
'161ab1396486238c3e4c78e9848ebe021395e4d82c74723c63909f45ba2cd51748271b3dcbcf447a4eb20bc6a63df0747ba1ffae2da03fe09e9616622a5c409d'
'633dbc9e958d79c0ea1b27e96519e0cdd742e5f6e7506d677210bde4309d8672982aca05138d00e7a48504f87e1c3f65e048d1e644654b18d33816d99bf401db'
'cf776b331612c4d5f1503e95b996ea0143f3c7c85d29a6e7ce265758f2977bd116abb04bd718516ae32a50434a8b5cc61b3f955c74a0629c82f3eccf8edde621'
'0af2fa6eaf896b7d87d666a7c98555cf7096dcb41dc4ce0f3bafdfd0462b0da1803a5c7db4ace9861fb51f207a6e4dec36c71df9f2db590f877d264dadfdebf1'
'54bd2cc8c5d94d0bc1ff217dbd1d2dfab2fec2ccd08b94ac116d6cb30e7fcc84ad987d6d0a62ef4c810f18d0d8f56f4b8cbc2ac4a824346a40552fddde40a340'
'7922fa3636426425ea28c1bf99238c4745809f65622ae2d66266d945da50c519911aca5e53441f3a4a7687c43ae52c279bf554b8d3f6d63f7e0e932142f21a79'
'21c21542af705d030564497b878bb3e35fb84314ec19ba7b755a854c9425d7cfec933cdba16c55e8556af94bf9391edf661536d58149ec94c1a741e518c085db'
'92c8339e964f5263fb6736536c17b5b22f66a35eaf69954ab379b085a2411c73c302a707377b00d685b944d069dda030dfb61330bdef67c712986581a544a748'
'79155bcae49bbacd60c29f47a6b69c44f1b0326b292d0241bc8b82ec4029517241c188813bf7b125289c7eb097791c2bffd66615707bce4dbadd0604dc723590'
'081bec87fdbeab6cabbccb40f9617a81435468ce65998a9e1803e6c916974c0f27a084f501fc585357fb11f8cec6f74350b339308a87440f556e512ef7622f29'
'2f794f1ac14e6869d81f9ef6f2111ae0253c3a0b5868352725eb8945e27456bba64cfa20888a31a9629c28302f90a7c2dde9fbf93213012858ee216e5153b8dd'
'21dd90ca8739c55880915b321bce5ff61bc986c2d1557e49b2ef21086e91819cf55d7090aa2721b19039a58319394ea3d64dbe98850616c9a00aa6586b61c24a'
'2a569e32183d4bbf6a36b5b24e4e35919148303e27b079401341df13befa5539d3e9c50114df434a1182430ba2d982c75a9c8a24d9cacf73f4e5f08daf0043fb'
'13d576b452381ed56099b2a0bd3456ec79afbb5e07c6d3f115d1ba5fa7378ea21b57bd0cd5c82a2ef6a933dfd963226eae5f6d990503cc3739a43f277eb7d8ad'
'edb3dbf45a688d795b8bb0d8440ee3f41fad00b8181d752d47f8a84b9e4e3d1c883d595ad78f53d52898f38d2c6e76b08c047c0bdbf9e8cce2673cb8faa891d6'
'3af8a29dd51e77610af091b980b3ce66a024279109452f3c27c5b1ff136564530276aee40c01c788b0dfb81cc441d7c461959755b177e5dda47a9a5ca2711e8c'
'865281bca85cdf7c750468d7fdf7a0cd20e7f7e01b441e89193a7e96d71a2c86c2e30fedd25c0d3bd6f0cb92e397513b93cf8a8c3138248874186ed618c6ed32'
'dab1302eeb9c21f06d40c735ed0679d45a79d11790bd78714966dbb7b9d22cfe20d34b9ec6bab44b0b5698c4a922394928e9470e39d9f03fa767f37a6609e8ac'
'9c9340c3ec23bb62f9eef6708145d695100b77b3727ecb9af8faca0aaeaa7cef3100302abe4ea1e150a93082ced74be1e9ee4cc4b9aa1d39ade10780bd157f28'
'277eb170fcdb1c88d58601282b6f0f1a18ee6a18b241af5602c49a8c49fb55cc3570538ad030d5c9f4fca421c7d771bec84307484af2346ced1ca045b433d581'
'4518c165cfd4d50c03d6bfc9e21e6c7c623aa268e3c6a87eec9bd9cf6f0068dd405dd0ea43cc7302b03e838b51e35232906aa1c14cc3a2d3ef61cdd290e01036'
'43b0134ab66e6fa78341104eb62a5ca432a3731d9d6ffa0aa12820f4c4d51069be780418256d02bc18f6a7e041d1665ccdd4c76b3e48ae359a6f3a919fc92099'
'096a8c74ef6124ad153619a9a402a61ba9989e5fa78ed0507b864ccab3ced2c497545f1046a4c43999def099a60e9fd2a281e9379f8f17aba8649276aa3a13a2'
'237f35c8f1ca760e5fe9eafcaed25881007fcee1272345d0e119639c4881f5856b4489565de34a6e8126b8c8ff05b5afd3efebe42644e2994edc282b9e7e1b26'
'84ce89a9036910c3410e5ccdf8e2f829faf6790e06f28d2a9683ff3ccd895acad8048a1844ac6a5b9b3f892763cf8c7bfabf91a3283e371238eac41c0cfc0ea5'
'74187b956aaf4d23c1b61e87dadb0341e8bf9339631467d0ab9e9f0c9a406f9cc12744f39fe56f18693f8baa17284d5349b66aa02db9c8f1432a25c388efa1c6'
'f9d8f8630afb5ac63d5336441844e5a9cf93068ca2fa28d6fe95f6af9351079d6cf7cccc969a4a0c0df7300736feb3e4e8b799c62efb003b8f66d859890f48d7'
'a9af78f8dc2b453e477c1d6f4a254bf594c096379f7c64cb7fd05bb07d4efee7d5753351f00bd22525f18a2297254afea7f9bdcaeb2b37d6feb5ed07bfe1f2cf'
'f48c7ee8c67d9bee6b9d7587fe6b405fd3891e0d5b26077d740016f30c78ce26b7ffd4044a3b61fd86c2f5c8c5315085ce0279c4a7ef65acd02bf0535fdf6f8d'
'990a0d2ab175b7b2d63bf2cdc721328f787214c34318da7e7ca97fb73dcf9db7b11bd0341ecf21c1300daf85052267a69f9754c746b24fd0b117dd9aaef7d7db'
'd3976c2f3d3228228d36be553a2b745374b8c07a9fe6c2eee79b5bb3eccacfe05ac5cf2916fdf5f3fb135b350a043a052bb9795c8e3b7a2938a550b4666660f1'
'3a3c31dc4231da6d65328d7bcca96c81a017d5d255acad7bc7a441c58b404b35d76ac7766a1611348e07f932437560286be6cd81e88390c36648f8d0e59d51c1'
'04563fc864a2c8f97971b660bde95918379b4247fa62e82a19fca48dfcc52b864d77681b4468ec73f84c836350343ba4a743215220003d5327fb68f94ff0ea4a'
'0f2f9bb12428f00aea84a45e3e45c56ae322f7fa75dc41068324b81addd8ab74d7678df12e34e680f6fd96b8ee8090f0542f72e6baaa8d7a0e9769eb0cc0f9d7'
'7495dc3f675c6da0ac8fc2ab80923b0711ba5ba6a4c122c860b545cadb2fa571b260c10b6f08f95eb2ae2e2288058dd3d0ccfd824f1420842e3aed26fdcaebad'
'9175f2ae76641492922a7cea9cdf9f93f3ebf5d9cc3cf9d37df4d710ac1a99b1cc88bd181d28b799e3365b01868a2056c174d359e238aa289073f0cf98f0d2c5'
'be6f3d926606145c2d100870f07270abe87497a24a2f523ec608f2ff2634ae065da8c112ee0b12b7d14de40e585d34e322e9cc14eb5f5b8213cec9e1fa756036'
'380954d15f2d2219869e6fb38672bbcb6c68becf9c11063fb7d4af04aaff772140239c9d3ec37910cc98f692230b851e30b972dc5008ab035848a7bcb276ff4a'
'6d2dd5eb3386934493e6b7692ec469ea860a63e9f64729226a5e40261bde0f2843ce2a5250f9b508abeef4af6ba22da2897e6b1a668944984cd8734cd7c26da8'
'515250a6f2f1c7d7aaa445ec3ee1f50971de2903ff2226a8a27ef53172ce8c849715895f55836f87a74bf08cbc97573b1cb566d8fde0e79682add34446ed2ad4'
'07056e5f7ae47b19b7469b2242c8c79c4a53b630e3574f62c9baef16527222e09ffe32296f97745f841e7ce331af90fde2358ab4fa2724a6d7708f2a3dfadcb6'
'66d26bacf3343d08c0f60225961151ee63903d8a8142137fb313b764b0ba1255ad1b3a9dfc84519c8e1e32b99aeedaf822bd2edee9db99b268c04812be67d51f'
'ce147a27f6536c0daf0c7118e321299a3c5afcfc051742996c4e234d0ed37b032ce28b2fe0fb7a34ce51d01a492c6c7ea9be6ef93361984263caa63a36b70733'
'21468bd2023afde037d0624b67b04f0ebf553d6ef4c05d680bd757c6176575b25e8d22fa1de44c4dc62b786f9774a08aef9603f518cd0624a14b636184f09057')
# vim:set sw=2 et: