2018-12-26 21:23:08 +11:00
|
|
|
# Description: The Mozilla Firefox browser with Alsa support
|
|
|
|
# URL: https://www.mozilla.com/firefox/
|
|
|
|
# Maintainer: Danny Rawlins, crux at romster dot me
|
2020-05-10 12:11:48 +10:00
|
|
|
# Depends on: alsa-lib autoconf-2.13 cbindgen clang dbus-glib gtk libidl libnotify libxkbcommon lld nodejs nss unzip xorg-libxt yasm zip python
|
2018-12-26 21:23:08 +11:00
|
|
|
# Optional: sccache
|
|
|
|
|
|
|
|
name=firefox
|
2020-07-29 19:30:16 +10:00
|
|
|
version=79.0
|
2020-05-05 23:17:53 +10:00
|
|
|
release=1
|
2018-12-26 21:23:08 +11:00
|
|
|
source=(https://ftp.mozilla.org/pub/firefox/releases/$version/source/firefox-$version.source.tar.xz
|
2020-04-10 14:53:10 +10:00
|
|
|
firefox.desktop
|
2020-07-29 19:30:16 +10:00
|
|
|
0001-Use-remoting-name-for-GDK-application-names.patch
|
|
|
|
bug1654465.diff)
|
2020-06-07 10:44:45 +10:00
|
|
|
|
2018-12-26 21:23:08 +11:00
|
|
|
build() {
|
|
|
|
cd firefox-$version
|
|
|
|
|
2020-05-01 23:43:38 +10:00
|
|
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=1530052
|
|
|
|
patch -p1 -i $SRC/0001-Use-remoting-name-for-GDK-application-names.patch
|
|
|
|
|
2020-07-29 19:30:16 +10:00
|
|
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=1654465
|
|
|
|
patch -p1 -i $SRC/bug1654465.diff
|
|
|
|
|
2020-04-10 14:53:10 +10:00
|
|
|
if [ $(/usr/bin/python -c "import sys; print sys.stdout.encoding") = 'UTF-8' ]; then
|
|
|
|
printf "\e[031mError: set an UTF-8 locale to compile this!\033[0m\n"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-12-29 19:46:32 +11:00
|
|
|
if [ -e '/usr/bin/ccache' ]; then
|
|
|
|
export OS_CCACHE_COMPILERCHECK="$(/usr/bin/clang -dumpversion | sed -z 's/\n/ /g'; crux | cut -d' ' -f3)"
|
|
|
|
export CCACHE_COMPILERCHECK="string:$OS_CCACHE_COMPILERCHECK"
|
2020-04-10 14:53:10 +10:00
|
|
|
PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')
|
2019-12-29 19:46:32 +11:00
|
|
|
fi
|
|
|
|
|
2019-06-06 00:22:36 +10:00
|
|
|
prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
|
2019-12-29 19:46:32 +11:00
|
|
|
mkdir "$PKGMK_SOURCE_DIR/rust" || true
|
|
|
|
export CARGO_HOME="$PKGMK_SOURCE_DIR/rust"
|
2018-12-26 21:23:08 +11:00
|
|
|
|
|
|
|
cat <<- EOF > .mozconfig
|
|
|
|
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-shared
|
2019-09-07 13:31:43 +10:00
|
|
|
unset MOZ_TELEMETRY_REPORTING
|
2018-12-26 21:23:08 +11:00
|
|
|
ac_add_options --prefix=/usr
|
|
|
|
ac_add_options --enable-default-toolkit=cairo-gtk3
|
2019-02-15 19:56:43 +11:00
|
|
|
ac_add_options --enable-application=browser
|
2018-12-26 21:23:08 +11:00
|
|
|
ac_add_options --with-system-jpeg
|
|
|
|
ac_add_options --with-system-zlib
|
|
|
|
ac_add_options --with-system-png
|
|
|
|
ac_add_options --with-system-nspr
|
|
|
|
ac_add_options --with-system-nss
|
2019-09-07 13:31:43 +10:00
|
|
|
ac_add_options --enable-av1
|
2018-12-26 21:23:08 +11:00
|
|
|
ac_add_options --enable-system-ffi
|
|
|
|
ac_add_options --enable-system-pixman
|
|
|
|
ac_add_options --enable-alsa
|
2019-02-15 19:56:43 +11:00
|
|
|
ac_add_options --enable-optimize
|
2020-05-01 23:43:38 +10:00
|
|
|
ac_add_options --enable-release
|
|
|
|
ac_add_options --enable-rust-simd
|
2019-09-07 13:31:43 +10:00
|
|
|
ac_add_options --disable-debug-symbols
|
2018-12-26 21:23:08 +11:00
|
|
|
ac_add_options --disable-pulseaudio
|
|
|
|
ac_add_options --enable-official-branding
|
|
|
|
ac_add_options --with-distribution-id=nu.crux
|
|
|
|
ac_add_options --enable-extensions=default,-gnomevfs
|
2020-05-10 12:11:48 +10:00
|
|
|
ac_add_options --enable-linker=lld
|
2018-12-26 21:23:08 +11:00
|
|
|
ac_add_options --disable-tests
|
|
|
|
ac_add_options --disable-debug
|
|
|
|
ac_add_options --disable-updater
|
|
|
|
ac_add_options --disable-crashreporter
|
|
|
|
ac_add_options --disable-necko-wifi
|
|
|
|
EOF
|
|
|
|
|
2020-04-10 14:53:10 +10:00
|
|
|
[[ -e '/usr/bin/ccache' ]] && echo 'ac_add_options --enable-ccache' >> .mozconfig
|
|
|
|
|
2019-02-15 19:56:43 +11:00
|
|
|
export CC=clang CXX=clang++ AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib
|
2018-12-26 21:23:08 +11:00
|
|
|
export MOZ_MAKE_FLAGS="-j ${JOBS-1}"
|
|
|
|
export MOZBUILD_STATE_PATH="$PKGMK_SOURCE_DIR/.mozbuild"
|
2020-04-10 14:53:10 +10:00
|
|
|
export MOZ_NOSPAM=1
|
2019-05-24 08:55:44 +10:00
|
|
|
|
2018-12-26 21:23:08 +11:00
|
|
|
./mach build
|
2019-02-15 19:56:43 +11:00
|
|
|
#./mach build toolkit/library/rust
|
2018-12-26 21:23:08 +11:00
|
|
|
DESTDIR=$PKG ./mach install
|
|
|
|
|
|
|
|
install -d $PKG/usr/share/pixmaps
|
|
|
|
ln -s /usr/lib/firefox/browser/chrome/icons/default/default48.png $PKG/usr/share/pixmaps/firefox_default48.png
|
|
|
|
install -D -m 0644 $SRC/firefox.desktop $PKG/usr/share/applications/firefox.desktop
|
|
|
|
# Remove crap
|
|
|
|
rm -r $PKG/usr/lib/firefox/browser/features
|
|
|
|
rm $PKG/usr/lib/firefox/removed-files
|
|
|
|
|
|
|
|
install -d $PKG/etc/revdep.d
|
|
|
|
echo "/usr/lib/firefox" > $PKG/etc/revdep.d/firefox
|
|
|
|
}
|