forked from void-linux/void-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate
More file actions
224 lines (187 loc) · 7.67 KB
/
template
File metadata and controls
224 lines (187 loc) · 7.67 KB
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
# Template file for 'thunderbird'
#
# THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/thunderbird-i18n".
#
pkgname=thunderbird
version=140.6.0
revision=1
build_helper="rust"
short_desc="Standalone Mail/News reader"
maintainer="classabbyamp <void@placeviolette.net>"
license="MPL-2.0, GPL-2.0-or-later, LGPL-2.1-or-later"
homepage="https://www.thunderbird.net/"
distfiles="${MOZILLA_SITE}/thunderbird/releases/${version}esr/source/thunderbird-${version}esr.source.tar.xz"
checksum=c5ff00249b032009f34486c927e0d6566ac9c5f0b1d036548b5a880d4bbbddc6
lib32disabled=yes
hostmakedepends="autoconf unzip zip pkg-config perl python3.11 yasm rust cargo
llvm clang nodejs cbindgen nasm which tar"
makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel libicu77-devel
pixman-devel libevent-devel libnotify-devel libvpx-devel
libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std
libXdamage-devel freetype-devel $(vopt_if alsa alsa-lib-devel)
$(vopt_if dbus dbus-glib-devel) $(vopt_if pulseaudio pulseaudio-devel)
$(vopt_if xscreensaver libXScrnSaver-devel)
$(vopt_if sndio sndio-devel) $(vopt_if jack jack-devel)"
depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme libotr"
build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland"
build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland"
case $XBPS_TARGET_MACHINE in
armv[56]*) broken="required NEON extensions are not supported on armv6" ;;
ppc64*) ;;
ppc*) broken="xptcall bitrot" ;;
esac
# try to minimize memory usage via debug symbols
# 'LLVM ERROR: out of memory' while compiling gtkrust
if [ "$XBPS_WORDSIZE" = "32" ]; then
nodebug=yes
fi
# 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
}
post_extract() {
case "$XBPS_TARGET_MACHINE" in
*-musl)
cp "${FILESDIR}/stab.h" toolkit/crashreporter/google-breakpad/src/
;;
esac
# Google API key (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: This is for Void Linux use ONLY.
echo -n "AIzaSyCIFdBA7eQP43R6kXRwTq7j6Mvj1ITze90" > google-api-key
# Mozilla API keys (see https://location.services.mozilla.com/api)
# Note: This is for Void Linux use ONLY.
echo -n "cd894504-7a2a-4263-abff-ff73ee89ffca" > mozilla-api-key
}
post_patch() {
_clear_vendor_checksums audio_thread_priority
_clear_vendor_checksums num-traits
_clear_vendor_checksums glslopt
_clear_vendor_checksums mp4parse
}
do_build() {
ln -sf "/usr/bin/python3.11" "${XBPS_WRAPPERDIR}/python3"
cp "${FILESDIR}/mozconfig" "${wrksrc}/.mozconfig"
echo "MOZ_APP_REMOTINGNAME=Thunderbird" >>.mozconfig
case "$XBPS_TARGET_MACHINE" in
*-musl)
echo "ac_add_options --disable-jemalloc" >>.mozconfig
echo "ac_add_options --enable-linker=bfd" >>.mozconfig
;;
esac
case "$XBPS_TARGET_MACHINE" in
x86_64*|i686*|arm*|aarch64*)
echo "ac_add_options --disable-elf-hack" >>.mozconfig
;;
esac
# third_party/libwebrtc/common_audio/wav_file.cc:93:2: error:
# #error "Need to convert samples to big-endian when reading from WAV file"
if [ "$XBPS_TARGET_ENDIAN" = "be" ]; then
echo "ac_add_options --disable-webrtc" >>.mozconfig
fi
# it seems mozilla has started catching up with google's webrtc
# and this newly involves introducing several megabytes of generated
# json junk that we just cannot maintain in-tree, additionally they
# have indicated that they will be re-generating these frequently
#
# it is unacceptable to keep a 7MB patch downstream, so disable it
#
# https://phabricator.services.mozilla.com/D134738
#
case "$XBPS_TARGET_MACHINE" in
ppc64le*|armv7l*) echo "ac_add_options --disable-webrtc" >>.mozconfig ;;
esac
if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
export LDFLAGS+=" -latomic"
fi
if [ "$CROSS_BUILD" ]; then
BINDGEN_INCLUDE_FLAGS=$( $CPP -x c++ -v /dev/null -o /dev/null 2>&1 | \
sed -n '/#include <...> search starts here:/,/End of search list./p' | \
sed '1,1d;$d' | sed 's/^ /-I/' | paste -s )
# fix compiler detection for botan:
# https://github.com/randombit/botan/blob/63d51cb1ab08849d8ece329811b61f8c9abebbcf/configure.py#L2888
export CXX="${XBPS_CROSS_TRIPLET}-g++"
export BINDGEN_CFLAGS="--target=$XBPS_CROSS_TRIPLET \
--sysroot=${XBPS_CROSS_BASE} ${BINDGEN_INCLUDE_FLAGS}"
export HOST_CC=cc
export TARGET_CC="${CC}"
export HOST_CFLAGS="${XBPS_CFLAGS}"
export HOST_CXXFLAGS="${XBPS_CXXFLAGS}"
export ac_cv_sqlite_secure_delete=yes \
ac_cv_sqlite_threadsafe=yes \
ac_cv_sqlite_enable_fts3=yes \
ac_cv_sqlite_dbstat_vtab=yes \
ac_cv_sqlite_enable_unlock_notify=yes \
ac_cv_prog_hostcxx_works=1
echo "ac_add_options --target=$XBPS_CROSS_TRIPLET" >>.mozconfig
echo "ac_add_options --host=$XBPS_TRIPLET" >>.mozconfig
else
echo "ac_add_options --target=$XBPS_TRIPLET" >>.mozconfig
echo "ac_add_options --host=$XBPS_TRIPLET" >>.mozconfig
fi
# XXX: wasi currently not ready
# echo "ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot" >>.mozconfig
echo "ac_add_options --without-wasm-sandboxed-libraries" >>.mozconfig
mkdir -p third_party/rust/libloading/.deps
case "$XBPS_TARGET_MACHINE" in
armv7*)
export CFLAGS+=" -mfpu=neon -Wno-psabi"
export CXXFLAGS+=" -mfpu=neon -Wno-psabi"
;;
esac
# work around large debug symbols on 32-bit hosts
if [ "$XBPS_WORDSIZE" = "32" ]; then
echo "ac_add_options --disable-debug-symbols" >>.mozconfig
echo "ac_add_options --disable-debug" >>.mozconfig
export LDFLAGS+=" -Wl,--no-keep-memory"
fi
# FIXME: incompatible with rust 1.48 in this release
#case "$XBPS_TARGET_MACHINE" in
#aarch64*|i686*|x86_64*)
# echo "ac_add_options --enable-rust-simd" >>.mozconfig ;;
#esac
echo "ac_add_options --disable-rust-simd" >>.mozconfig
export LDFLAGS+=" -Wl,-rpath=/usr/lib/thunderbird"
if [ "$SOURCE_DATE_EPOCH" ]; then
export MOZ_BUILD_DATE=$(date --date "@$SOURCE_DATE_EPOCH" "+%Y%m%d%H%M%S")
fi
export MOZ_MAKE_FLAGS="${makejobs}"
export MOZ_NOSPAM=1
export MOZBUILD_STATE_PATH="${wrksrc}/mozbuild"
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
export AS=$CC
cat <<! >>.mozconfig
ac_add_options --with-google-location-service-api-keyfile="${wrksrc}/google-api-key"
ac_add_options --with-google-safebrowsing-api-keyfile="${wrksrc}/google-api-key"
ac_add_options --with-mozilla-api-keyfile="${wrksrc}/mozilla-api-key"
ac_add_options $(vopt_enable alsa)
ac_add_options $(vopt_enable jack)
ac_add_options $(vopt_enable sndio)
ac_add_options $(vopt_enable dbus)
ac_add_options $(vopt_enable dbus necko-wifi)
ac_add_options $(vopt_enable pulseaudio)
ac_add_options --enable-default-toolkit=$(vopt_if wayland 'cairo-gtk3-wayland' 'cairo-gtk3')
!
rm -f old-configure
./mach build
}
do_install() {
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
export MOZBUILD_STATE_PATH="${wrksrc}/mozbuild"
DESTDIR="$DESTDIR" ./mach install
vinstall ${FILESDIR}/vendor.js 644 usr/lib/thunderbird/defaults/preferences
vinstall ${FILESDIR}/thunderbird.desktop 644 usr/share/applications
for i in 16x16 22x22 24x24 32x32 48x48 128x128 256x256; do
vinstall ${wrksrc}/comm/mail/branding/thunderbird/default${i%x*}.png 644 \
usr/share/icons/hicolor/${i}/apps thunderbird.png
done
# Use system-provided dictionaries
rm -rf ${DESTDIR}/usr/lib/thunderbird/{dictionaries,hyphenation}
ln -s /usr/share/hunspell ${DESTDIR}/usr/lib/thunderbird/dictionaries
ln -s /usr/share/hyphen ${DESTDIR}/usr/lib/thunderbird/hyphenation
# We don't want the development stuff
rm -rf ${DESTDIR}/usr/{include,lib/thunderbird-devel,share/idl}
# https://bugzilla.mozilla.org/show_bug.cgi?id=658850
ln -sf thunderbird ${DESTDIR}/usr/lib/thunderbird/thunderbird-bin
}