gtk/thunderbird-kde/PKGBUILD
2019-02-03 14:51:32 +01:00

167 lines
5.7 KiB
Bash

pkgname=thunderbird-kde
pkgver=60.5.0
pkgrel=1
provides=(thunderbird=${pkgver})
replaces=(thunderbird)
pkgdesc="Standalone Mail/News reader"
arch=('x86_64')
license=('MPL' 'GPL')
url="https://www.thunderbird.net/"
depends=('gtk3' 'gtk2' 'mozilla-common' 'libxt' 'startup-notification' 'mime-types'
'dbus-glib' 'libpulse' 'desktop-file-utils' 'hicolor-icon-theme' 'kio' 'knotifications'
'libvpx' 'icu' 'libevent' 'nss' 'hunspell' 'sqlite3' 'nspr' 'libnotify')
makedepends=('unzip' 'zip' 'python2' 'wireless_tools' 'yasm' 'mesa' 'libpulse'
'pkg-config' 'gconf' 'xorg-server-xvfb' 'autoconf2.13' 'rust' 'clang' 'llvm')
optdepends=('thunderbird-i18n: for multilanguage support'
'libcanberra: for sound support')
options=(!emptydirs !makeflags)
source=(https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz
thunderbird.desktop
mozilla-kde.patch
mozilla-nongnome-proxies.patch)
sha512sums=('b18bad3d0ec33a813ec8f2f7f539a9ba08bd05432a16b1838671a101a85d66b2acdd2573d9fc3117cecaa9aa1429c178d4ddbae987a3ce6e4e4211981eecb8d2'
'057513bc1b2573f31986916dc905f2e1a165e7500fea51ce7cba1f9f600c0a74396d0d39283ec5ee76fb401133bc614ebcf803b5d15fadac46728d55e30353ea'
'00f363a5ece0afecf42597d0305aa8d363ce35870d3f54fd2d3c2f5d12b863e2e1d243b88e1ca506673a862da1eef48934d07cc7e7d10c2920453c49f7bb171c'
'7f255bb3e02ac3a703bdcffe4bdb531489dace4e669a557fe9845e8137e87939fc671ed103dcef44162e3297dd04aad5484ab5f3b1d0859b75249fdad9de11f7')
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Chakra Linux use ONLY. For your own distribution, please
# get your own set of keys.
_google_api_key=AIzaSyA33sdKPff0x3KBByOhpzc1i7RS2A1mEpY
# Mozilla API keys (see https://location.services.mozilla.com/api)
# Note: These are for Chakra Linux use ONLY. For your own distribution, please
# get your own set of keys. Feel free to contact totte@chakralinux.org for
# more information.
_mozilla_api_key=bf05f841-e0bd-4644-81f5-3c132755f2e9
prepare(){
cd thunderbird-${pkgver}
echo -n "$_google_api_key" >google-api-key
echo -n "$_mozilla_api_key" >mozilla-api-key
msg 'Generating kde.js'
cat >kde.js <<END
pref("browser.preferences.instantApply", false);
END
cat >.mozconfig <<END
ac_add_options --enable-application=comm/mail
ac_add_options --prefix=/usr
ac_add_options --libdir=/usr/lib
ac_add_options --enable-release
ac_add_options --enable-linker=gold
ac_add_options --enable-hardening
ac_add_options --enable-optimize
ac_add_options --enable-rust-simd
ac_add_options --enable-default-toolkit=cairo-gtk3
# Keys
ac_add_options --with-google-api-keyfile=${PWD@Q}/google-api-key
ac_add_options --with-mozilla-api-keyfile=${PWD@Q}/mozilla-api-key
# System libraries
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-png
ac_add_options --with-system-libevent
ac_add_options --with-system-libvpx
# our icu is too old
#ac_add_options --with-system-icu
ac_add_options --enable-system-hunspell
ac_add_options --enable-system-sqlite
ac_add_options --enable-system-ffi
# Features
ac_add_options --enable-official-branding
ac_add_options --enable-update-channel=release
ac_add_options --with-distribution-id=org.chakralinux
ac_add_options --enable-startup-notification
ac_add_options --enable-calendar
ac_add_options --disable-gconf
ac_add_options --disable-crashreporter
ac_add_options --disable-updater
ac_add_options --disable-tests
ac_add_options --disable-debug-symbols
export MOZILLA_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
END
msg "Patching for KDE"
patch -Np1 -i "$srcdir/mozilla-nongnome-proxies.patch"
patch -Np1 -i "$srcdir/mozilla-kde.patch"
mkdir "$srcdir/path"
ln -s /usr/bin/python2 "$srcdir/path/python"
}
build() {
cd thunderbird-${pkgver}
export PYTHON="/usr/bin/python2"
export SHELL="/bin/bash"
./mach configure
./mach build
./mach buildsymbols
}
package() {
cd thunderbird-${pkgver}
DESTDIR="$pkgdir" ./mach install
_vendorjs="$pkgdir/usr/lib/thunderbird/defaults/preferences/vendor.js"
install -Dm644 /dev/stdin "$_vendorjs"<<END
// Use LANG environment variable to choose locale
pref("intl.locale.requested", "");
// Disable default mailer checking.
pref("mail.shell.checkDefaultMail", false);
// Don't disable our bundled extensions in the application directory
pref("extensions.autoDisableScopes", 11);
pref("extensions.shownSelectionUI", true);
END
install -Dm644 kde.js "$pkgdir/usr/lib/thunderbird/defaults/preferences/kde.js"
_distini="$pkgdir/usr/lib/thunderbird/distribution/distribution.ini"
install -Dm644 /dev/stdin "$_distini" <<END
[Global]
id=chakralinux
version=1.0
about=Mozilla Thunderbird for Chakra GNU/Linux
[Preferences]
app.distributor=chakralinux
app.distributor.channel=${pkgname%-kde}
app.partner.chakralinux=chakralinux
END
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/thunderbird.png"
done
install -Dm644 comm/mail/branding/thunderbird/TB-symbolic.svg \
"$pkgdir/usr/share/icons/hicolor/symbolic/apps/thunderbird-symbolic.svg"
install -Dm644 "$srcdir/thunderbird.desktop" \
"$pkgdir/usr/share/applications/thunderbird.desktop"
# Use system-provided dictionaries
rm -rf "$pkgdir/usr/lib/thunderbird/{dictionaries,hyphenation}"
ln -s /usr/share/hunspell "$pkgdir/usr/lib/thunderbird/dictionaries"
ln -s /usr/share/hyphen "$pkgdir/usr/lib/thunderbird/hyphenation"
ln -sf thunderbird "$pkgdir/usr/lib/thunderbird/thunderbird-bin"
}