gtk/thunderbird-kde/PKGBUILD
2017-05-16 00:50:48 +01:00

138 lines
5.9 KiB
Bash

pkgname=thunderbird-kde
pkgver=52.1.1
pkgrel=1
provides=(thunderbird=${pkgver})
replaces=(thunderbird)
pkgdesc="Standalone Mail/News reader"
arch=('x86_64')
license=('MPL' 'GPL')
url="http://www.mozilla.org/thunderbird/"
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' 'cargo')
optdepends=('thunderbird-i18n: for multilanguage support'
'libcanberra: for sound support')
options=(!emptydirs !makeflags)
install=thunderbird.install
# For patch look here: https://github.com/manjaro/packages-community/tree/master/thunderbird-kde
source=(https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz
mozconfig
thunderbird.desktop
thunderbird-install-dir.patch
mozilla-kde.patch
mozilla-language.patch
mozilla-nongnome-proxies.patch
fix-wifi-scanner.diff
vendor.js
kde.js
0001-Bug-1338655-Don-t-try-to-build-mp4parse-bindings.-r-.patch)
sha512sums=('84b54ae4401c9728c38f32f58e0df24e049471b3613f9973981b305e0ed09b2e8c2c1b5a35d4fee85ce2cf1d6fa99e80418bc216ae0d35d40e9fdeef61a6c06e'
'e67c9bf97d73b95dbe31a2bba2dd8ae3d7413a8d3cd728f2b321cf222e4b1490d1ccf804634e4549911603e23850b0db52f524450b487a151c4ab2e992c7e350'
'057513bc1b2573f31986916dc905f2e1a165e7500fea51ce7cba1f9f600c0a74396d0d39283ec5ee76fb401133bc614ebcf803b5d15fadac46728d55e30353ea'
'1eecdc7942ac189a67d4d57bca305937ae8d5986944738139bad4baa47e5a9c904797db6a26840d559740178fb6e1904a2d5377c86a7d0f8a6b721471ef37d75'
'04bc673d5cd0c9b3b28ac7f5cb463a8da9d4f527df1518862dca61cfba76f1afc51946d21a8aafa0d1d7ad81a30819df0c949ac849bf09ae28dec17a44a353bd'
'001776b5b332c526adeee9ef338a0f589e3f2c1b3eb3c1ece5aaae91637a50f821b830e717ea646f136ccfb121d28d83d28abfe65b57f3aa5784d0e79f8dfaf4'
'2b7b03697e3bf68681fd45eb06235c5f9145ad7f549a3291e0e62fa95e8b3de02a118b0562d50387ff174fbe23a9060f1c749a21cdd2ccb0f20680424f70587b'
'1bd2804bea1fe8c85b602f8c5f8777f4ba470c9e767ad284cb3d0287c6d6e1b126e760738d7c671f38933ee3ec6b8931186df8e978995b5109797ae86dfdd85a'
'aeb444784732267f1b1e87e6084a776f82a1912c4c2637d2cf1de1c135dd9d41d2ef66d2bd3f9cbd3a79fad32d17ea6e2968ba644d5f887cb66ba6c09a2098f5'
'06696c5b3216fd38d546d743f61a2ac0bb215a01192e53da75b069095565c602ec5730b3f317de08e4bd3318c4e5642560e9bc25153a69e4b5442772edef8cd8'
'9a02d89603ad2928e38d7350d5d71ec904815958c65cc13323f5d4cd9392b823264fae812ea658d83728839372b412fd185653ef65b7ab8dd0595158b3bdc2e2')
# 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}
cp "$srcdir/mozconfig" .mozconfig
patch -Np2 -i ../thunderbird-install-dir.patch
msg "Patching for KDE"
cd mozilla
patch -Np1 -i "$srcdir/mozilla-language.patch"
patch -Np1 -i "$srcdir/mozilla-nongnome-proxies.patch"
patch -Np1 -i "$srcdir/mozilla-kde.patch"
cd ..
# https://bugzilla.mozilla.org/show_bug.cgi?id=1314968
patch -d mozilla -Np1 < ../fix-wifi-scanner.diff
# https://bugs.archlinux.org/task/53890
patch -d mozilla -Np1 < ../0001-Bug-1338655-Don-t-try-to-build-mp4parse-bindings.-r-.patch
echo -n "$_google_api_key" > google-api-key
echo "ac_add_options --with-google-api-keyfile=\"$PWD/google-api-key\"" >>.mozconfig
echo -n "$_mozilla_api_key" > mozilla-api-key
echo "ac_add_options --with-mozilla-api-keyfile=\"$PWD/mozilla-api-key\"" >>.mozconfig
mkdir "$srcdir/path"
ln -s /usr/bin/python2 "$srcdir/path/python"
}
build() {
cd thunderbird-${pkgver}
# _FORTIFY_SOURCE causes configure failures
CPPFLAGS+=" -O2"
# Hardening
LDFLAGS+=" -Wl,-z,now"
# GCC 6
# CXXFLAGS+=" -fno-delete-null-pointer-checks -fno-lifetime-dse -fno-schedule-insns2"
export PYTHON="/usr/bin/python2"
export SHELL="/bin/bash"
#xvfb-run -a -s "-extension GLX -screen 0 1280x1024x24" \
# make -f client.mk profiledbuild
make -f client.mk build
}
package() {
cd thunderbird-${pkgver}
make -f client.mk DESTDIR="$pkgdir" INSTALL_SDK= install
install -Dm644 "$srcdir"/vendor.js "$pkgdir/usr/lib/thunderbird/defaults/preferences/vendor.js"
install -Dm644 "$srcdir"/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 256; do
install -Dm644 other-licenses/branding/thunderbird/mailicon$i.png \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/thunderbird.png"
done
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"
}