# 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.5.0 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=('3ada7ad6aeca07edd732e0beaaf765f2da8282e4d3bed967d68f42f4d612842f0e470bd43c24de0e92829eb137c1031999f50456165de0b7735502a83deb42e5' 'SKIP' '6918c0de63deeddc6f53b9ba331390556c12e0d649cf54587dfaabb98b32d6a597b63cf02809c7c58b15501720455a724d527375a8fb9d757ccca57460320734' '5cd3ac4c94ef6dcce72fba02bc18b771a2f67906ff795e0e3d71ce7db6d8a41165bd5443908470915bdbdb98dddd9cf3f837c4ba3a36413f55ec570e6efdbb9f' 'a34dd97954f415a5ffe956ca1f10718bd164950566ceba328805c2ccbb54ed9081df07f2e063479bf932c4a443bb5b7443cca2f82eea3914465ed6e4863e0c0e' '7e43b1f25827ddae615ad43fc1e11c6ba439d6c2049477dfe60e00188a70c0a76160c59a97cc01d1fd99c476f261c7cecb57628b5be48874be7cf991c22db290' '4f04fd6ef1f320197355516e64cca301027508cfbb65eed1aa69ac88af58a73248666dd33bce77c49b3a52ffbc87020111c6aaadd979615a6270e7f93bbe1596' 'b4476c79dd61794ea1befcf28e0336e8c8e5e5b51d1888811b26614ca008dd02e9c50edeb3429a24bf91ed3278ecef0a98df4f6d539cc6af07739595364c30b4' '610d73e049c5ca1080c21f9f945075d8f2dab71eb6c690c32d9ff54a5682ef201284d247378e6ba8a69cedecd00186250f9d11baee1809a4611549439d698d08' '421b51a2aa2aa853730327b29b3b9c5f37e741905d818df772a23379f66301e7d00e47a899fcae90b2a07ae4c70a990eef86e94ed0841d92f341836ed0f7042d' 'ad8206d6d732294eea68126e85e85e0ffe0cc4faecd0579c0361a4a3e35442d7321a2db9ed89668a6c53a8705e2204b0c24c9c5fb3a924c8ea06eff7ba0f1eed' 'bbd52e2ba9fa1dd67c3866fb62f04d7ed5bb0ecc2a79ef8e325b821182d0c7b3319d75866289b1cc972f1c52497db66494acf4c23bb5193cdb411422c0533711' '1f6c2ac77d152707ab407367201e0c089cd79156eec8a4ceef04c0e4d706366f24d45e877479cc77874d9dbeb993e27cede2728d4526e34eb27fdd850773493b' '17b5272160a1868fee0471daaf8fed963163a8c23c189f62aee99b6ec57cf1923016eb5bca9e665d9838394c5642fb4b2402f496d1b3b80cfd479010d9985711' '9965bbb27666fd2694f62bd61e0204a369c9a652cf64e42e7d1a89b60d2d1b0bc180b77aa2d6c40f987f7c7ff182a7d892937b94cc42ce116f176b865cba5b38' 'db4f3096fecdbbe0d9b4ac01449957a21475572af1911838ab8507a62cd78526ba09f913dcfae6b67c493c90eb5bccffbf3c7fc6c4a7b5364c53b58ce4a58fb1' '2df0099e1a6e13bc02737d989a8c12d27161a58abd3d5fd6687e82a8b96bc6e806932458d25fd8d97d142f3873ca5b6b3b8819c1a82ee1dd927ba663fe0e3611' '36848ec2570c4d876c8cd162f286d8230d8053270c4be12e2d633ac0c9c9da0bd65e7cf9becc10cf9eec8e3ea442b6452014803e3807d35bf9d390641bc1562d' 'faf636fee84f2f8f8446d1001664cc3c5e3d352751b7bd754a3054a8cb6583c64d2cdde68689053b95ebd9deaee330abc7155c1f85cc199b6c9db08baed3fcc5' '97e3cefa1a219a3bbd1f051f3d25436b128ebe8cbad7fb83fe0e53bbaa89a7066d65e4c844ae754c769bc549e649aeabbe13e7470592a9d8d73306e2fb967956' '05e860adcf0bf888bdf9a8ba12b393cb45c4119b17a146e802d03ed6818dc072ad5d7627acce7f706a06a6f6dba02785032336fc1f4a216363bba6e13ef17f66' '5f27ec2096efa6ef8b2c8fa219a553440547347c9ee61959653dec1e80f6d257ef006a1f1b2b84d9e355d94829454c8deeb662bb389852f5e83d96e4149564b5' '37e357da5e22175d71bea49cb5edf59ab433374ffeef7ec0130d43eece7c9b691ee7d4e5fe58986475d0f6c2616b90854cb1cdfa373ccb79edccfd77dfb2fb43' '25b10f3fd951428e1af309fb7bc30ea701757eab74a3f32efff427ceb013a1dcf341848d186d52f70c0e28112e8caf7cba3cfc524d82f7cc26ffe6fa5c57de2b' '39fb9c4894f83cd2e1f0037d42b472a5b2551d84efa1e32da9ce0351347e735cd08123900c8f03bef13c2e910f116c345a0543bc9ac952d5513a186f6bb66f9b' '688f17e4141959c08e66e4f8e99cba3e4e854c5ff7b7bed5a74865d295c15ce327c4960ee084817f3c2b356834d52801694d13cc09cb5e2dc672773f9c4989fb' 'f2eb78c4837052f9ab97f4d3bf5e96cf07762df6af5c3ad55f9a6caf13c116400b854daea228ae2fbf4247412546ff57e2935d3c6faf37d4bd5c494db6ed6461' '72666bead45aaf028faca55c18d85444c080445eacdf9fc638c00c1e16264866e8f6fd7214286aca4deaa24802f03d376ed399fc5add7796e65da22acefcdbbc' '57f816d1ac91643690082dea3a973842e05278247d3723cbecb3640b5ad1910d53b0c403c39b74dca0e4a12e5fdf46133775231f92eb7eb94ea075d5e59278a8' 'ffa71a1028fc174279a23431cc53203b78f8c5e3c9875f857b0230cb4af7755113fd3e8e9b085af7c230ddb29d3dd2b3cbc8b45a6cc386140498284be6d645f3' 'b6e39afee83fbc47fe2e725349149e20e55931678e7a349d7d8ea9b4f196d53b4580f79a64e9006ac66466dac1ef7e6f8a36b9ac0a61fdcf427b512c7e5e1723' 'b93729439415632483c083b58d55916500fe0078eb61b44fe75077a2c276ca16e57b4eadc2546315095dfaa8dedb1ae9ad813f8904b92b842249fd6205e3a485' '2086f837fa8dd67bb7f4c1ef933de9bf50352801bed15202fca9e8bdfb3d91fccd652ed41dc810787a7f7853b1c84e08fc906848ffa07b66878b8fca937f47d7' 'ce07b7c10046235bdd492af1d9793ce9a4edc9345e61003c139f9b638db3c3a44c1998498e2d7e0708b5d012e328edc9864c7e35375f1b63573f9dff05b5ed84' '149ad5bce320628dbbe78271640e1df64423165336351a6ff6b5b3b9d542305fa8a47aff134554d763806a0870c0f8674d09aea406b906c8495630ff8b60753e' '9e9ce551e1777af0449472e852c39247f431211df34da3a9b21f46148388b165fce0cd3792b67435d3d91347f167c217d3768a28bb9bf435e4b877bcad131eb7' '560ff7774e7f1464768ff3c1198fd224a8bd229957ab347a443dc34892fdb85339f25ef3710b24cbf06586b9a007f130184f73b590ee5ac9d3a02cb7a0da5a2b' 'b5b78a2521631dd6f3e94716dcea03a56bfeadf88fee3c6cac9bfddfd8b032548afd75d3b418ab255148ee12894fd86897f7412d6662c21d8cfd504cebd2ed48' 'b725647482d61d56c4cf9ff4c68d41284604a6e6425b068ef977749d5713448057208172cdc0a77b073b4d3a04f25bf5f7b02176ecbbaa126966f82452f318a9' '15e35227b571846874801e4dc7d59eeb7f221f7f2971ffa9b3479d23f63867515766ed3fbb27272b8b57be7e067d33363fa8c5ec3d6d1575bdbfa6c643555fe5' '0ee973cd6f1bd497ad9bf1ccb2b0c8d4e6d47ffc1af003e5f530848b9c3d668e980abbbb6bb0060a5a0f11fabbf9db26cc290598f8d20a24367b2ed2b7f5916f' '470d88e603c8e4c70ed8880af0b8be3bc75671139dfa712632b638515e083c96d3817cdb2619ee8ad44e0a6a4e622cc73219e9aecd273f757a354e0e1946aad2' 'c6db7dab990343aefb704abfe4e476c67a8eb3234a39fea46fc1e6be07fd3244c227ec799a69758454fd1dc02737b0021cfa026770a39d3cdcf4148372b5e976' 'cff97eba72f5b4c07689caf116ea837fe9b050d885f34be6ca85df362c8babe28f80174bfcfb693398005dd290dc4f770d16fe386c05a487703c96895bd4c5d8' '080a6a41d68ce877f979688072e034a9687164280f9964606bbc306046c7adc2a0e19abd06a019ac9e3b85762b0286ba5c9bc19da0ff61860c1030d6b9d8611f' '1d4add65e09e5e49df61aaa1e7465b0fccacf9b6b05ad52d0863381bb3b6dacbeef1bdc8f386a4239981b5162ebfd9253887a068b626ec624a57fdbec251eb11' '07bf794542718146ec1d9dc134be5213febfa99de796e6c8040cb8eb4c0fb4934bae0a345d8f86acdb0f31e0c8eac2b2a366b8f8b5875eddebea17084ce9ef20' '84c16d1061b9ccd7ff7970a882c1860df864e39f2c7b9f8c78a66512d7d1d6f815ee93225357292a034ba5bbc33764ba415eda6302956d647f61a5e3c8080b54' '95001d7b5a3be8615ddc3c7b68f4084ca05a94e97f111cc6282641c418a47d3b3dea74eb11cf7a97473a8b6e0fe5e287240d9de1fd1b3fcf578dc16400a96c02' 'd5b6caa2f4e90f376dd19f769bf4c5f7776cd1faa215f8bb42e8017aeef98c71f3fb46f1beeac9cae91c9e3dae71194aac0c6af1b50947be5de2cf04bcf03566' 'c95960f4c2b827dd4ddaacc2ff8b7ee8669dc86e81f8f5e8d15102ddab40e7c5aba9f9bf3b35c32337acc7248f4c1bebda90954c8d99c23fc5a362f17b67c131' '32d3044ac5528f74fce266863c20fc1ae40e5d379cba4c5260cefb5d372abc6caf0175d3d82a72aa62fa25609545e62b3659e8298af7d68dbcbb9fa4d3b17aed' '5f0dbb12db07e82e738b77c0c540939f69e3e2ddfb4155c47085ca55dc428fd728d5c146e2395c9e966d855425977fcdc063fe411e5bd38f8c5682c7b0d7fa31' '42cc2e18579332a91b7d953f61a1f942bf76b65181d803467f924255022eb18f8c01e837828ef3ca20eda83c55b07f91bb666789a14e7c86ba7a6499972b3800' '52ffb7a1d8841230550500311491f9741cb4aca5c2c560d01d5d3fbe4783212597094bfa19fa89480d29fe4dfd3ab8b8afffa6a9275cc9d0489d8ab80480c8c7' '4ae321a8ea05e56f663215d61301ea39e975c6a5b077dcdecf078734c63f0cbd1b7438394749471ce85c1a9a8997c735ffd8c0c8e082b5e994dd0fe450844d98' '91e16110e0e76f77c99564901c6bd422f4def515f87574a166c6f1db3ff6838638890c22072e9422cc0bb8ed71755e0b20915141d1c53eb953bf648f872de675' '7821212d95c453a8f1ffd20591c697aef71dab0da85f5cfebcf9523410cebc97182f9ecb3de481f4b714713cb170049f9872dcc7a4f0e58771e026aaa4227a65' '699a0021130546a82b2a71f2c49d293dab1fb316e4fd927d9888ed3dfaa918200a9fc3f7be09c7448886e12df8641f48e0d276e721d676833b591884c2d7a65a' '30b6b814aa8266c8069ba9463eb66c799e0cb3cbd811f8a749dabbd0ce7f613ff22bd76ce10932e83279312da581ed8c53aa5801555ac23162c0c92d8fdbd485' 'a92aaaca2643df0ccb3013f1d72db71c9f8568bbcb595c07c58ad8ef11b10ec3b049ca8c0e6431ea1a042f9bf901f9414b1ba0623a4f1b30ce61bd748afe8e46' 'caa6e7ae0704f70b1820da217530185551eeb1a28935cd659bd81b8735bde80fd7be4e2a42e38147d4e7edefae7db55541a11ac459a3082944180f7a6f064dd1' '8208a2910f6e1ce082a1f7298baf405d029fd815210b4a5971800ff3d47a3a5adc6399880433502fa2a2f0934f2ac0a1ca943166c03c01fa553261c436a74255' '3a72ad27072c3c89102b6d1938534892a9b270bf0a86f49bc2389e48762d3dd309522a6ba4fbf50e776a616da6ec0993574a082ce96969e50d900bfe2f63e1a7' 'f1f37cf0d0a7d8dc5a038fa2003b1743a90bf02802f7bc896af316ed274ab761989aeded04183d97f80d59c5caf5549ef6c5e9aaef42883265c12144b6cddbe6' '31d686c7715ae1f815a0f87c2c0f9dcb436146e3a3602db0e3646ef35a41add154249dcde079e5f75006057022d623f23d9d6299ea6587fe63fcaa95d0fba670' '668cfaaf0f005e1869a972963dfb3d70d15341b13258b469bf49271db16f987f4710c6318bb8416844a7c0d7c2f5d08d8c1009cb8bb8d491b727c188025b2535' '4db470ae4acfb00d03606b4cd2074fe57bacb5f7e19e4f6d752d6c89f740e6610b9eddfbe231255263445f8ff5bd8bb52b6307a5326a54860c84b011183b5d49' 'cf3945f4819b8a277eaab68b0206b93940fcdd7ae7763f01672a70c08c2ca8dcb92184c24ca78e2f5524bcbe3adfc2bdbf95baf74a49265e36340a21444985da') # vim:set sw=2 et: