diff options
author | Jonas Heinrich | 2018-03-09 16:10:49 +0100 |
---|---|---|
committer | Jonas Heinrich | 2018-03-09 16:10:49 +0100 |
commit | 113079bbe4301815f85fc85c81ac43bca4023a4d (patch) | |
tree | 72b8aff1186761b332b3b842bd7d4febdc9016bb /PKGBUILD | |
download | aur-113079bbe4301815f85fc85c81ac43bca4023a4d.tar.gz |
first commit
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 201 |
1 files changed, 201 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c53c5dba5886 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,201 @@ +# Maintainer: Jonas Heinrich <onny@project-insanity.org> +# Contributor: Jonas Heinrich <onny@project-insanity.org> +# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> +# Contributor: Ionut Biru <ibiru@archlinux.org> +# Contributor: Jakub Schmidtke <sjakub@gmail.com> + +pkgname=firefox-wayland-hg +_pkgname=firefox +pkgver=r407109+.a6a32fb286fa+ +pkgrel=1 +pkgdesc="Standalone web browser from mozilla.org" +arch=(x86_64) +license=(MPL GPL LGPL) +url="https://www.mozilla.org/firefox/" +depends=(gtk3 gtk2 mozilla-common libxt startup-notification mime-types dbus-glib ffmpeg + nss hunspell sqlite ttf-font libpulse libvpx icu) +makedepends=(unzip zip diffutils python2 yasm mesa imake gconf inetutils xorg-server-xvfb + autoconf2.13 rust mercurial clang llvm jack) +optdepends=('networkmanager: Location detection via available WiFi networks' + 'libnotify: Notification integration' + 'pulseaudio: Audio support' + 'speech-dispatcher: Text-to-Speech') +options=(!emptydirs !makeflags !strip) +_repo=https://hg.mozilla.org/mozilla-unified +conflicts=('firefox') +provides=('firefox') +source=('mozilla-unified::hg+https://hg.mozilla.org/mozilla-central/' + firefox.desktop firefox-symbolic.svg + 0001-Bug-1430274-Define-MOZ_ALSA-for-more-source-files.-r.patch + firefox-install-dir.patch no-crmf.diff) +sha256sums=('SKIP' + '677e1bde4c6b3cff114345c211805c7c43085038ca0505718a11e96432e9811a' + '9a1a572dc88014882d54ba2d3079a1cf5b28fa03c5976ed2cb763c93dabbd797' + 'e8a695bd6a007525390c502739c0f00d5d753a1bde7053c21c712075f2c2994d' + 'a94f80abe65608cd49054a30acc31e4d0885fe5b2a38cf08ded5e5b51b87c99d' + 'fb85a538044c15471c12cf561d6aa74570f8de7b054a7063ef88ee1bdfc1ccbb') + +# 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 + +pkgver() { + cd mozilla-unified + printf "r%s.%s" "$(hg identify -n)" "$(hg identify -i)" +} + +prepare() { + mkdir -p path + ln -sf /usr/bin/python2 path/python + + cd mozilla-unified + # patch -Np1 -i ../firefox-install-dir.patch + + # https://bugs.archlinux.org/task/57285 + # patch -Np1 -i ../0001-Bug-1430274-Define-MOZ_ALSA-for-more-source-files.-r.patch + + # https://bugzilla.mozilla.org/show_bug.cgi?id=1371991 + patch -Np1 -i ../no-crmf.diff + + echo -n "$_google_api_key" >google-api-key + echo -n "$_mozilla_api_key" >mozilla-api-key + + cat >.mozconfig <<END +ac_add_options --enable-application=browser + +ac_add_options --prefix=/usr +ac_add_options --enable-release +ac_add_options --enable-gold +ac_add_options --enable-pie +ac_add_options --enable-optimize="-O2" +ac_add_options --enable-rust-simd + +# Branding +ac_add_options --enable-official-branding +ac_add_options --enable-update-channel=release +ac_add_options --with-distribution-id=org.archlinux +export MOZILLA_OFFICIAL=1 +export MOZ_TELEMETRY_REPORTING=1 +export MOZ_ADDON_SIGNING=1 +export MOZ_REQUIRE_SIGNING=1 + +# Keys +ac_add_options --with-google-api-keyfile=${PWD@Q}/google-api-key +ac_add_options --with-mozilla-api-keyfile=${PWD@Q}/mozilla-api-key + +# System libraries +ac_add_options --with-system-zlib +ac_add_options --with-system-bz2 +ac_add_options --with-system-icu +ac_add_options --with-system-jpeg +ac_add_options --with-system-libvpx +ac_add_options --with-system-nspr +ac_add_options --with-system-nss +ac_add_options --enable-system-hunspell +ac_add_options --enable-system-sqlite +ac_add_options --enable-system-ffi + +# Features +ac_add_options --enable-alsa +ac_add_options --enable-jack +ac_add_options --enable-startup-notification +ac_add_options --enable-crashreporter +ac_add_options --disable-updater +ac_add_options --enable-default-toolkit=cairo-gtk3-wayland +#ac_add_options --with-gl-provider=EGL +#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-wayland +END +} + +build() { + cd mozilla-unified + + # _FORTIFY_SOURCE causes configure failures + CPPFLAGS+=" -O2" + + export PATH="$srcdir/path:$PATH" + export MOZ_SOURCE_REPO="$_repo" + + # Do PGO + #xvfb-run -a -n 95 -s "-extension GLX -screen 0 1280x1024x24" \ + # MOZ_PGO=1 ./mach build + ./mach build + ./mach buildsymbols +} + +package() { + cd mozilla-unified + DESTDIR="$pkgdir" ./mach install + find . -name '*crashreporter-symbols-full.zip' -exec cp -fvt "$startdir" {} + + + _vendorjs="$pkgdir/usr/lib/$_pkgname/browser/defaults/preferences/vendor.js" + install -Dm644 /dev/stdin "$_vendorjs" <<END +// 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); + +// Opt all of us into e10s, instead of just 50% +pref("browser.tabs.remote.autostart", true); +END + + _distini="$pkgdir/usr/lib/$_pkgname/distribution/distribution.ini" + install -Dm644 /dev/stdin "$_distini" <<END +[Global] +id=archlinux +version=1.0 +about=Mozilla Firefox for Arch Linux + +[Preferences] +app.distributor=archlinux +app.distributor.channel=$_pkgname +app.partner.archlinux=archlinux +END + + for i in 16 22 24 32 48 256; do + install -Dm644 browser/branding/official/default$i.png \ + "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$_pkgname.png" + done + #install -Dm644 browser/branding/official/content/icon64.png \ + # "$pkgdir/usr/share/icons/hicolor/64x64/apps/$_pkgname.png" + #install -Dm644 browser/branding/official/mozicon128.png \ + # "$pkgdir/usr/share/icons/hicolor/128x128/apps/$_pkgname.png" + #install -Dm644 browser/branding/official/content/about-logo.png \ + # "$pkgdir/usr/share/icons/hicolor/192x192/apps/$_pkgname.png" + #install -Dm644 browser/branding/official/content/about-logo@2x.png \ + # "$pkgdir/usr/share/icons/hicolor/384x384/apps/$_pkgname.png" + install -Dm644 ../firefox-symbolic.svg \ + "$pkgdir/usr/share/icons/hicolor/symbolic/apps/$_pkgname-symbolic.svg" + + install -Dm644 ../$_pkgname.desktop \ + "$pkgdir/usr/share/applications/$_pkgname.desktop" + + # Use system-provided dictionaries + rm -r "$pkgdir"/usr/lib/$_pkgname/dictionaries + ln -fTs /usr/share/hunspell "$pkgdir/usr/lib/$_pkgname/dictionaries" + ln -fTs /usr/share/hyphen "$pkgdir/usr/lib/$_pkgname/hyphenation" + + # Install a wrapper to avoid confusion about binary path + install -Dm755 /dev/stdin "$pkgdir/usr/bin/$_pkgname" <<END +#!/bin/sh +exec /usr/lib/$_pkgname/firefox "\$@" +END + + # Replace duplicate binary with wrapper + # https://bugzilla.mozilla.org/show_bug.cgi?id=658850 + ln -srf "$pkgdir/usr/bin/$_pkgname" \ + "$pkgdir/usr/lib/$_pkgname/firefox-bin" +} |