# Contributor: Joseph Benden # Maintainer: Joseph Benden pkgname=thunderbird pkgver=60.9.0 _pkgver=$pkgver _xulver=$pkgver pkgrel=0 pkgdesc="Thunderbird email client" url="https://www.thunderbird.net/" arch="x86_64" 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 libvpx-dev libxcomposite-dev libxt-dev llvm-dev mesa-dev nasm nodejs nspr-dev nss-dev nss-static paxmark 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 fix-fortify-system-wrappers.patch fix-fortify-inline.patch fix-seccomp-bpf.patch fix-toolkit.patch fix-tools.patch mallinfo.patch mozilla-build-arm.patch disable-moz-stackwalk.patch fix-rust-target.patch fix-bug-1261392.patch fix-webrtc-glibcisms.patch sandbox-membarrier.patch rust-unitialized-field.patch rust133.patch 0003-Disable-ccache-stats.patch rust-cssparser.patch thunderbird.desktop " _mozappdir=/usr/lib/$pkgname # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) # Note: These are for Arch Linux use ONLY. For your own distribution, please # get your own set of keys. Feel free to contact foutrelis@archlinux.org for # more information. _google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM # Mozilla API keys (see https://location.services.mozilla.com/api) # Note: These are for Arch Linux use ONLY. For your own distribution, please # get your own set of keys. Feel free to contact heftig@archlinux.org for # more information. _mozilla_api_key=16674381-f021-49de-8622-3021c5942aff # 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 # add API keys echo -n "${_google_api_key}" > $builddir/objdir/google-api-key echo -n "${_mozilla_api_key}" > $builddir/objdir/mozilla-api-key _clear_vendor_checksums cssparser } build() { 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" ../mach configure \ --prefix=/usr \ --libdir=/usr/lib \ \ --disable-crashreporter \ --disable-elf-hack \ --disable-gold \ --enable-install-strip \ --disable-jemalloc \ --disable-profiling \ --disable-pulseaudio \ --enable-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 -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 \ \ --with-google-location-service-api-keyfile="${builddir}/objdir/google-api-key" \ --with-google-safebrowsing-api-keyfile="${builddir}/objdir/google-api-key" \ --with-mozilla-api-keyfile="${builddir}/objdir/mozilla-api-key" \ \ --with-system-bz2 \ --with-system-hunspell \ --with-system-icu \ --with-system-jpeg \ --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 #--with-system-libvpx # requires 1.7x to work, we've got 1.8.0 currently ../mach build -v } 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 # thunderbird currently does not work with mprotect. disable it for now local paxflags="-mp" [ "$CARCH" = "x86" ] && paxflags="-msp" paxmark "$paxflags" "$pkgdir"/$_mozappdir/thunderbird-bin paxmark "$paxflags" "$pkgdir"/$_mozappdir/plugin-container paxmark "$paxflags" "$pkgdir"/$_mozappdir/pingsender _vendorjs="$pkgdir/usr/lib/$pkgname/defaults/preferences/vendor.js" install -Dm644 /dev/stdin "$_vendorjs" <