# Maintainer: Levente Polyak # Contributor: Jan Alexander Steffens (heftig) # Contributor: Ionut Biru # Contributor: Alexander Baldeck # Contributor: Dale Blount # Contributor: Anders Bostrom # ALARM: Kevin Mihelich # - mozconfig changes for ARM # - disable rust lto for v7 highmem=1 pkgbase=thunderbird pkgname=(thunderbird) pkgver=115.4.2 pkgrel=1 pkgdesc='Standalone mail and news reader from mozilla.org' url='https://www.thunderbird.net/' 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 botan2 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 freetype2 libfreetype.so fontconfig libfontconfig.so glib2 libglib-2.0.so pixman libpixman-1.so gnupg json-c libcanberra ffmpeg icu libicui18n.so libicuuc.so ) makedepends=( unzip zip diffutils python nasm mesa libpulse libice libsm 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} vendor-prefs.js distribution.ini mozconfig.cfg metainfo.patch) validpgpkeys=( 14F26682D0916CDD81E37B6D61B7B526D98F0353 # Mozilla Software Releases 4360FE2109C49763186F8E21EBE41E90F6F12F6D # Mozilla Software Releases ) # 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 sed -e 's|73114a5c28472e77082ad259113ffafb418ed602c1741f26da3e10278b0bf93e|a88d6cc10ec1322b53a8f4c782b5133135ace0fdfcf03d1624b768788e17be0f|' \ -i third_party/rust/mp4parse/.cargo-checksum.json # Make icon transparent sed -i '/^google-api-key printf "%s" "$_mozilla_api_key" >mozilla-api-key cp ../mozconfig.cfg .mozconfig sed "s|@PWD@|${PWD@Q}|g" -i .mozconfig # .desktop file generated from jinja2 when build flatpak # https://bugs.archlinux.org/task/79590 & https://bugzilla.mozilla.org/show_bug.cgi?id=1852091 sed -i '/StartupNotify=true/a StartupWMClass=thunderbird' comm/taskcluster/docker/tb-flatpak/org.mozilla.Thunderbird.desktop 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" # malloc_usable_size is used in various parts of the codebase CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}" CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}" ./mach configure ./mach build ./mach buildsymbols } package_thunderbird() { optdepends=( 'hunspell-en_us: Spell checking, American English' '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 comm/taskcluster/docker/tb-flatpak/org.mozilla.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/org.mozilla.Thunderbird.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" <=$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=('44cedd5931edbac2ab0babfaf0e71a0262317c01fd7d71e8740bb8f54766c9b49b9e325f1d2796c3a233d4298457d8769b675213a21bef759c46086080bcc8bc' 'SKIP' '6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734' '5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f' 'a34dd97954f415a5ffe956ca1f10718bd164950566ceba328805c2ccbb54ed9081df07f2e063479bf932c4a443bb5b7443cca2f82eea3914465ed6e4863e0c0e' '7e43b1f25827ddae615ad43fc1e11c6ba439d6c2049477dfe60e00188a70c0a76160c59a97cc01d1fd99c476f261c7cecb57628b5be48874be7cf991c22db290' '3e3c24de127165a6340accc631e8d170ef195de350472245dc78727932d4f7c8fb3ffb7402394c84e7c8f1d692e2410a13f2a4b748bd6ad2bbef8dc488051f72' '59d01a057ce05bbf3ac5adb1b269e50da173ad1a6ae63a2433f48f861f979af38d9ef46d045a8216405293fd1eb1c7dff34a258d067d787a61fbeaaf0c23e2ff' '24aa2e9620995d0ad964300c8b9ca73148aa3650aee464fb9af85dcf7baadbdec40abd11c139fe4fde63f1db4304a53af41d793c780732de835ea5d4e870caa1' '9c6bc96315737486abc798d8dc2626125d87202d2ae95aded90ab84e615a0bf5c448a634a62b153fc95d46dfd6db6cc4d82e404e0330f9dd14643b0cd045f193' '53ea89c9bc0be4fe9f2b49fddc3a7b0339a7ca6ea2912c54650fb94f5f4c1dd24c95671f55bda467ae406184216134dabd995c14f472f76d8f42f21a02f31e44' 'e6380076d27a1592f297044566b91793da83a5fde5a8758a7ad542b86553dc25b08dad7a237e16c1817c9bff18109ccd4bba640b9d9670a341aedb12c8348ced' 'c4561ecaa5bb9acc0636a2295fb861157559a06ce0fd700be7e3b22218db4b00f7b90723dd155e8625aa87c98baf513cf7ef814c1e5459dfc4dd873f608e283a' '17237078d8326571c454f552e29513244e178c726a5dd82a7fe822f590e368cb9c17723792cd327719151dfbb8d1b8eabc9d0b6631fe780aa6df2278f972c0c0' '715a04421916ab24a925867f351f5eecaff2f1cc7279906949b51ac31a7dc304b501559c16d0ccd8616f24e0cb63c42fa811f47204bdd5c3f167d9a4bcb31618' '6ea7051ef373e3b094676c594c53ccdb8487cbf37248f53e1d83bc3c4aaf07c3e7eb07fcf39c933873b0175309a9e3eca4ec0018f4fbfe652952848d39240d9f' 'e03ecc780af82192c5bfa41783d540362ed3d8a5975648a19c5c94dde74cdeba1a0c3a6a2ec55cb49589e89ec09edb232ec844c70aec2c579c38d73175403f59' '7b24b827f26d93aa6cb50defe8053bf7c4c74e0d0fdfe08cd92fb055950f06d58f8080634d8714c93177a1415ce45f3435cbf5aa375738c168009602fe7b3fbe' '3d195ef2a009d8e758cc5a1ec86621bb07ec5ceb2ac95c94838bc911104a6277ce427f1e0d18945f0b3d187d5fdcff6c3e77f3267f20cf9c514191ef74f3e77a' '55b35a99d02b7892b036abd027a31c68869b7dcbb9fb368962323f0cb7ffff2d6cdd15f89402efc2cc80204b524131004c35f95502dc049ff792fc48d10d7730' 'd83b84e2045f63a46dd51c04d8189ff6b2ff91175358f520b38aa95f0a0c6fd40a8b02289d4cec50dd092a37a07ac65e36d78b05e1e048d165c3e83d6f0cd267' 'f9815d7d9f7d6326e7a414f84d1599e3005a76bb637597044879e2a5fe00e74592c004de965091ec414d6cd6adfe5738405177c15e22cd67368270a609f059bb' '9be17005fcf290f165767563af302a74efb100cc55e889fcf4bc15bcbd2db25a0e8385b0d36c6b2bc639021d5d526274defbb0611a9b19936f41315e03d10620' '74cdce9ec5f16feb9c32aec3b7ef5939ff6ab00e021df7a140badba220dd46e52d87b78d6d4d10ca1b08c94fd8d860939c9b108802014dfbd0130beac80c1b0e' '0cc0fb069dbffe5c76415ecfa44b356cf2d29512b681b04e865ab7e84f6d3827926c82d5379738aad82fc758c675e009cfe1fd2ede5231f76df759c0f01f3072' '3d5f0f49909674d8edbad47f847f2b5600f3ecfb4dbdc4c325deada4e9b7c0ed14bdcb10d845cec0082c27988ecff496fa0d4f9c32d2c6ba0518b0dc63c75095' 'fae06f4452e93c68fe473b38e93f0820737f6c833698fc7a7f4d58282e229e0a16fbd293b1bf9343da135e81f7c6dd798fc7fec83d141316c400b3ff22e3858e' '34e0fad6f1d9d30cff33f6ad4576d236310168d3552b1e1ecf377a10bbd285f7c4090b76dbfc2cbaaf9073f4ae804746459ec176dc8da7a0589a3b888c4ee739' 'b41221ce42e6735de2c453ad368261228649d615caf122174841ee5393e8a847cf2663a08ac668e669f821412e81cea36d3da30487f50567c4c45769a6c111f2' '7285737078d2f1286a58bf0c11db7b1358ea11ad5a055b6c03119c1c8704162f351223d1964555d3451a94475d797029e92a71904088ca699a7d29456eb4ff34' '505b2b57073b4ca5207cc393f876cfc627f777cf5ae34ebed5dba33e1ed22fe1cbca3146fa5c8ded32d1d2d406e583db4adaaa8f4b2d80c9a39d38d82937a5fe' '2d86b566aa03e255de39f6386eb9bde6634b6d7e7c3825763a9817678a39db278a2d6c0ff9ae228619f3b430c74a6d5cca7c754acab7cf94b0264b7553d5c34e' '1f4af45d0a63bea269aea409e5922dc9b57ea1f73c37ce3b32ee6db699d8cae069743cb124692b878d3e20168bcc7b6eff72902a566e3c702b1a0c00351cc12b' '3d6067821a82c34e705d45d6aa9081779c344d5106963784f85d075b42f81738841d282c224b828bb290aa28507ae8ebbd00c305c30e60e07fd06f7bd0f78ed6' '4a71d08429c37db501a0f0027b149adc10dac2f8e0fd983a0c5ca8e1bbf86b14d55b3988b9030245b0d42821fb822bd492c57be8b4de47a7b76e7eb02c039253' 'e03a0208f8640b0bf5223592491cf42657ed56ad1e011e81c1827c291377862db522eeb20eab894be15045ec45d2769e26f17ed5dc8ff50ce817569989bb20d8' 'b3b8d2aa905ca71f8eccc441583c4ae94be864f2ded7400911d8d6f4e98ac99ce1cc147a7b9f15863f8fe5154dff1cd7eef46895144cd249b11bd85a3b2ba8fd' '821b5a18317bc99047ab7a16be50ceef930bec0442888dc72ffe535873654c675be39e4b3ba27901dfd3163ac473fe2e541051c5b737b8dac6f90d1e442c5f3f' 'fa231f3297af417520570df4aa18248d7aa408f314b6b450eb94b58742b1534ea986954d801d54a9103156c5fb721365ef8ca4913ed236e4d24251ae73f44d12' 'bfcfe83e320290d6dcd1dea2595ddb609db5f3a1bb52ebfe19d1f4bcdc217479d605c0810345abf2f638884b1756dbcb071f4580feb1f9ab5c1c9023d3d008a1' 'e356ff5b6fb6dc0de5e69eb22de04167a7a635bb0fb84c2c77e949508606862a4e2a50307ea4d019defd0d34bf797529abd6f554b234174459e48b3024366894' '42f5157d5d10739986bf662594e344b302ed4bb63a00b503a468520a08e498908d26dd248bce1fdc60dc15f4467f4dce50b22b28684072dbc16384642709118b' 'afc62f464bae9276f0e600a6f58674331f07207f2535590d639e1451d660985f505e96cf44091b36b6df4e52d01f5b94a0a827e4c32f0c95f18187bd1bd619f2' '373884a86ba6c1a44bcb89df2d923f6d2b6088b9204a20fdf332305d6a3c20a892dde6a6bf437a95c235eaabbea039e9446da6237833b39213a427e68027063c' 'e6c0e43a92a3d52c93fa555bc25d2c94b24e9bb4cc8e555d0364e44b3a3361771abd09c3472379550c7e675705ab8d471a160158f72c715c91fb3d0bffbd97e0' 'c835525d2d287c842ccc3b28115e773c8fc5eb9d833a0dcaa89b4d4a3d5678e61b6a1bf00177a19029b5f8a924796035437f8f8451cdfc67f84761577b699ad5' '77b064bec644fddd804e6c152aa04a8f13029d6408d837c1ab2f744339f6aa5f6f563709e1f86f9425b595bd038d483bc59c0b73e511796c1b3a5a096c4a87a1' 'c0780d1f69a0495a37d34d831ac58e887b02eb50e660d5ea939b553d9c547557bafadea8ed49fd475c7ecadda45203a158382b4cbd11b857eea561ac6e2b18e0' '1260cc0fe970eb2f6301837259e144bca8a628c596660aa853164f83ca8997a81c72eccc2d210b4f401157d7c545c0cb34ceaeb96dd3d85dcc764387d5dfafa5' '4beae73a484c69636ffdb58ca7ae3c78f57836d20418cd97311854817c9cf5cae0bba4fd6fdb819594702ab6ae861585be5bfb702cd3c49d60d9b446b2e16bd5' '47560b437742e775f01a8353bef947c791dbec90bbf502c20152d23f8a391441b65f0e62b71d17c17aaf5742949c0b7406f27adb968ab1ef58c7b1f05f4e413c' 'afba3908a63fbfd8169c641dcba66feafa6b92780d4bfaaf0c6fd8543d71950d76f79c454376a7265a74c148fe0782b3d0cd120f7fe83202e7c658d23c0de460' '628f7883bd3411feef7018505ccb23d19bc3565e34f7d97d3969a354432d651af6239d3c7b6f9947d4def2714248db320b8ba10602209dfa0cc01484783b0d97' '508ca9e791ce58647e4aac934c17908f2e086065316e95cf171b10482aaaa7dc7e7bc23c992a28fc5d75de9552c47f94069304f4deb51092eb15b1c23e52a40c' '0270e8a861e093b8655f9e78b865f40edbc8240be31eae1f484aaf178810823ef00d83f7b22b191e4a500df6c7883fc361b6432711dab0d0cd8b8dcc729e10a5' '7fe5642a30a76c9a3f120fe697a31ba456e114f7605a01a8eaba06154e0bb567971c917389c218d914846b9b859eb18206912b6046c80e83f4dc8a37f7204486' '01080b9170d36905fae3301dd6059c92b8f24d3061ea85ff0a6060356289c747190c8985b992c4b15c8c63891069e4316921b130b0edaf3a32f31b6c5bba621e' 'f77f1dd2fa19f10929335acfd03a44d9ec1bc0edd7241413920fca7a88709b273542bffaf6aa1dcaf1aae7625913eca74a4086059945d4d995ed2362573d19f8' 'f5856dd4037c8463cebfd88e3c70a7f02d92e1c183b8cfc9dec95932fa3db0083b9e3476ec27abe238e3d5a156140287ad34f596d2b3357c40b2158608663865' '5446f48d070b578dd5cc56aa918f9b14de4dc295ad157db921a1e58d6a449a12e400333f526a761e293e47db7e0c7d1a2222a40def267f8a4ee115c792fd8cb7' 'f5e1ba1390401ed8e29684bb3906158026d9c4841c781cfafdb84011e0801a266983b888c3d3b65cec93bc8741a5102baeeed4ec6bed73f0e1777f2d67f7f1ab' '9e1e09090ce0a0fa1c99d53dedab0c9a2b4ce48b88e64b512d4d87186a9bbc994df057a736c3991e0cd2afe2a6c5552f2b436252c17166c4c9e05321fcedad31' '3ec14775b81a4fe4543936154a3e3dc529750cc94070facb2d0abf72d7a1b71295d192b20dec3af71c9fdcfd0d9deb5b32bfc4d8f2c76fc2b41e529bee791190' 'fdfda2cd1ef9b7e2c5288cc23704d1e4ef307b28f73eaf50c96f1660b6c81520f83cf52617b86c28b692a0c66ce85b2f395d2a18283cf75bccc377e37ebd0164' '8a0fc31accb99088704328cd073fbb3364d7ea5eee19172b5da8f79b5f5110a0922f62eeecbf03ae115ae31067ff39dd3c58571f55a10f1cc7d8daa02b0f6c61' '9845cbb8e3050da631a20a5c893f809dca0b1c4e3234698f392161f28f37002d8eef4d7d2594a0966823ff63eb1d64aff821a85f53075680dcca01d86d951d32' '8046098e2ad94691029d93d76e2c86365fcc40143fddc8344bc9490479a4d6b15b59d0c71e08f6b01f5432ce6b5893de1007fa5801042e605b94baedb585a0e3' 'cccf099c3ec92b5322623a92775147ad859dd062d0325129dc55fead0613831b63cb0afe3459b8e8a1ba94ff8c1458b9785c0f62630f72a01973bbbb228aa3db' '448a82d71905e3b6253b3a0f34edab994d3115574c3497cfe675286377142991284992f02a4c65d335d4e353954e801bc85293e59383e714da8fa7e7c6181e26') # vim:set sw=2 et: