PKGBUILDs/extra/thunderbird/PKGBUILD

197 lines
6.6 KiB
Bash
Raw Normal View History

2013-06-25 16:41:43 +00:00
# $Id$
2017-10-13 01:04:57 +00:00
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
2016-04-19 18:51:04 +00:00
# Contributor: Ionut Biru <ibiru@archlinux.org>
2013-06-25 16:41:43 +00:00
# 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
2017-10-13 01:04:57 +00:00
# - remove rust makedepend
2013-06-25 16:41:43 +00:00
2017-02-22 03:19:46 +00:00
buildarch=12
2015-12-16 03:09:15 +00:00
highmem=1
2013-06-25 16:41:43 +00:00
pkgname=thunderbird
2017-12-26 03:09:19 +00:00
pkgver=52.5.2
2017-11-30 19:40:21 +00:00
pkgrel=1
2016-04-19 18:51:04 +00:00
pkgdesc="Standalone mail and news reader from mozilla.org"
2017-11-17 23:32:39 +00:00
arch=(x86_64)
2017-02-22 03:19:46 +00:00
license=(MPL GPL LGPL)
2016-07-09 23:25:53 +00:00
url="https://www.mozilla.org/thunderbird/"
2017-04-06 00:31:29 +00:00
depends=(gtk3 gtk2 mozilla-common libxt startup-notification mime-types dbus-glib alsa-lib ffmpeg
2017-06-16 01:16:37 +00:00
nss hunspell sqlite ttf-font icu libvpx)
2017-04-06 00:31:29 +00:00
makedepends=(unzip zip diffutils python2 yasm mesa imake gconf libpulse inetutils xorg-server-xvfb
autoconf2.13)
optdepends=('libcanberra: sound support')
2017-02-22 03:19:46 +00:00
options=(!emptydirs !makeflags)
2016-04-19 18:51:04 +00:00
source=(https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz
2017-10-13 01:04:57 +00:00
0001-Bug-1338655-Don-t-try-to-build-mp4parse-bindings.-r-.patch
no-crmf.diff rust-i686.patch glibc-2.26-fix.diff fix-wifi-scanner.diff
$pkgname.desktop thunderbird-install-dir.patch)
2017-12-26 03:09:19 +00:00
sha256sums=('7772e1865cd4cbaac82ea05374d0ae51f754f47c6160c9b83919da483d620ee5'
2017-10-13 01:04:57 +00:00
'413cd6d366d78f325d80ebebccfd0afa0d266b40b2e54b66ba2fa03c15f3ea67'
2017-06-16 01:16:37 +00:00
'a7317caba56e89932bd9e3b9352d94701dd9a419685057f238b1ded8dc0adcd7'
2017-04-06 00:31:29 +00:00
'f61ea706ce6905f568b9bdafd1b044b58f20737426f0aa5019ddb9b64031a269'
2017-10-13 01:04:57 +00:00
'cd7ff441da66a287f8712e60cdc9e216c30355d521051e2eaae28a66d81915e8'
'9765bca5d63fb5525bbd0520b7ab1d27cabaed697e2fc7791400abc3fa4f13b8'
'e44c55501f650a4e80b9c353b81f33e07ca65808db831eff6ca616aded233827'
'24599eab8862476744fe1619a9a53a5b8cdcab30b3fc5767512f31d3529bd05d')
2016-04-19 18:51:04 +00:00
# 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
2013-06-25 16:41:43 +00:00
prepare() {
2017-02-22 03:19:46 +00:00
mkdir path
ln -s /usr/bin/python2 path/python
2016-04-19 18:51:04 +00:00
2017-02-22 03:19:46 +00:00
cd $pkgname-$pkgver
2015-04-21 12:07:18 +00:00
patch -Np1 -i ../thunderbird-install-dir.patch
2013-06-25 16:41:43 +00:00
2017-10-13 01:04:57 +00:00
# https://bugzilla.mozilla.org/show_bug.cgi?id=1314968
patch -d mozilla -Np1 < ../fix-wifi-scanner.diff
2017-06-16 01:16:37 +00:00
# https://bugzilla.mozilla.org/show_bug.cgi?id=1371991
patch -Np1 -i ../no-crmf.diff
2017-09-22 23:13:32 +00:00
# https://bugzilla.mozilla.org/show_bug.cgi?id=1385667
# https://bugzilla.mozilla.org/show_bug.cgi?id=1394149
patch -d mozilla/toolkit/crashreporter/google-breakpad/src/client -Np4 < ../glibc-2.26-fix.diff
2017-04-06 00:31:29 +00:00
# Build with the rust targets we actually ship
patch -d mozilla -Np1 < ../rust-i686.patch
2016-05-15 01:30:35 +00:00
2017-10-13 01:04:57 +00:00
# https://bugs.archlinux.org/task/53890
patch -d mozilla -Np1 < ../0001-Bug-1338655-Don-t-try-to-build-mp4parse-bindings.-r-.patch
2016-04-19 18:51:04 +00:00
echo -n "$_google_api_key" >google-api-key
echo -n "$_mozilla_api_key" >mozilla-api-key
2017-02-22 03:19:46 +00:00
cat >.mozconfig <<END
ac_add_options --enable-application=mail
2017-04-09 20:25:29 +00:00
ac_add_options --enable-calendar
2017-02-22 03:19:46 +00:00
ac_add_options --prefix=/usr
ac_add_options --enable-release
2017-05-02 00:56:10 +00:00
#ac_add_options --enable-gold
#ac_add_options --enable-pie
2017-06-16 01:16:37 +00:00
#ac_add_options --enable-optimize="-O2"
2017-02-22 03:19:46 +00:00
# Branding
ac_add_options --enable-official-branding
2017-04-06 00:31:29 +00:00
ac_add_options --enable-update-channel=release
ac_add_options --with-distribution-id=org.archlinux
2017-02-22 03:19:46 +00:00
# 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-icu
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-libvpx
ac_add_options --enable-system-hunspell
ac_add_options --enable-system-sqlite
ac_add_options --enable-system-ffi
ac_add_options --enable-system-pixman
# Features
2017-10-13 01:04:57 +00:00
ac_add_options --enable-alsa
ac_add_options --disable-jack
2017-02-22 03:19:46 +00:00
ac_add_options --enable-startup-notification
ac_add_options --disable-crashreporter
ac_add_options --disable-updater
ac_add_options --disable-elf-hack
ac_add_options --disable-webrtc
END
2017-05-02 00:56:10 +00:00
if [[ $CARCH == "armv7h" ]]; then
echo 'ac_add_options --enable-optimize="-g -O2 -fno-schedule-insns"' >> .mozconfig
2017-06-16 01:16:37 +00:00
else
echo 'ac_add_options --enable-optimize="-O2"' >> .mozconfig
2017-05-02 00:56:10 +00:00
fi
2013-06-25 16:41:43 +00:00
}
build() {
2016-04-19 18:51:04 +00:00
cd $pkgname-$pkgver
2017-02-22 03:19:46 +00:00
2016-05-15 01:30:35 +00:00
# _FORTIFY_SOURCE causes configure failures
CPPFLAGS+=" -O2"
2016-04-19 18:51:04 +00:00
export PATH="$srcdir/path:$PATH"
2013-06-25 16:41:43 +00:00
2017-04-06 00:31:29 +00:00
# Do PGO
#xvfb-run -a -n 95 -s "-extension GLX -screen 0 1280x1024x24" \
# make -f client.mk build MOZ_PGO=1
2015-06-12 00:36:35 +00:00
make -f client.mk build
2013-06-25 16:41:43 +00:00
}
package() {
2016-04-19 18:51:04 +00:00
cd $pkgname-$pkgver
make -f client.mk DESTDIR="$pkgdir" INSTALL_SDK= install
2013-06-25 16:41:43 +00:00
2017-06-16 01:16:37 +00:00
_vendorjs="$pkgdir/usr/lib/$pkgname/defaults/preferences/vendor.js"
2017-02-22 03:19:46 +00:00
install -Dm644 /dev/stdin "$_vendorjs" <<END
// Use LANG environment variable to choose locale
pref("intl.locale.matchOS", true);
// 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);
2017-04-06 00:31:29 +00:00
END
2017-06-16 01:16:37 +00:00
_distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini"
2017-04-06 00:31:29 +00:00
install -Dm644 /dev/stdin "$_distini" <<END
[Global]
id=archlinux
version=1.0
about=Mozilla Thunderbird for Arch Linux
[Preferences]
app.distributor=archlinux
app.distributor.channel=$pkgname
app.partner.archlinux=archlinux
2017-02-22 03:19:46 +00:00
END
2013-06-25 16:41:43 +00:00
2015-06-12 00:36:35 +00:00
for i in 16 22 24 32 48 256; do
2017-02-22 03:19:46 +00:00
install -Dm644 other-licenses/branding/thunderbird/mailicon$i.png \
2017-06-16 01:16:37 +00:00
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
2013-06-25 16:41:43 +00:00
done
2017-06-16 01:16:37 +00:00
install -Dm644 ../$pkgname.desktop \
"$pkgdir/usr/share/applications/$pkgname.desktop"
2013-06-25 16:41:43 +00:00
2015-06-12 00:36:35 +00:00
# Use system-provided dictionaries
2017-06-16 01:16:37 +00:00
rm -r "$pkgdir"/usr/lib/$pkgname/dictionaries
ln -Ts /usr/share/hunspell "$pkgdir/usr/lib/$pkgname/dictionaries"
ln -Ts /usr/share/hyphen "$pkgdir/usr/lib/$pkgname/hyphenation"
2017-02-22 03:19:46 +00:00
# Install a wrapper to avoid confusion about binary path
2017-06-16 01:16:37 +00:00
install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END
2017-02-22 03:19:46 +00:00
#!/bin/sh
2017-06-16 01:16:37 +00:00
exec /usr/lib/$pkgname/thunderbird "\$@"
2017-02-22 03:19:46 +00:00
END
2013-06-25 16:41:43 +00:00
2017-02-22 03:19:46 +00:00
# Replace duplicate binary with wrapper
2015-08-15 03:29:26 +00:00
# https://bugzilla.mozilla.org/show_bug.cgi?id=658850
2017-06-16 01:16:37 +00:00
ln -srf "$pkgdir/usr/bin/$pkgname" \
"$pkgdir/usr/lib/$pkgname/thunderbird-bin"
2013-06-25 16:41:43 +00:00
}