# Contributor: Joseph Benden # Maintainer: Joseph Benden pkgname=thunderbird pkgver=68.2.2 _pkgver=$pkgver _xulver=$pkgver pkgrel=1 pkgdesc="Thunderbird email client" url="https://www.thunderbird.net/" arch="x86_64 aarch64" # limited by rust and cargo 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 libxcomposite-dev libxt-dev llvm9-dev mesa-dev nasm nodejs nspr-dev nss-dev nss-static python2 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 disable-ccache-stats.patch fix-fortify-system-wrappers.patch fix-seccomp-bpf.patch fix-toolkit.patch fix-tools.patch mallinfo.patch disable-moz-stackwalk.patch fix-musl.patch fix-rust-target.patch fix-webrtc-glibcisms.patch fix-sandbox-membarrier.patch thunderbird.desktop " _mozappdir=/usr/lib/$pkgname # 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 _clear_vendor_checksums cssparser } build() { mkdir -p "$builddir"/objdir 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" case "$CARCH" in x86_64) # disable-elf-hack: exists only on arm, x86, x86_64 _arch_config="--disable-elf-hack" export RUST_TARGET="$CTARGET" ;; aarch64) export RUST_TARGET="aarch64-unknown-linux-musl" ;; esac ../configure \ --prefix=/usr \ --libdir=/usr/lib \ $_arch_config \ \ --disable-crashreporter \ --disable-gold \ --disable-install-strip \ --disable-jemalloc \ --disable-profiling \ --disable-pulseaudio \ --disable-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 -O2 -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 \ --enable-rust-simd \ \ --with-system-bz2 \ --with-system-icu \ --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 # FIXME: fix build with --with-system-libvpx and libvpx 1.8.0 # https://bugzilla.mozilla.org/show_bug.cgi?id=1525393 make } 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 _vendorjs="$pkgdir/usr/lib/$pkgname/defaults/preferences/vendor.js" install -Dm644 /dev/stdin "$_vendorjs" <