blob: f94fd0e7dd281d85ed4878357da356834ca12337 (
plain)
1 # Description: Email client from the Mozilla project
2 # URL: https://www.thunderbird.net/en-US/
3 # Maintainer: Danny Rawlins, crux at romster dot me
4 # Depends on: alsa-lib autoconf-2.13 cbindgen clang dbus-glib gnupg libevent libidl libnotify libvpx libwebp lld nodejs nss startup-notification unzip wasi-libc++ xorg-libxcomposite xorg-libxcursor zip
5 # Optional: sccache
6
7 name=thunderbird
8 version=102.6.1
9 release=1
10 source=(https://archive.mozilla.org/pub/thunderbird/releases/$version/source/$name-$version.source.tar.xz
11 $name.desktop)
12
13 build() {
14 cd $name-$version
15
16 if [ -e '/usr/bin/ccache' ]; then
17 export OS_CCACHE_COMPILERCHECK="$(/usr/bin/clang -dumpversion | sed -z 's/\n/ /g'; crux | cut -d' ' -f3)"
18 export CCACHE_COMPILERCHECK="string:$OS_CCACHE_COMPILERCHECK"
19 PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')
20 fi
21
22 prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
23 mkdir "$PKGMK_SOURCE_DIR/rust" || true
24 export CARGO_HOME="$PKGMK_SOURCE_DIR/rust"
25
26 sed -i '/ROOT_CLIP_CHAIN/d' gfx/webrender_bindings/webrender_ffi.h
27
28 cat <<- EOF > .mozconfig
29 ac_add_options --prefix=/usr
30 ac_add_options --enable-application=comm/mail
31 ac_add_options --with-system-jpeg
32 ac_add_options --with-system-zlib
33 ac_add_options --with-system-png
34 ac_add_options --with-system-nspr
35 ac_add_options --with-system-nss
36 ac_add_options --with-system-libevent
37 ac_add_options --with-system-libvpx
38 ac_add_options --with-system-webp
39 ac_add_options --enable-av1
40 ac_add_options --enable-system-ffi
41 ac_add_options --enable-system-pixman
42 ac_add_options --enable-optimize
43 ac_add_options --enable-linker=lld
44 ac_add_options --enable-lto=thin
45 ac_add_options --enable-release
46 ac_add_options --enable-rust-simd
47 ac_add_options --enable-official-branding
48 ac_add_options --with-distribution-id=nu.crux
49 ac_add_options --disable-debug
50 ac_add_options --disable-debug-symbols
51 ac_add_options --disable-tests
52 ac_add_options --disable-updater
53 ac_add_options --disable-crashreporter
54 ac_add_options --disable-necko-wifi
55 ac_add_options --disable-elf-hack
56 ac_add_options --without-wasm-sandboxed-libraries
57 EOF
58
59 # audio
60 prt-get isinst alsa-lib && echo 'ac_add_options --enable-audio-backends=alsa' >> .mozconfig
61 prt-get isinst pulseaudio && sed -i '/audio-backends/s/alsa/&,pulseaudio/' .mozconfig
62 #prt-get isinst jack && echo 'ac_add_options --enable-jack' >> .mozconfig || echo 'ac_add_options --disable-jack' >> .mozconfig
63
64 prt-get isinst wayland-protocols && \
65 echo 'ac_add_options --enable-default-toolkit=cairo-gtk3-wayland' >> .mozconfig || \
66 echo 'ac_add_options --enable-default-toolkit=cairo-gtk3' >> .mozconfig
67
68 [[ -e '/usr/bin/ccache' ]] && echo 'ac_add_options --enable-ccache' >> .mozconfig
69
70 export PYTHON=/usr/bin/python3
71 export RUSTFLAGS="$RUSTFLAGS -C debuginfo=0"
72 export CC=clang CXX=clang++ AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib
73 export MOZ_MAKE_FLAGS="-j ${JOBS-1}"
74 export MOZBUILD_STATE_PATH="$PKGMK_SOURCE_DIR/.mozbuild"
75
76 # Disable notification when build system has finished
77 export MOZ_NOSPAM=1
78
79 # Use system's Python environment
80 export MACH_USE_SYSTEM_PYTHON=1
81
82 # Show flags set at the beginning
83 echo "Current BINDGEN_CFLAGS:\t${BINDGEN_CFLAGS:-no value set}"
84 echo "Current CFLAGS:\t\t${CFLAGS:-no value set}"
85 echo "Current CXXFLAGS:\t\t${CXXFLAGS:-no value set}"
86 echo "Current LDFLAGS:\t\t${LDFLAGS:-no value set}"
87 echo "Current RUSTFLAGS:\t\t${RUSTFLAGS:-no value set}"
88
89 # python/mach/mach/mixin/process.py fails to detect SHELL
90 export SHELL='/usr/bin/bash'
91
92 ./mach build
93 DESTDIR=$PKG ./mach install
94
95 install -d $PKG/usr/share/pixmaps
96 ln -s /usr/lib/thunderbird/chrome/icons/default/default48.png $PKG/usr/share/pixmaps/thunderbird_default48.png
97 install -D -m 0644 $SRC/$name.desktop $PKG/usr/share/applications/$name.desktop
98
99 find $PKG -iname '*README*' -delete
100 #rm -r $PKG/usr/{include,lib/thunderbird-devel,share/idl}
101
102 install -d $PKG/etc/revdep.d
103 echo "/usr/lib/thunderbird" > $PKG/etc/revdep.d/$name
104 }
|