aboutsummaryrefslogtreecommitdiffstats
path: root/testing/thunderbird/APKBUILD
blob: 191fcf8c8ba0d10956b7880a71a2f4ada3aac3d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# Contributor: Joseph Benden <joe@benden.us>
# Maintainer: Joseph Benden <joe@benden.us>

pkgname=thunderbird
pkgver=60.9.0
_pkgver=$pkgver
_xulver=$pkgver
pkgrel=0
pkgdesc="Thunderbird email client"
url="https://www.thunderbird.net/"
arch="x86_64"
license="GPL-3.0-or-later AND LGPL-2.1-or-later AND MPL-2.0"
options="!check !strip"
depends="
	alsa-lib
	dbus-glib
	ffmpeg
	gconf
	gtk+3.0
	hunspell
	icu
	libevent
	libjpeg-turbo
	libnotify
	libogg
	libtheora
	libvorbis
	libxcomposite
	libxt
	nspr
	nss
	sqlite
	startup-notification
	"
makedepends="
	alsa-lib-dev
	autoconf2.13
	automake
	bsd-compat-headers
	bzip2-dev
	cargo
	cbindgen
	clang-dev
	dbus-glib-dev
	ffmpeg-dev
	gconf-dev
	gtk+2.0-dev
	gtk+3.0-dev
	hunspell-dev
	icu-dev
	libevent-dev
	libidl-dev
	libjpeg-turbo-dev
	libnotify-dev
	libogg-dev
	libtheora-dev
	libtool
	libvorbis-dev
	libvpx-dev
	libxcomposite-dev
	libxt-dev
	llvm-dev
	mesa-dev
	nasm
	nodejs
	nspr-dev
	nss-dev
	nss-static
	paxmark
	python3-dev
	sed
	sqlite-dev
	startup-notification-dev
	wireless-tools-dev
	yasm
	zip
	"
source="https://ftp.mozilla.org/pub/thunderbird/releases/$pkgver/source/thunderbird-$pkgver.source.tar.xz
	stab.h
	fix-fortify-system-wrappers.patch
	fix-fortify-inline.patch
	fix-seccomp-bpf.patch
	fix-toolkit.patch
	fix-tools.patch
	mallinfo.patch
	mozilla-build-arm.patch
	disable-moz-stackwalk.patch
	fix-rust-target.patch
	fix-bug-1261392.patch
	fix-webrtc-glibcisms.patch
	sandbox-membarrier.patch
	rust-unitialized-field.patch
	rust133.patch
	0003-Disable-ccache-stats.patch
	rust-cssparser.patch
	thunderbird.desktop
	"
_mozappdir=/usr/lib/$pkgname

# 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

# help our shared-object scanner to find the libs
ldpath="$_mozappdir"
sonameprefix="$pkgname:"

# we need this because cargo verifies checksums of all files in vendor
# crates when it builds and gives us no way to override or update the
# file sanely... so just clear out the file list
_clear_vendor_checksums() {
	sed -i 's/\("files":{\)[^}]*/\1/' third_party/rust/$1/.cargo-checksum.json
}

prepare() {
	default_prepare

	cp "$srcdir"/stab.h toolkit/crashreporter/google-breakpad/src/

	# https://bugzilla.mozilla.org/show_bug.cgi?id=1341234
	mkdir -p "$builddir"/objdir
	echo "ac_add_options BINDGEN_CFLAGS='-I/usr/include/nspr -I/usr/include/pixman-1'" >>objdir/.mozconfig

	# add API keys
	echo -n "${_google_api_key}" > $builddir/objdir/google-api-key
	echo -n "${_mozilla_api_key}" > $builddir/objdir/mozilla-api-key

	_clear_vendor_checksums cssparser
}

build() {
	cd "$builddir"/objdir

	sed -e 's/checkImpl/checkFFImpl/g' -i ../js/src/vm/JSContext*.h

	export SHELL=/bin/sh
	export BUILD_OFFICIAL=1
	export MOZILLA_OFFICIAL=1
	export USE_SHORT_LIBNAME=1
	export MACH_NO_TERMINAL_FOOTER=1
	export TERM=ansi-generic

	# gcc 6
	export CXXFLAGS="-fno-delete-null-pointer-checks -fno-schedule-insns2"

	# set rpath so linker finds the libs
	export LDFLAGS="$LDFLAGS -Wl,-rpath,${_mozappdir} -Wl,--gc-sections"

	# ignore compiler warnings
	export CXXFLAGS="$CXXFLAGS -Wno-class-memaccess -Wno-multistatement-macros -Wno-ignored-qualifiers"
	export LDFLAGS="$LDFLAGS -Wno-subobject-linkage"

	../mach configure \
		--prefix=/usr \
		--libdir=/usr/lib \
		\
		--disable-crashreporter \
		--disable-elf-hack \
		--disable-gold \
		--enable-install-strip \
		--disable-jemalloc \
		--disable-profiling \
		--disable-pulseaudio \
		--enable-strip \
		--disable-tests \
		--disable-updater \
		--disable-debug \
		--disable-debug-symbols \
		\
		--with-distribution-id=org.alpinelinux \
		--enable-alsa \
		--enable-application=comm/mail \
		--enable-default-toolkit=cairo-gtk3 \
		--enable-official-branding \
		--enable-optimize="$CFLAGS -fno-ident -fmerge-all-constants -ffunction-sections -fdata-sections -Wno-maybe-uninitialized -Wno-implicit-fallthrough -Wno-unused-function" \
		--enable-release \
		--enable-startup-notification \
		--enable-system-ffi \
		--enable-system-sqlite \
		--enable-ffmpeg \
		--enable-hardening \
		\
		--with-google-location-service-api-keyfile="${builddir}/objdir/google-api-key" \
		--with-google-safebrowsing-api-keyfile="${builddir}/objdir/google-api-key" \
		--with-mozilla-api-keyfile="${builddir}/objdir/mozilla-api-key" \
		\
		--with-system-bz2 \
		--with-system-hunspell \
		--with-system-icu \
		--with-system-jpeg \
		--with-system-libevent \
		--with-system-nspr \
		--with-system-nss \
		--with-system-pixman \
		--with-system-png \
		--with-system-zlib \
		--without-ccache \
		--with-clang-path=/usr/bin/clang \
		--with-libclang-path=/usr/lib
	#--with-system-libvpx # requires 1.7x to work, we've got 1.8.0 currently

	../mach build -v
}

package() {
	cd "$builddir"/objdir

	DESTDIR="$pkgdir" \
	MOZ_MAKE_FLAGS="$MAKEOPTS" \
		../mach install

	install -m755 -d ${pkgdir}/usr/share/applications
	install -m755 -d ${pkgdir}/usr/share/pixmaps
	install -m755 -d ${pkgdir}/usr/share/icons
	install -m755 -d ${pkgdir}/usr/share/icons/hicolor

	for i in 16 22 24 32 48 64 128 256; do
		install -Dm644 "$builddir"/comm/mail/branding/thunderbird/default${i}.png \
			"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
	done
	install -Dm644 "$builddir"/comm/mail/branding/thunderbird/TB-symbolic.svg \
		"$pkgdir/usr/share/icons/hicolor/symbolic/apps/thunderbird-symbolic.svg"
	install -Dm644 "$builddir"/comm/mail/branding/thunderbird/default48.png \
		${pkgdir}/usr/share/pixmaps/$pkgname.png

	install -m644 ${srcdir}/$pkgname.desktop ${pkgdir}/usr/share/applications/$pkgname.desktop

	# thunderbird currently does not work with mprotect. disable it for now
	local paxflags="-mp"
	[ "$CARCH" = "x86" ] && paxflags="-msp"

	paxmark "$paxflags" "$pkgdir"/$_mozappdir/thunderbird-bin
	paxmark "$paxflags" "$pkgdir"/$_mozappdir/plugin-container
	paxmark "$paxflags" "$pkgdir"/$_mozappdir/pingsender

	_vendorjs="$pkgdir/usr/lib/$pkgname/defaults/preferences/vendor.js"
	install -Dm644 /dev/stdin "$_vendorjs" <<END
// Use LANG environment variable to choose locale
pref("intl.locale.requested", "");

// Use system-provided dictionaries
pref("spellchecker.dictionary_path", "/usr/share/hunspell");

// 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

	_distini="$pkgdir/usr/lib/$pkgname/distribution/distribution.ini"
	install -Dm644 /dev/stdin "$_distini" <<END
[Global]
id=alpinelinux
version=1.0
about=Mozilla Thunderbird for Alpine Linux

[Preferences]
app.distributor=alpinelinux
app.distributor.channel=$pkgname
app.partner.alpinelinux=alpinelinux
END

	# Use system-provided dictionaries
	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"

	# Install a wrapper to avoid confusion about binary path
	install -Dm755 /dev/stdin "$pkgdir/usr/bin/$pkgname" <<END
#!/bin/sh
exec /usr/lib/$pkgname/thunderbird "\$@"
END

	# Replace duplicate binary with wrapper
	# https://bugzilla.mozilla.org/show_bug.cgi?id=658850
	ln -snf "$pkgdir/usr/bin/$pkgname" \
		"$pkgdir/usr/lib/$pkgname/thunderbird-bin"
}

sha512sums="f59d48fba7fb8a4bf7cb160e6ca2508312a7fce950c12f133206935bcdb4c9844a9cb063aa3aae67c82562d2a51e123cc1f5bbad0238a1e5ce386c514295bdd1  thunderbird-60.9.0.source.tar.xz
0b3f1e4b9fdc868e4738b5c81fd6c6128ce8885b260affcb9a65ff9d164d7232626ce1291aaea70132b3e3124f5e13fef4d39326b8e7173e362a823722a85127  stab.h
2f4f15974d52de4bb273b62a332d13620945d284bbc6fe6bd0a1f58ff7388443bc1d3bf9c82cc31a8527aad92b0cd3a1bc41d0af5e1800e0dcbd7033e58ffd71  fix-fortify-system-wrappers.patch
09bc32cf9ee81b9cc6bb58ddbc66e6cc5c344badff8de3435cde5848e5a451e0172153231db85c2385ff05b5d9c20760cb18e4138dfc99060a9e960de2befbd5  fix-fortify-inline.patch
183a4ef62cd79728117797235fe46ecd3e4336c008d615c2b2a64c707477e403aed1ee5e19feb86611b93ebecc00df339aa28a73735e045e38f0d1ce3080341b  fix-seccomp-bpf.patch
2f1bf85a340a82800dd6ba406c23489c319ec037b404f4240837854e2520b9ff11fcca0d51ac05b451c474e800fd8be13b1c57ae2917e9d1c7e5b6d91cf7e2d2  fix-toolkit.patch
48683964624bb58b5a2a2a5c89da56e3b8dcd04f8d42c6910bea5365010a77d6d82bdd48259774ca54341edc05b6768eaa6aa1b453718c02f760361197e78b52  fix-tools.patch
69e628668a2f450da249f761e375600e03674aeb6268dac9e282b1a7008ba47292cc8470cbc04a0ccc1d836d1653c56bb1495d5a127f906adf5807f7f95438c1  mallinfo.patch
3671bf7623c1825c977668efec62b57873bc6052becfd8a68ddcbc2d0ba96e0c3966c61b24716e6c48167d44280d3e690a4ff986907ceba5811a653e87770fff  mozilla-build-arm.patch
e62be6e08c7e0a1d2486f271426d3986a0870f2118442ccb424a509dfc5f92cc17d05cd7e46336176afb7bd9f495b29bb739c8f88ccf918de86209efe00caf95  disable-moz-stackwalk.patch
42cc44fda4b05259b38f055d6f51461746aa89a474cedc5e92fb9d20879da0d12b1b515b273a549e7302cda9c7eddde20d5fdba09853e5c658784ad6d0b20078  fix-rust-target.patch
fdd698ddd94d4265cc82aa063fce1522908ad4f5f118fd207e0d64a0409e1e04e3f096625caacbacb251b42cafe0d743bb0a0b9463a882d8938b5bb4562a05e1  fix-bug-1261392.patch
d09401eaa9620c9d4fa368865539fc4efb66eafb362d2195a653a6c6fd65e9370ced1b1b005993cbd181011360327dcb38e4b3e77b711f2c5ccf22d235ed4ef6  fix-webrtc-glibcisms.patch
e725a6e9b2361cd566ae2f90861dbce9f2231f16721ec02f4b9f9986b7dc82cc006ea6a500ae7f30c095ce746132a5bd1d9532c4cf0d1541dcc672a20aef8807  sandbox-membarrier.patch
01b48a708cc6bc6e3cd7cc7b16f5137ec344566ac891d699b65e322bc992726072fa14a54cef1a7775799fcbbcf90a6c170107c8524caba3bc311b42d93b7581  rust-unitialized-field.patch
66a847c2889acc794f4db5c47f8a30e819c120f84457d5c2e094e4a2ba990036e6ca84af9d799d7446b058a5fd7292926c6e4996f105d494f1b6e8e5f3b9a6a5  rust133.patch
3e57b2541f3889a1cf701860c8bf299f294cb077b0e8cfffda271cf02d1f59b25a697485d0df66e847e47f795b1ace54488a84a42851f2f8587717335537b44d  0003-Disable-ccache-stats.patch
cbc7fdf297647e15ddbec87d6ac6392bb8d395a9a30d035a49d8779945f7dadbf8eb245f4220b01acbc6b3bd4e815a2eae77a2f83f2114785677fa432d2b2520  rust-cssparser.patch
95a2b1deb4f6c90750fdd2bfe8ca0a7879a5b267965091705a6beb0a0a4b1ccad75d11df7b9885543ca4232ff704e975c6946f4c11804cb71c471e06f9576001  thunderbird.desktop"