PKGBUILDs/extra/thunderbird/PKGBUILD
2023-02-08 14:23:59 +00:00

318 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=102.7.2
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 json-c
)
makedepends=(
unzip zip diffutils python nasm mesa libpulse
rust clang llvm cbindgen nodejs lld
gawk perl findutils libotr
)
options=(!emptydirs !makeflags !lto)
source=(https://archive.mozilla.org/pub/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz{,.asc}
thunderbird.desktop
vendor-prefs.js
distribution.ini
mozconfig.cfg
metainfo.patch
rustc_version-0.4.0.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
msg2 "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 LDFLAGS+=" -Wl,--no-keep-memory"
export RUSTFLAGS="-Cdebuginfo=0"
CFLAGS=${CFLAGS/-fstack-clash-protection}
CXXFLAGS=${CXXFLAGS/-fstack-clash-protection}
}
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_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none
export MOZBUILD_STATE_PATH="${srcdir}/mozbuild"
./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://archive.mozilla.org/pub/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=('7371079d59cceb47fdd0e9661f79eae7510ab0f5bf8e80c21952dfb5fed3db72279a4ac9d3a3de3617194fb36a9420ae814a69ee19a93ba242d2aa2b921e3010'
'SKIP'
'a0061fcb2a7f66061e336a8d95948592f56f4752e56467f14ba63846720ebf845cce7511d1a2637e3b80d5a1ffdaa2fb783fa37195103425ef65222d45372012'
'6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734'
'5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f'
'a34dd97954f415a5ffe956ca1f10718bd164950566ceba328805c2ccbb54ed9081df07f2e063479bf932c4a443bb5b7443cca2f82eea3914465ed6e4863e0c0e'
'7e43b1f25827ddae615ad43fc1e11c6ba439d6c2049477dfe60e00188a70c0a76160c59a97cc01d1fd99c476f261c7cecb57628b5be48874be7cf991c22db290'
'36d9662fc94cbf7dcf371adc13a9cda679bc75df961d86de019d3c8ebb0be3062d5ef762d175fab58696db74758100a65de45d7832e0e2bd4e15c901f72d8349'
'f7c55c1a19ab860026cbd0e20e1b6b6d960c66253c2807e89cba005bc347f766503ca731224cdc2ea4c6487deff5962f79e17eeebee8e6898931acf95da8224a'
'4c45b4a75e30402edee0302527dbdffb6c690c2c7427d2d486ddaa73b40ec846c384363ecaabb45abdd2406a399086499d9dba801c6f6a299661d971ed66decf'
'e1c1232435fdd60d4d08c572dcce4ef866ae5d096b01a9a9e1ed92cc87ade5b1f92acd38474a88b5340ec4d182122f23ea188e07331c053fcadbba884b9a7d0c'
'4ee1bdd6150b2ec958e09b10b02dc7bdf283cf5ef7131be9eb81759f6a1d50ccbc3725383f3d0ca992430d78ff0331af94ba408c8a120231c1fb28aa553376e7'
'f51a08012f3154f0c8135b10ca7db03c02f754842a1cec0b898bec76220364377ede6e2147de7ecbfd95e9edb683c345f736b92f8325d8a3255e58c6aeb13b71'
'c73acc8a6bd30140760e09ce188d59c5d8f090e1f0fb90b57ccd130ebe83dd56f989a8634c5e9792f6cb9a5a195352dd0b1cb0bb12e71dbbab86cfbce8cc0410'
'fa872dfcd7f1c7af1926b91e4af94ef29329a49bfac8803de6d2530ce27669b691f80585db22a49115e34049abd77d0d6ae95da4e83609151148c4199f90ed10'
'e8b4cc94678449373f5955ae10d5a01c587e0a83463618ac8d77f3520b69116dd35cba365665a5760f786c8f3ec0cd358b8d36657735c64b32ac541dad4d394b'
'7ec64de1a48da1ad35de0c0febd00a8aa0c1c0952ec2b0e71f18a2ec092162c8a16a6be3c3c9eebda35acd6f305efe9e495d2a516d63722f30ab4c63596ff703'
'200a85ee220a41d2f4752d6ae876afb3258ec629ab93ba380ea5428c24061c8414f4ebcc12265c01df77543da9b8759ced5a6ad28a57d6ae7e37107f825fb3e5'
'ecd3cd3751c1944ae5ab0c25f59a6d5203d5ff5d06627a351896b8428092055482d0c31dcfddc9e21360ccfc0a38f507acbc45fd0a4812ab183f01e90b1e13a6'
'2fa85b8133839a813b93c701badae88b3359738767dcd36e38ddd1c5e9edc845f6a1179519fef5e2c44af96b25a62db33aae98068ee58e8a6efab8a57657dfb3'
'51daee34554e1c01a23d2aaafeba076098919911b219ea59c6dad5225b8efa7db7cea802c81ccb11c8277260f1183327d764a278c69c50a9ede7522d942fbdfb'
'e44961bb43dcb16ba25977e2f90803cc9177cee4bde6fc0096cdbf9945007eed366c9bf45936276476f1a1e50b6da0fbd4f7a7ab500b5791286de453de5f3407'
'34d2d69eb373e750e7ff82a8918a637377b4e6f5775e5aafae94ab988bdcdf89889385d92f59e7fcaccd0a2b885dc8224c0cd6dd6414bf237fba9082ee7d232a'
'daf4a10d3f9f789513570a1a466a0d2a303364040d9a0dfd30553cdc75b6766ea44db09dcea8d2cabd93a610e1f859b496eac6992e3cf611f7d14eb13e9ca8c5'
'f5ccfc87845f18603712c1ce42c8514bdff0f6685986338c016d4343677e4f7c3e306bba8e87b3f6506941d4b1df5f263497b32f78c77834596022e25f06ac07'
'4f645e85ab4f49258be065ac1c23da8836499f6aa58e78c12bedf862323e70a27d1468a6f48fd5ecf314228fa257afb7a9608de334baf045f7af1bc6be067b33'
'bfae7729ae5923a775a7e515a7feefc8648976d0086e949c54e21318879d935b6033d3d59f42ada1d7bbb415026f0ad6f9686f2b1972faff0483ef7a6137ec9d'
'9de7f486e5b9ff1f20a01b7a1bde9ed414403c01d830f242880212efe913880ad9db3896c327242a7a06727daf7fa6eda3ba97cf3de71e4e0975cf64cd046899'
'd36cf818791b1f761ebc8ae8ce6068ff5b193542820e2b731d33126d8667ed3dafc6b74428e7b155c500803e44f9d480251f1af453eda5d13e441b67c0efe3b1'
'b49d18346ee3f55fb818b454820e58aaeb185bcea154c49669e5972d1cb2fcdd41b45e00d35fdd6ecf498f6887aa9fb5107f2682fa9d4d2ead9334fa7f672557'
'5d5d061651d8c2ecd5624efede88c40710dd032a4639ccead952fd36600a4410d794a975976deaf2b5081471343a8b8ef3c21e22de62299ae18d93c651338f09'
'a3f8830bfaed05a78eef904948d331db08bd3b537da9604c5ce19dfd1548419d18b0b06863f31fff6f27883bd0c0f6c9c66aedea002b5fcce55aa40ed31d41d8'
'5afcf1b35410f811990d7292c2f8379fe376173d039937e72ea5f4242dde876345f754cb521e76c865b7037d01891872128019eacfcecf0451cb2aef071ed738'
'7b9529e8e638347650782a9de972be1550523641b933b60abe682eac8f1544547154275b17b418eae4c0e67f2ae76e970184cc2953bc6ef5b491ee5cad4481f3'
'eb6f8a20956608832f9718b65c21205ba9a58e65787f1cce30ad01d97f49ae52593cb3e787ec9fa655a90610b2ac27c9c00f18a889ef86f9f16c23cd9889959e'
'f9cab68d32710aae83fce0466ef67455027aef7ea73584b925a511e711dbc8ffd646eb6bd870c1f32acbc9508614a6de2a31ee9b8729c3376058c7cce5d57ca9'
'7d03b7e1bd8053ba6b40765bfe42ed6d5266bc184d7a9ab6da8d7d89f4f85f460ae12f2a55274465d0f5d72044762e2e78840a1ea3710812900c4d3ef58e1686'
'343c215a7b1c44f250662f599eb66ed706045eece1bfb1a1546afe5b3cb39ceaad270e68958ca67a197303d0e2a4efc454c8c8aac6005a57ca13f91ae739701a'
'9cc501eae761a6ff66eac49bb5e5580d17d4550cf69790939ec2eb254cb681fd52e61c250fcdd1a535097511b64d7bee47868a75d7b241513e4aadf0879a9306'
'be14b1550e51d3aa9a3d70f0ca0e2c391a8d0b67cfeb65f3d8c7a05c4f4198614d8f05ef0a1a731c29337509c98f4e6475beaf491f5f8df91a707148889f7657'
'4578cde31e726caecc1c006163b4f1d32e7e1d94179bb3f31da31e523709e24e82cfcdbd1103137e7a3545a08f0c7b86efdbea2492521da671debb20aaee6146'
'8a2e825e6949971d85384dcb422a4db3baddf49f99838ef8cb1e524a42b4a371713ec19aed7aec2d11f9e58066c2d4106855ecbf00caca0ca7ed2d63a828041d'
'fc32282b1f7b416d0c88dac7b7daf2527b43ec9f75ebe14baa65be90a21f28a4b55255266ea88f686b63a161560e103e7cd6687f332756b9d98a0de1afcb32af'
'45899d758314d0f95599211fe1b28df3f5a53b341837e51831835fcb3fbe549231bd492265f80170412125bf73788496d00954a23cdecd1546bc201bb4eb2a73'
'3af21136783c6e9605521769f02daf77823f07d885cf85c27c41e823fe0cf806f8809b642c6f3b507c170d874fa2bbb7ce4187e2b51fd2c58c29aa54f943dd70'
'cb17482879371befe3367d951652c20edbe3f2dc7b4dc89c3f0bf84a160e1aaf663c08447e2776da983d0ca9419aeae0e5466bb03e5a1e7f94f268074f9878ca'
'6a9fee3fb399406234899f2192c0a7207ff5b9a7c08d00513505a4ca7b50b317f422e7f1b82110f4f0c776f037a7fd899434bb3a0e67dd88b7f8ce06a2705df0'
'448419d6b35833c9c2e1a6b6da5a820fb3deee7677e1ba45ebe3444af7a1d4d0598c2649c22e23cfa0f07189ac96f607aa1de5138163c7413fa2bf0b262cfc9e'
'b9015db7f19c8286273267e5b6c77aeac4b1b7a495386a5e10a0c4f56a39546c052bf6d750c0156e1fad11d6f1ff3b0141c38b7e561e6745a3801adba7f7af32'
'cb1627bd19746d2786e78ebb7621b9b8e2842e52ee724f52e4780919bf39deb0b013bb9478c5230ab5724cda25a0a4d14dacb0d0bd4aa563ed62727c359c13ec'
'2a0731dba3c3003a51b9e360b60744bf07a66276071163e8597019e129bfff6a80f8a02eda0a9c75ed62c16fbf1a95998cb358909229a887450f65d791b7d1e8'
'7d797b93d57c4bcb64ef8642832277e96993b593b75e9c6cfd82c7e23291d16a90ce029f3db78d7db4959a41ab9294a3b55d0099b6aa678ea1dcceb67ad2baeb'
'7987e96c448f410ab5678f48e3f236ff141215a08cebd3a30e3d511a538d4c38eabdcc58c7fcf605e4165087f1c706fa28c416ce96785f84195fa81c7144c314'
'438f90fbc5ea5aa551b61a5c31504ab8555d9970978cc8f0228fd457fe7693735eedb2a0904f4964d9f4872ee14c54669b3459abf819a64b13a062feca7cba9b'
'c36b0eb921febae096b4e3607d2cedb4888cafcd9a3706f582df7dcaa2db09aa01f60d94e4899955b1fccdc49b22655fcc0535f9f7850ffcac8fa3f455d4f27a'
'79fa092ae81133ab6e5c8974c1750b7dc7995b7803b9916134a0ca5d7373fc2130247faae4686db38fd208856b0b60a89645ccfb8b59ec6e6dc9adda35094581'
'06aeea693c1d979c8ba47daf52ac842844f6b557091d106286b1dd424e786fa922e183df2dfe468715d9e76843bff076760d3e585c69787630a9f6ea53c0d359'
'dcc38fe7f2221018c5163990fe22b4654dc50fa13dcde6a2ffc5ec5f13fe7c1c9d4f316062c4c0c0b21e1563417c539d06d6cf92ec80ed24ff40e0b90f6f1687'
'bbc51348b233e8f972b9e3800f9b95223139715e92cd3dda303b994bd2816eee262bf02e5a7ceae7496f38abde0e873dde5d15f031dde20e6492f0e70c6b3248'
'7e2e66ebdd7de24561ee1c11a29ce042fa68b09ff156b7475684d2225f5fd04e9a1f0c75735114c01b0ea18cb6708ebf00bcb7ebd7431cee42c21e9b10f38d61'
'd71f6b7e9e1eb1858722c432da3d426c67f4fb4114dac84e58a403cbfc8385e72c1941cfe5a7b3c57fa05ad87c580b15bce2f716f02e274fbb7153a0a901fe04'
'aafaebbf5a61c67e5104af56b27fd49a8ab0636cb5796b9f6a87a3e73f6f69d9a2bdd44f50ad5ec71ae7c1663704c54480d6bc7a8bc8ef11b4b98b4b51a4bf3e'
'4f3bc22beb3061257b83b68dbe1eaaee0f6cd4a4bce9309dabe3b6ea5b287cacedb44f08f659900a8a9e0c32c70a8f176a8694961b1a8061f517f48a6da7318d'
'5269b7f41372bfccb1df5b3fe0a85fbbe3b391b8394bcde798c58d2d1fcd5f669b1695cc0b65978640dcfda42742af65b7ad7a0cc699cca5fb2e1ddd79aa2af7'
'c23467c2b291f936f7ba506e5be7642d6cf7188443f523171a46cf9e1c33670b56fd0c32dd6cc138927d95be0dc5ad9d390c7c21ca85b44110b27c167abe5073'
'b4dc17c1fa694cb341c4f7b159135c355447a5f54eebf589293f83e67b105b050a032740d500db990dd98877a404d765432828d356039159bc5f70bbd3591989'
'174a7830cd8b6236ea00729726fd538cdc42b49ebe5e8303bf727016fc718b1d4b9c08628b21eeaa4ed2277815a9901c53e39e41da3dd5f38116610a53a320af'
'130a7ef00efa0f96bccd6169efb4ee1a92a5c94de5b55529888cbbdaf2f214816302f0f2c49ce596fd1af40074beff10818099de6babba271e81cd6a5385315e'
'60cd1886e2ae11fb673bff31fa1cc128b4c298a7a97c2487eb7268a4830f8c1c34d07b03924aea85ae756a280f55d096c018ead2e055703ce0cac5e88e20133f'
'673ac712704d21934f41a91012e55b1d226aee704d967b59c4ed22519c2631e27331678c8bd3142beef76b22b9214c59a324f41db4a7c210eb1cbf39c104de2c'
'c305bffed35f65c8f0926d8c8673024ad379d91c12e21846a240be5486b8e67bad63e2ccfc5919d1913d57e7e828de44ef2c4bd05b14f5f6c177790827e7b02f')
# vim:set sw=2 et: