# $Id: PKGBUILD 194549 2013-09-18 11:34:39Z foutrelis $ # Maintainer : Ionut Biru # Contributor: Jakub Schmidtke pkgname=firefox pkgver=24.0 pkgrel=1 pkgdesc="Standalone web browser from mozilla.org" arch=('i686' 'x86_64') license=('MPL' 'GPL' 'LGPL') url="https://www.mozilla.org/firefox/" depends=('gtk2' 'mozilla-common' 'libxt' 'startup-notification' 'mime-types' 'dbus-glib' 'alsa-lib' 'libvpx' 'libevent' 'nss' 'hunspell' 'sqlite' 'libnotify' 'desktop-file-utils' 'hicolor-icon-theme') makedepends=('unzip' 'zip' 'diffutils' 'python2' 'yasm' 'mesa' 'imake' 'xorg-server-xvfb' 'libpulse' 'gstreamer0.10-base') optdepends=('networkmanager: Location detection via available WiFi networks' 'gstreamer0.10-base-plugins: vorbis decoding, ogg demuxing' 'gstreamer0.10-bad-plugins: aac, vp8 and opus decoding' 'gstreamer0.10-good-plugins: webm and mp4 demuxing' 'gstreamer0.10-ugly-plugins: h.264 decoding' 'libpulse: PulseAudio audio driver') install=firefox.install options=('!emptydirs' '!makeflags') source=(https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.bz2 mozconfig firefox.desktop firefox-install-dir.patch vendor.js shared-libs.patch firefox-20.0.1-fixed-loading-icon.png) sha256sums=('86a6efa501e1b106b597a8506757f3a2db9d3a5cfcc61ea29a9ad0c834bea83b' 'ad0e3c2916076774a8f3b66b8d515a4b1403a2bc789215b5180892537283e4ac' 'd2a7610393ba259c35e3227b92e02ec91095a95189f56ac93ccdf6732772719c' 'ded67e8204bd5e1c0c5771c0d2c84ff80c998e1543711e7cd804cfe29e8dd1b0' '4b50e9aec03432e21b44d18c4c97b2630bace606b033f7d556c9d3e3eb0f4fa4' 'e2b4a00d14f4ba69c62b3f9ef9908263fbab179ba8004197cbc67edbd916fdf1' '68e3a5b47c6d175cc95b98b069a15205f027cab83af9e075818d38610feb6213') # 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 prepare() { cd mozilla-release # don't need # cp ../mozconfig .mozconfig # patch -Np1 -i ../firefox-install-dir.patch --with-default-mozilla-five-home # patch -Np1 -i ../shared-libs.patch --disable-pedantic --with-XXXX-prefix touch .mozconfig echo "ac_add_options --enable-application=browser" >> .mozconfig echo "ac_add_options --build=x86_64-pc-linux-gnu" >> .mozconfig echo "ac_add_options --target=x86_64-pc-linux-gnu" >> .mozconfig echo "ac_add_options --enable-optimize=-O2" >> .mozconfig #"-march=x86_64 -mtune=generic -02" here possible? echo "ac_add_options --prefix=/usr" >> .mozconfig echo "ac_add_options --libdir=/usr/lib" >> .mozconfig echo "ac_add_options --enable-official-branding" >> .mozconfig echo "ac_add_options --enable-extensions=default" >> .mozconfig echo "ac_add_options --disable-profilelocking" >> .mozconfig echo "ac_add_options --disable-pedantic" >> .mozconfig echo "ac_add_options --disable-tests" >> .mozconfig echo "ac_add_options --disable-debug" >> .mozconfig echo "ac_add_options --disable-debug-symbols" >> .mozconfig #makepkg strips? echo "ac_add_options --disable-strip" >> .mozconfig echo "ac_add_options --disable-install-strip" >> .mozconfig if [[ $CARCH == i686 ]]; then echo "ac_add_options --with-default-mozilla-five-home=/usr/lib/firefox" >> .mozconfig else echo "ac_add_options --with-default-mozilla-five-home=/usr/lib64/firefox" >> .mozconfig fi # System libraries echo "ac_add_options --with-system-nspr" >> .mozconfig echo "ac_add_options --with-nspr-prefix=/usr" >> .mozconfig #? echo "ac_add_options --with-system-nss" >> .mozconfig echo "ac_add_options --with-nss-prefix=/usr" >> .mozconfig #? echo "ac_add_options --with-system-jpeg" >> .mozconfig echo "ac_add_options --with-system-zlib" >> .mozconfig echo "ac_add_options --with-system-bz2" >> .mozconfig echo "ac_add_options --with-system-png" >> .mozconfig echo "ac_add_options --with-system-libevent" >> .mozconfig echo "ac_add_options --with-system-libvpx" >> .mozconfig echo "ac_add_options --enable-system-hunspell" >> .mozconfig echo "ac_add_options --enable-system-sqlite" >> .mozconfig echo "ac_add_options --enable-system-ffi" >> .mozconfig #echo "ac_add_options --enable-system-cairo" >> .mozconfig #need #echo "ac_add_options --enable-default-toolkit=cairo-gtk2" >> .mozconfig #need echo "ac_add_options --enable-system-pixman" >> .mozconfig #echo "ac_add_options --with-system-icu" >> .mozconfig #need #echo "ac_add_options --enable-intl-api" >> .mozconfig #need #echo "ac_add_options --enable-ion" >> .mozconfig #need #echo "ac_add_options --disable-gstreamer" >> .mozconfig #echo "ac_add_options --enable-pango" >> .mozconfig #need #echo "ac_add_options --disable-necko-wifi" >> .mozconfig #echo "ac_add_options --enable-ogg" >> .mozconfig #need #echo "ac_add_options --enable-wave " >> .mozconfig #need #echo "ac_add_options --x-includes=/usr/include" >> .mozconfig #need ? #echo "ac_add_options --x-libraries=/usr/lib64" >> .mozconfig #need ? #echo "ac_add_options --disable-dbus" >> .mozconfig #echo "ac_add_options --disable-gnomevfs" >> .mozconfig #echo "ac_add_options --disable-gnomeui" >> .mozconfig #echo "ac_add_options --enable-gio" >> .mozconfig #need #echo "ac_add_options --enable-jemalloc" >> .mozconfig #need #echo "ac_add_options --enable-replace-malloc" >> .mozconfig #need #echo "ac_add_options --disable-gconf" >> .mozconfig #echo "ac_add_options --disable-mailnews" >> .mozconfig echo "ac_add_options --enable-startup-notification" >> .mozconfig echo "ac_add_options --with-system-libevent=/usr" >> .mozconfig #? echo "ac_add_options --enable-pulseaudio" >> .mozconfig echo "ac_add_options --disable-crashreporter" >> .mozconfig echo "ac_add_options --disable-updater" >> .mozconfig echo "ac_add_options --disable-installer" >> .mozconfig # Fix PRE_RELEASE_SUFFIX # sed -i '/^PRE_RELEASE_SUFFIX := ""/s/ ""//' \ # browser/base/Makefile.in #mk_add_options BUILD_OFFICIAL=1 don't know if this works echo -n "$_google_api_key" >google-api-key echo "ac_add_options --with-google-api-keyfile=\"$PWD/google-api-key\"" >>.mozconfig mkdir "$srcdir/path" # WebRTC build tries to execute "python" and expects Python 2 #ln -s /usr/bin/python2 "$srcdir/path/python" # configure script misdetects the preprocessor without an optimization level # https://bugs.archlinux.org/task/34644 #sed -i '/ac_cpp=/s/$CPPFLAGS/& -O2/' configure # Fix tab loading icon (flickers with libpng 1.6) # https://bugzilla.mozilla.org/show_bug.cgi?id=841734 cp "$srcdir/firefox-20.0.1-fixed-loading-icon.png" \ browser/themes/linux/tabbrowser/loading.png } build() { cd mozilla-release export PATH="$srcdir/path:$PATH" # export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/lib/firefox" # export PYTHON="/usr/bin/python2" # if [[ $CARCH == i686 ]]; then # # Work around memory address space exhaustion during linking on i686 # LDFLAGS+=' -Wl,--no-keep-memory' # make -f client.mk build # fi #else # Arch supports PGO? gentoo needs a fix # http://forums.gentoo.org/viewtopic-t-820404-start-0.html # http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/www-client/firefox/firefox-24.0-r1.ebuild?view=markup # Set up PGO Profile #export DISPLAY=:99 #Xvfb -nolisten tcp -extension GLX -screen 0 1280x1024x24 $DISPLAY & #if ! make -f client.mk build MOZ_PGO=1; then # kill $! # return 1 #fi #kill $! || true #fi make -f client.mk build } package() { cd mozilla-release make -f client.mk DESTDIR="$pkgdir" install install -Dm644 ../vendor.js "$pkgdir/usr/lib/firefox/browser/defaults/preferences/vendor.js" 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/firefox.png" done install -Dm644 browser/branding/official/content/icon64.png \ "$pkgdir/usr/share/icons/hicolor/64x64/apps/firefox.png" install -Dm644 browser/branding/official/mozicon128.png \ "$pkgdir/usr/share/icons/hicolor/128x128/apps/firefox.png" install -Dm644 browser/branding/official/content/about-logo.png \ "$pkgdir/usr/share/icons/hicolor/192x192/apps/firefox.png" install -Dm644 browser/branding/official/content/about-logo@2x.png \ "$pkgdir/usr/share/icons/hicolor/384x384/apps/firefox.png" install -Dm644 ../firefox.desktop \ "$pkgdir/usr/share/applications/firefox.desktop" # Use system-provided dictionaries rm -rf "$pkgdir"/usr/lib/firefox/{dictionaries,hyphenation} ln -s /usr/share/hunspell "$pkgdir/usr/lib/firefox/dictionaries" ln -s /usr/share/hyphen "$pkgdir/usr/lib/firefox/hyphenation" # We don't want the development stuff rm -r "$pkgdir"/usr/{include,lib/firefox-devel,share/idl} #workaround for now #https://bugzilla.mozilla.org/show_bug.cgi?id=658850 ln -sf firefox "$pkgdir/usr/lib/firefox/firefox-bin" }