1 # Description: The Mozilla Firefox browser
2 # URL: https://www.mozilla.com/firefox/
3 # Maintainer: Fredrik Rinnestam, fredrik at crux dot nu
4 # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
5 # Depends on: nss, unzip, autoconf-2.13, zip, libidl, gtk, gtk3, python, alsa-lib, xorg-libxt, yasm, mesa3d
10 source=(https://ftp.mozilla.org/pub/firefox/releases/$version/source/firefox-$version.source.tar.xz
11 firefox-install-dir.patch firefox.desktop)
16 # Fix to avoid gcc6 compilations error at install stage
17 export CFLAGS="$CFLAGS -fno-schedule-insns"
18 export CXXFLAGS="$CFLAGS"
21 sed -i 's@PYTHON ?= $(shell which python2.7 > /dev/null 2>&1 && echo python2.7 || echo python)@PYTHON := python -B@' \
24 sed -i '/^ftfntfmt.h/ i freetype/ftfntfmt.h' config/system-headers
26 sed -i '2,7d' js/src/configure
27 patch -p1 -i $SRC/firefox-install-dir.patch
29 cat <<- EOF > .mozconfig
30 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-shared
31 mk_add_options MOZ_MAKE_FLAGS="$MAKEFLAGS -s"
32 ac_add_options --prefix=/usr
33 ac_add_options --enable-default-toolkit=cairo-gtk3
34 ac_add_options --with-system-jpeg
35 ac_add_options --with-system-zlib
36 ac_add_options --with-system-png
37 ac_add_options --with-system-nspr
38 ac_add_options --with-system-nss
39 ac_add_options --with-system-cairo
40 ac_add_options --enable-system-ffi
41 ac_add_options --enable-system-pixman
42 ac_add_options --enable-system-sqlite
43 ac_add_options --enable-alsa
44 ac_add_options --with-pthreads
45 ac_add_options --enable-official-branding
46 ac_add_options --with-distribution-id=nu.crux-arm
47 ac_add_options --enable-extensions=default,-gnomevfs
48 ac_add_options --disable-tests
49 ac_add_options --disable-dbus
50 ac_add_options --disable-debug
51 ac_add_options --disable-updater
52 ac_add_options --disable-gnomeui
53 ac_add_options --disable-crashreporter
54 ac_add_options --disable-necko-wifi
55 ac_add_options --disable-pulseaudio
56 ac_add_options --disable-gconf
57 ac_add_options --disable-rust
58 ac_add_options --disable-optimize
61 #ac_add_options --disable-startupcache
62 # mozonfig optimizations
63 # for flag in $CFLAGS; do
65 # -mfpu=neon*) echo "ac_add_options --with-fpu=neon" >> .mozconfig ;;
66 # -march=armv7ve) echo "ac_add_options --with-arch=armv7ve" >> .mozconfig ;;
70 make -f client.mk build
71 make -f client.mk DESTDIR=$PKG install
73 mkdir -p $PKG/usr/share/pixmaps
74 ln -s /usr/lib/firefox/browser/chrome/icons/default/default48.png $PKG/usr/share/pixmaps/firefox_default48.png
75 install -D -m 0644 $SRC/firefox.desktop $PKG/usr/share/applications/firefox.desktop
77 rm $PKG/usr/lib/firefox/browser/features/{firefox@getpocket.com.xpi,webcompat@mozilla.org.xpi}
79 mkdir -p $PKG/etc/revdep.d
80 echo "/usr/lib/firefox" > $PKG/etc/revdep.d/firefox