summaryrefslogtreecommitdiff
path: root/user/thunderbird/APKBUILD
blob: c137c78fee59129a2bc47b50dccbb762ba25111e (plain) (blame)
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
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=thunderbird
pkgver=128.1.0
pkgrel=0
_llvmver=18
pkgdesc="Email client from Mozilla"
url="https://www.thunderbird.net/"
arch="all !ppc"  # #837
options="!check"  # Tests disabled
license="MPL-2.0"
depends=""
# moz build system stuff
# system-libs
# actual deps
makedepends="
	autoconf2.13 cargo cbindgen clang llvm${_llvmver}-dev node ncurses-dev
	perl python3 rust cmd:which

	alsa-lib-dev bzip2-dev icu-dev libevent-dev libffi-dev libpng-dev
	libjpeg-turbo-dev nspr-dev nss-dev pulseaudio-dev zlib-dev

	dbus-glib-dev fts-dev gconf-dev gtk+3.0-dev hunspell-dev
	libnotify-dev libsm-dev libxcomposite-dev libxdamage-dev
	libxrender-dev libxt-dev nasm nss-static sqlite-dev
	startup-notification-dev unzip yasm zip gtk+2.0-dev
	"
_tbver="$pkgver"'esr'
source="https://archive.mozilla.org/pub/thunderbird/releases/$_tbver/source/thunderbird-$_tbver.source.tar.xz
	mozconfig

	bad-google-code.patch
	fix-mutex-build.patch
	fix-seccomp-bpf.patch
	icu-75.patch
	jpeg-link.patch
	mozilla-build-arm.patch
	pmmx-double-format.patch
	ppc32-fix.patch
	rust-32bit.patch
	shut-up-warning.patch
	skia-endian.patch
	skia-unified.patch
	stackwalk-x86-ppc.patch
	webrender.patch
	without-jit.patch

	thunderbird.desktop
	"
somask="liblgpllibs.so
	libmozgtk.so
	libmozsandbox.so
	libmozsqlite3.so
	libxul.so
	"
_mozappdir=/usr/lib/thunderbird
ldpath="$_mozappdir"

# secfixes:
#   68.6.0-r0:
#     - CVE-2019-20503
#     - CVE-2020-6805
#     - CVE-2020-6806
#     - CVE-2020-6807
#     - CVE-2020-6811
#     - CVE-2020-6812
#     - CVE-2020-6814
#   68.7.0-r0:
#     - CVE-2020-6819
#     - CVE-2020-6820
#     - CVE-2020-6821
#     - CVE-2020-6822
#     - CVE-2020-6825
#   68.9.0-r0:
#     - CVE-2020-6831
#     - CVE-2020-12387
#     - CVE-2020-12392
#     - CVE-2020-12395
#     - CVE-2020-12397

prepare() {
	default_prepare
	cp "$srcdir"/mozconfig "$builddir"/mozconfig
	echo "ac_add_options --host=\"$CHOST\"" >> "$builddir"/mozconfig
	echo "ac_add_options --target=\"$CTARGET\"" >> "$builddir"/mozconfig
	echo "mk_add_options MOZ_MAKE_FLAGS=\"-j$JOBS\"" >> "$builddir"/mozconfig

	# arch-specific configuration
	case "$CARCH" in
		pmmx|x86*|arm*)
			echo "ac_add_options --disable-elf-hack" >> "$builddir"/mozconfig
			;;
		s390x)
			echo "ac_add_options --disable-startupcache" >> "$builddir"/mozconfig
			;;
	esac

	# 32-bit memory ceiling, #1012, #1057
	case "${CARCH}" in
		pmmx|x86|ppc|i528|m68k|mips32*|arm*)
			echo "ac_add_options --disable-debug-symbols" >> "$builddir"/mozconfig
			echo "ac_add_options --enable-strip" >> "$builddir"/mozconfig
			CFLAGS="${CFLAGS} -g0";
			;;
	esac

	echo "ac_add_options --enable-optimize=\"$CFLAGS\"" >> "$builddir"/mozconfig
}

build() {
	export CFLAGS="$CFLAGS -Wno-dangling-pointer -Wno-array-bounds -Wno-comment -Wno-maybe-uninitialized -Wno-misleading-indentation"
	export CXXFLAGS="$CFLAGS -Wno-class-memaccess -Wno-changes-meaning"
	export PATH="/usr/lib/llvm${_llvmver}/bin:${PATH}" #1230
	export SHELL=/bin/sh
	export BUILD_OFFICIAL=1
	export MOZILLA_OFFICIAL=1
	export USE_SHORT_LIBNAME=1
	export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system

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

	export UNIXCONFDIR="$srcdir"

	./mach build
}

run() {
	cd "$builddir"/obj-$CHOST/dist/bin
	export LD_LIBRARY_PATH=.
	export PROFILE_DIR="$builddir"/obj-$CHOST/tmp/profile-default
	[ -d $PROFILE_DIR ] || ./thunderbird -no-remote -CreateProfile "Test $PROFILE_DIR"
	./thunderbird -no-remote -profile $PROFILE_DIR
}

package() {
	export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
	DESTDIR="$pkgdir" ./mach install

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

	for png in comm/mail/branding/thunderbird/default*.png; do
		local i="${_png%.png}"
		i=${i##*/default}
		install -D -m644 "$png" \
			"$pkgdir"/usr/share/icons/hicolor/${i}x${i}/apps/thunderbird.png
	done

	install -m644 "$builddir"/comm/mail/branding/thunderbird/default256.png \
		${pkgdir}/usr/share/pixmaps/thunderbird.png
	install -m644 ${startdir}/thunderbird.desktop \
		${pkgdir}/usr/share/applications/thunderbird.desktop
}

sha512sums="cda64afee45ae20a627116f9475cc4421262db40a7efa09eeafcb6e96f8fad97e8c96e2ecf04466ac4bce99fcebe0c3ce9953fa3fc4f5a92ab6f60e122f58c9a  thunderbird-128.1.0esr.source.tar.xz
fec4e343db973f90a38cc86e145c8ab0c8bec8f6eed36ff47f9986b154ea44f0e72ea1b5c9862e772505b3371dc0a9265fa1a6bed59007a5845a1dc622fce4e8  mozconfig
1fff71be77aa34791ef8aa972b5dc5f131d79f4b895ebbfb59bc223078764d6f79c82a3a4e4c717a3893ecbe4907d556f27e97d2692e41f02365f06da759a71a  bad-google-code.patch
5e6c3fa027052cc43ba161cf5c12016b07723e7c0b002a42431bbd5d716d512d5245ab6befbb56c37c7d244441533f810f4e7b583f83bbe965981931f1435a94  fix-mutex-build.patch
9f2892eff9d09f3eed1f9a9ee98ba9c6a6826c30ccdeabfefb8733abc98e7b612418827262423568e830c6354a2b8242f471bc200b7079f21862bb00947da716  fix-seccomp-bpf.patch
0a84e8cb6604fdb7601745b60c04ee74733632ada32bfd85eb32db8fee095cfb79c82033e5e3cf3bbc7b7f4df753e86ffe18e26e63a6603a93c3bb5a459aabd3  icu-75.patch
a2400c8df888637d9ebe33d82dc2fb95792685c9938b5486230a5c15bc819cbb850a2bdcb54a775516652fc8ffd6b40f8c591ab7941211f9516064101380ebbf  jpeg-link.patch
9f5730ee3a29b86786089abcfffab32bf2210f1a1ec43260ae824a08acda687dbfa37306b82a4978dd022bcf747eab155f7f3c5f73a1375f1c3c4fcd106dae3e  mozilla-build-arm.patch
1864c6c63c647f3ed1b3ca4df7f52a2c7ec4c65f2e067a9842d24a242f01e047d59ffbf88ad3740d830df1eb0bade929e245e640db135fe14f4c0d879269cb7e  pmmx-double-format.patch
06a3f4ee6d3726adf3460952fcbaaf24bb15ef8d15b3357fdd1766c7a62b00bd53a1e943b5df7f4e1a69f4fae0d44b64fae1e027d7812499c77894975969ea10  ppc32-fix.patch
e1c8a85c46a9cc804eb6b5946d35b63fa2cfc7ad8b4f250c5eaf1b590b139a66d9a833246bc26ae2e340fffb81b6761cf51c600181895bd49feb9a3b8fbfe331  rust-32bit.patch
c2248297df00633771da7e6b9f2caba3dd5108d93617f652fa8b2fb4e6975821e5fee866c00713f8fce08e760fa456e2dd19a8ef7370e5a2c65dc09614526be9  shut-up-warning.patch
11f7ce86376b54281082fa5b9d3fefee8046eabe38a0ec17266764b4f62cb90f4744245c1ca93d73ed74cf81c066dab7ddcb3fe9704be8f91e0a2a4f664b203a  skia-endian.patch
79c0ca37cbb6ebffe8d59d5955045cf2d8016c1f81d6cc8fceb1474849079b927c8163e9ca6ba4e88c27193e270aaba3ac76ea9dcf19c3be49322c6d049c903b  skia-unified.patch
9df89366bd51670f534591e4c169186703ad3166a493f522e58f129fb79af375d71baaf0f6b238126792118a2d3ed0f011b010e39497ab5901ee5bea63a84fa2  stackwalk-x86-ppc.patch
ebdc82ee06a0b649631758d9bb5a2c082e9e04dab06a633a7f0c00fad0fb6751d4b768f7ce3fe57f15e08144f26d91fc33229a1db87cdc683b37e1d0485ce76a  webrender.patch
ed78e15030d79b10026ebae26e44a68d16c2a8567082072b5099b0dde4f79ae217a21737e0d9c7ec6a3cc99de3ab3c9083cca7d82889d559bb18cc15fa7e6f2a  without-jit.patch
95a2b1deb4f6c90750fdd2bfe8ca0a7879a5b267965091705a6beb0a0a4b1ccad75d11df7b9885543ca4232ff704e975c6946f4c11804cb71c471e06f9576001  thunderbird.desktop"