blob: ce85bdf4db423438c8a1189eedfd7d7a20971d22 (
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
|
#!/bin/sh
NAME="thunderbird"
DESC="Thunderbird email client"
MAKEDEPS="make "
DEPS="atk botan cairo cairomm dbus-glib dbus ffmpeg4 fontconfig freetype2 gdk-pixbuf glib gtk3 icu json-c libevent libffi libvpx libwebp libx11 libxcb libxcomposite libxdamage libxext libxfixes libxrender musl nspr nss pango pixman zlib llvm "
PKG_VER=99.0b2
SOURCE="https://ftp.mozilla.org/pub/thunderbird/releases/$PKG_VER/source/thunderbird-$PKG_VER.source.tar.xz"
ADDITIONAL="vendor-prefs.js thunderbird.desktop stab.h sandbox-sched_setscheduler.patch sandbox-largefile.patch sandbox-fork.patch metainfo.patch mallinfo.patch fix-webrtc-glibcisms.patch fix-tools.patch fix-rust-target.patch fix-fortify-system-wrappers.patch distribution.ini disable-neon-in-aom.patch disable-moz-stackwalk.patch avoid-redefinition.patch allow-custom-rust-vendor.patch "
app_dir=/usr/lib/thunderbird
prepare () {
apply_patches
sed -i 's/\("files":{\)[^}]*/\1/' third_party/rust/audio_thread_priority/.cargo-checksum.json
sed -i 's/\("files":{\)[^}]*/\1/' third_party/rust/target-lexicon-0.9.0/.cargo-checksum.json
}
build () {
export SHELL=/bin/sh
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
export USE_SHORT_LIBNAME=1
export MACH_USE_SYSTEM_PYTHON=1
export MOZBUILD_STATE_PATH=$BUILD_ROOT/mozbuild
# Build with Clang, takes less RAM
export CC="clang"
export CXX="clang++"
export LDFLAGS="$LDFLAGS -Wl,-rpath,$app_dir"
./mach configure \
--prefix=/usr \
--disable-elf-hack \
--enable-rust-simd \
\
--disable-crashreporter \
--disable-install-strip \
--disable-jemalloc \
--disable-profiling \
--disable-strip \
--disable-tests \
--disable-updater \
\
--enable-alsa \
--enable-application=comm/mail \
--enable-dbus \
--enable-default-toolkit=cairo-gtk3-wayland \
--enable-ffmpeg \
--enable-hardening \
--enable-necko-wifi \
--enable-official-branding \
--enable-openpgp \
--enable-optimize="$CFLAGS -O2" \
--enable-pulseaudio \
--enable-release \
--enable-smoosh \
--enable-system-ffi \
--enable-system-pixman \
\
--with-system-botan \
--with-system-ffi \
--with-system-icu \
--with-system-jpeg \
--with-system-jsonc \
--with-system-libevent \
--with-system-libvpx \
--with-system-nspr \
--with-system-nss \
--with-system-pixman \
--with-system-webp \
--with-system-zlib \
--with-libclang-path=/usr/lib \
\
--with-unsigned-addon-scopes=app,system \
--without-wasm-sandboxed-libraries \
--allow-addon-sideload
#--disable-gold \
./mach build
}
package () {
DESTDIR="$PKG_DEST" ./mach install
local _png
for _png in "$BUILD_ROOT"/comm/mail/branding/thunderbird/default*.png; do
local i=${_png%.png}
i=${i##*/default}
install -Dm644 "$_png" "$PKG_DEST"/usr/share/icons/hicolor/"$i"x"$i"/apps/thunderbird.png
done
install -Dm644 "$BUILD_ROOT"/comm/mail/branding/thunderbird/TB-symbolic.svg \
"$PKG_DEST"/usr/share/icons/hicolor/symbolic/apps/thunderbird-symbolic.svg
install -Dm644 "$BUILD_ROOT"/comm/mail/branding/thunderbird/net.thunderbird.Thunderbird.appdata.xml \
-t "$PKG_DEST"/usr/share/metainfo
install -Dm644 "$BUILD_ROOT"/thunderbird.desktop \
-t "$PKG_DEST"/usr/share/applications
install -Dm644 "$BUILD_ROOT"/vendor-prefs.js \
-t "$PKG_DEST"/$app_dir/defaults/pref
install -Dm644 "$BUILD_ROOT"/distribution.ini \
-t "$PKG_DEST"/$app_dir/distribution
# Use system-provided dictionaries
ln -Tsfv /usr/share/hunspell "$PKG_DEST"/usr/lib/thunderbird/dictionaries
ln -Tsfv /usr/share/hyphen "$PKG_DEST"/usr/lib/thunderbird/hyphenation
# Replace duplicate binary with wrapper
# https://bugzilla.mozilla.org/show_bug.cgi?id=658850
install -Dm755 /dev/stdin "$PKG_DEST"/usr/bin/thunderbird <<- EOF
#!/bin/sh
exec /usr/lib/thunderbird/thunderbird "\$@"
EOF
rm "$PKG_DEST"/$app_dir/thunderbird-bin
ln -sfv /usr/bin/thunderbird "$PKG_DEST"/$app_dir/thunderbird-bin
}
|