# Contributor: # Maintainer: Natanael Copa pkgname=firefox pkgver=66.0.5 _pkgver=$pkgver _xulver=$pkgver pkgrel=1 pkgdesc="Firefox web browser" url="https://www.firefox.com/" # limited by rust and cargo arch="x86_64" license="GPL LGPL MPL" depends="" 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 libxt-dev libxcomposite-dev llvm5-dev mesa-dev nasm nodejs nspr-dev nss-dev>=3.26 nss-static paxmark python3-dev sqlite-dev sed startup-notification-dev wireless-tools-dev yasm zip " install="" source="https://ftp.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$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 firefox.desktop firefox-safe.desktop" builddir="${srcdir}/firefox-$pkgver" _mozappdir=/usr/lib/firefox # help our shared-object scanner to find the libs ldpath="$_mozappdir" 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 } 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 # 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}" ../configure \ --prefix=/usr \ \ --disable-crashreporter \ --disable-elf-hack \ --disable-gold \ --disable-install-strip \ --disable-jemalloc \ --disable-profiling \ --disable-pulseaudio \ --disable-strip \ --disable-tests \ --disable-updater \ \ --enable-alsa \ --enable-default-toolkit=cairo-gtk3 \ --enable-official-branding \ --enable-optimize="$CFLAGS -O2" \ --enable-startup-notification \ --enable-system-ffi \ --enable-system-sqlite \ --enable-ffmpeg \ --enable-hardening \ \ --with-system-bz2 \ --with-system-icu \ --with-system-libevent \ --with-system-nspr \ --with-system-nss \ --with-system-pixman \ --with-system-png \ --with-system-zlib \ --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 # paxmark outside fakeroot paxmark -msp dist/bin/xpcshell } package() { cd "$builddir"/objdir # only used for startupcache creation. local paxflags="-msp" paxmark "$paxflags" dist/bin/xpcshell make install \ DESTDIR="$pkgdir" \ MOZ_MAKE_FLAGS="$MAKEOPTS" install -m755 -d ${pkgdir}/usr/share/applications install -m755 -d ${pkgdir}/usr/share/pixmaps local png for png in ../browser/branding/official/default*.png; do local i=${_png%.png} i=${i##*/default} install -D -m644 "$png" "$pkgdir"/usr/share/icons/hicolor/${i}x${i}/apps/firefox.png done install -m644 "$builddir"/browser/branding/official/default48.png \ ${pkgdir}/usr/share/pixmaps/firefox.png install -m644 ${srcdir}/firefox.desktop ${pkgdir}/usr/share/applications/firefox.desktop install -m644 ${srcdir}/firefox-safe.desktop ${pkgdir}/usr/share/applications/firefox-safe.desktop # firefox currently does not work with mprotect. disable it for now local paxflags="-mp" [ "$CARCH" = "x86" ] && paxflags="-msp" paxmark "$paxflags" "$pkgdir"/$_mozappdir/firefox paxmark "$paxflags" "$pkgdir"/$_mozappdir/plugin-container # xulrunner stub launcher has changed to using a symlink overlay... # go figure ln -sf /usr/lib/xulrunner-${_xulver} ${pkgdir}/$_mozappdir/xulrunner # launcher as symlink is broken from firefox-7.0 rm "$pkgdir"/usr/bin/firefox libgl=$(scanelf -qF '#F%S' /usr/lib/libGL.so) cat > "$pkgdir"/usr/bin/firefox << __EOF__ #!/bin/sh exec $_mozappdir/firefox "\$@" __EOF__ chmod 755 "$pkgdir"/usr/bin/firefox # install our vendor prefs install -d "$pkgdir"/$_mozappdir/browser/defaults/preferences cat >> "$pkgdir"/$_mozappdir/browser/defaults/preferences/firefox-branding.js <<- EOF // Use LANG environment variable to choose locale pref("intl.locale.matchOS", true); // Disable default browser checking. pref("browser.shell.checkDefaultBrowser", false); // Don't disable our bundled extensions in the application directory pref("extensions.autoDisableScopes", 11); pref("extensions.shownSelectionUI", true); EOF # remove copied, huge, libraries rm -f "$pkgdir"/${_mozappdirdev}/sdk/lib/libmozjs.so rm -f "$pkgdir"/${_mozappdirdev}/sdk/lib/libmozalloc.so rm -f "$pkgdir"/${_mozappdirdev}/sdk/lib/libxul.so } sha512sums="6e62e7bb95a7341471521c372506d9df276249d0c0863d059b0bd27537cddb1060c51f0ee103f79239226d34c6277f3855e1511a083bc4cc442718fc7c5db650 firefox-66.0.5.source.tar.xz 0b3f1e4b9fdc868e4738b5c81fd6c6128ce8885b260affcb9a65ff9d164d7232626ce1291aaea70132b3e3124f5e13fef4d39326b8e7173e362a823722a85127 stab.h 2f4f15974d52de4bb273b62a332d13620945d284bbc6fe6bd0a1f58ff7388443bc1d3bf9c82cc31a8527aad92b0cd3a1bc41d0af5e1800e0dcbd7033e58ffd71 fix-fortify-system-wrappers.patch 09bc32cf9ee81b9cc6bb58ddbc66e6cc5c344badff8de3435cde5848e5a451e0172153231db85c2385ff05b5d9c20760cb18e4138dfc99060a9e960de2befbd5 fix-fortify-inline.patch 183a4ef62cd79728117797235fe46ecd3e4336c008d615c2b2a64c707477e403aed1ee5e19feb86611b93ebecc00df339aa28a73735e045e38f0d1ce3080341b fix-seccomp-bpf.patch ded76edfbc43637cd2e73100ea2244f97d95d452af61b9cd4f2db341cb0dbae8a5e846edeb4eafbe47dc1d30724869407d188e42b06518c67c4701745ea9adfa fix-toolkit.patch 48683964624bb58b5a2a2a5c89da56e3b8dcd04f8d42c6910bea5365010a77d6d82bdd48259774ca54341edc05b6768eaa6aa1b453718c02f760361197e78b52 fix-tools.patch 4ea267fbe395ed8865f3ec18dd129d1c78cdbf23983a9c6c9e70b0536cdf2de8953e36444a10dfbdbd522a638fd90a6a51b2f7d5396ef6c98084ddd1ea34d0ff mallinfo.patch 3671bf7623c1825c977668efec62b57873bc6052becfd8a68ddcbc2d0ba96e0c3966c61b24716e6c48167d44280d3e690a4ff986907ceba5811a653e87770fff mozilla-build-arm.patch 019ab248a050bef305637dc4229596c06d9596879bbb1db985b96c5a680211996d714d4a1f6e9a66544cc4562a80364b1ee37ecf7964eb974ffef2566c5c2986 disable-moz-stackwalk.patch 42cc44fda4b05259b38f055d6f51461746aa89a474cedc5e92fb9d20879da0d12b1b515b273a549e7302cda9c7eddde20d5fdba09853e5c658784ad6d0b20078 fix-rust-target.patch 8b776f0da8dfad0ae81670623fa55ddcff91b78a1a569bb5e6b5f5130392249dfbebe84752c846c8aa5b4878643f0369cd7d9bfaf2b9dd0c841af302dcb48896 fix-bug-1261392.patch 40768d2458adb87fc15ad17b430cf0bebabde583910e55624bf282d4a69b3f9b9165289a7a9c2b50bfb9de1a16e2546f8d0b5ce33c1920000cffb588410b9e9e fix-webrtc-glibcisms.patch e725a6e9b2361cd566ae2f90861dbce9f2231f16721ec02f4b9f9986b7dc82cc006ea6a500ae7f30c095ce746132a5bd1d9532c4cf0d1541dcc672a20aef8807 sandbox-membarrier.patch f3b7c3e804ce04731012a46cb9e9a6b0769e3772aef9c0a4a8c7520b030fdf6cd703d5e9ff49275f14b7d738fe82a0a4fde3bc3219dff7225d5db0e274987454 firefox.desktop 5dcb6288d0444a8a471d669bbaf61cdb1433663eff38b72ee5e980843f5fc07d0d60c91627a2c1159215d0ad77ae3f115dcc5fdfe87e64ca704b641aceaa44ed firefox-safe.desktop"