PKGBUILD 6.1 KB
Newer Older
AlmAck's avatar
AlmAck committed
1
pkgname=thunderbird-kde
Jeff Huang's avatar
Jeff Huang committed
2
pkgver=60.6.1
Jeff Huang's avatar
Jeff Huang committed
3
pkgrel=1
AlmAck's avatar
AlmAck committed
4 5
provides=(thunderbird=${pkgver})
replaces=(thunderbird)
Manuel's avatar
Manuel committed
6 7 8
pkgdesc="Standalone Mail/News reader"
arch=('x86_64')
license=('MPL' 'GPL')
Jeff Huang's avatar
Jeff Huang committed
9
url="https://www.thunderbird.net/"
10 11
depends=('gtk3' 'gtk2' 'mozilla-common' 'libxt' 'startup-notification' 'mime-types'
         'dbus-glib' 'libpulse' 'desktop-file-utils' 'hicolor-icon-theme' 'kio' 'knotifications'
12 13
         'libvpx' 'icu' 'libevent' 'nss' 'hunspell' 'sqlite3' 'nspr' 'libnotify')
makedepends=('unzip' 'zip' 'python2' 'wireless_tools' 'yasm' 'mesa' 'libpulse'
14
             'pkg-config' 'gconf' 'xorg-server-xvfb' 'autoconf2.13' 'rust' 'clang' 'llvm')
AlmAck's avatar
AlmAck committed
15 16
optdepends=('thunderbird-i18n: for multilanguage support'
	    'libcanberra: for sound support')
17
options=(!emptydirs !makeflags)
18
source=(https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz
Manuel's avatar
Manuel committed
19
        thunderbird.desktop
AlmAck's avatar
AlmAck committed
20
        mozilla-kde.patch
Jeff Huang's avatar
Jeff Huang committed
21
        mozilla-nongnome-proxies.patch
Jeff Huang's avatar
Jeff Huang committed
22
        rust-1.33.patch)
Jeff Huang's avatar
Jeff Huang committed
23
sha512sums=('78e96aeb235a07ea3f53c4212a764e9b92dacd0e5d5561e454008a56d165a1e235ed05a8ecdb77efecf80f4c7f7ba2cf7a682c775047d7c175dfb50a1d9a42d2'
24
            '057513bc1b2573f31986916dc905f2e1a165e7500fea51ce7cba1f9f600c0a74396d0d39283ec5ee76fb401133bc614ebcf803b5d15fadac46728d55e30353ea'
Jeff Huang's avatar
Jeff Huang committed
25
            '00f363a5ece0afecf42597d0305aa8d363ce35870d3f54fd2d3c2f5d12b863e2e1d243b88e1ca506673a862da1eef48934d07cc7e7d10c2920453c49f7bb171c'
Jeff Huang's avatar
Jeff Huang committed
26
            '7f255bb3e02ac3a703bdcffe4bdb531489dace4e669a557fe9845e8137e87939fc671ed103dcef44162e3297dd04aad5484ab5f3b1d0859b75249fdad9de11f7'
Jeff Huang's avatar
Jeff Huang committed
27
            '7e6c9096c50ffcd216a36b6c2ad3eee773c7f337ffc3ed69538b4dec691748b87da822ef0b8cf73990efacd4bb0cb30313cec13ad2946483f8345e3eb0c1592f')
28 29 30 31 32 33

# 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

34 35 36 37 38 39 40

# 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

AlmAck's avatar
AlmAck committed
41
prepare(){
42
  cd thunderbird-${pkgver}
Chaoting Liu's avatar
Chaoting Liu committed
43

Chaoting Liu's avatar
Chaoting Liu committed
44 45 46
  echo -n "$_google_api_key" >google-api-key
  echo -n "$_mozilla_api_key" >mozilla-api-key

Chaoting Liu's avatar
Chaoting Liu committed
47 48 49 50 51 52 53 54 55 56 57 58 59 60
  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
Jeff Huang's avatar
Jeff Huang committed
61 62
# https://bugzilla.mozilla.org/show_bug.cgi?id=1521249
#ac_add_options --enable-rust-simd
Chaoting Liu's avatar
Chaoting Liu committed
63 64 65
ac_add_options --enable-default-toolkit=cairo-gtk3

# Keys
Jeff Huang's avatar
Jeff Huang committed
66 67
ac_add_options --with-google-location-service-api-keyfile=${PWD@Q}/google-api-key
ac_add_options --with-google-safebrowsing-api-keyfile=${PWD@Q}/google-api-key
Chaoting Liu's avatar
Chaoting Liu committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
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
101 102

  msg "Patching for KDE"
AlmAck's avatar
AlmAck committed
103 104
  patch -Np1 -i "$srcdir/mozilla-nongnome-proxies.patch"
  patch -Np1 -i "$srcdir/mozilla-kde.patch"
105

106 107
  mkdir "$srcdir/path"
  ln -s /usr/bin/python2 "$srcdir/path/python"
Jeff Huang's avatar
Jeff Huang committed
108

Jeff Huang's avatar
Jeff Huang committed
109 110
  # https://bugzilla.mozilla.org/show_bug.cgi?id=1539901 (Patch from Fedora)
  patch -Np1 -i ../rust-1.33.patch
AlmAck's avatar
AlmAck committed
111 112 113
}
         
build() {
114
  cd thunderbird-${pkgver}
115

Manuel's avatar
Manuel committed
116
  export PYTHON="/usr/bin/python2"
117
  export SHELL="/bin/bash"
AlmAck's avatar
AlmAck committed
118
  
119 120 121
  ./mach configure
  ./mach build
  ./mach buildsymbols
Manuel's avatar
Manuel committed
122 123 124
}

package() {
125
  cd thunderbird-${pkgver}
126
  DESTDIR="$pkgdir" ./mach install
Manuel's avatar
Manuel committed
127

Chaoting Liu's avatar
Chaoting Liu committed
128 129 130 131 132 133 134 135 136 137 138 139 140 141
  _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"
Manuel's avatar
Manuel committed
142

Jeff Huang's avatar
Jeff Huang committed
143
  _distini="$pkgdir/usr/lib/thunderbird/distribution/distribution.ini"
144 145 146 147 148 149 150 151 152 153 154 155
  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

156 157
  for i in 16 22 24 32 48 64 128 256; do
      install -Dm644 comm/mail/branding/thunderbird/default${i}.png \
158
          "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/thunderbird.png"
Manuel's avatar
Manuel committed
159 160
  done

161 162 163
  install -Dm644 comm/mail/branding/thunderbird/TB-symbolic.svg \
    "$pkgdir/usr/share/icons/hicolor/symbolic/apps/thunderbird-symbolic.svg"

Manuel's avatar
Manuel committed
164
  install -Dm644 "$srcdir/thunderbird.desktop" \
165
      "$pkgdir/usr/share/applications/thunderbird.desktop"
AlmAck's avatar
AlmAck committed
166

167
  # Use system-provided dictionaries
168
  rm -rf "$pkgdir/usr/lib/thunderbird/{dictionaries,hyphenation}"
169 170
  ln -s /usr/share/hunspell "$pkgdir/usr/lib/thunderbird/dictionaries"
  ln -s /usr/share/hyphen "$pkgdir/usr/lib/thunderbird/hyphenation"
171 172

  ln -sf thunderbird "$pkgdir/usr/lib/thunderbird/thunderbird-bin"
Manuel's avatar
Manuel committed
173
}