2018-12-26 11:23:08 +01: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 04:11:48 +02: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 11:23:08 +01:00
|
|
|
# Optional: sccache
|
|
|
|
|
|
|
|
name=firefox
|
2020-05-10 04:11:48 +02:00
|
|
|
version=76.0.1
|
2020-05-05 15:17:53 +02:00
|
|
|
release=1
|
2018-12-26 11:23:08 +01:00
|
|
|
source=(https://ftp.mozilla.org/pub/firefox/releases/$version/source/firefox-$version.source.tar.xz
|
2020-04-10 06:53:10 +02:00
|
|
|
firefox.desktop
|
2020-05-01 15:43:38 +02:00
|
|
|
0001-Use-remoting-name-for-GDK-application-names.patch
|
2020-04-10 06:53:10 +02:00
|
|
|
fix-unicode-errors.patch)
|
2018-12-26 11:23:08 +01:00
|
|
|
|
|
|
|
build() {
|
|
|
|
cd firefox-$version
|
|
|
|
|
2020-05-01 15:43:38 +02:00
|
|
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=1530052
|
|
|
|
patch -p1 -i $SRC/0001-Use-remoting-name-for-GDK-application-names.patch
|
|
|
|
|
2020-04-10 06:53:10 +02:00
|
|
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=1532169
|
|
|
|
patch -p1 -i $SRC/fix-unicode-errors.patch
|
|
|
|
|
|
|
|
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 09:46:32 +01: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 06:53:10 +02:00
|
|
|
PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')
|
2019-12-29 09:46:32 +01:00
|
|
|
fi
|
|
|
|
|
2019-06-05 16:22:36 +02:00
|
|
|
prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
|
2019-12-29 09:46:32 +01:00
|
|
|
mkdir "$PKGMK_SOURCE_DIR/rust" || true
|
|
|
|
export CARGO_HOME="$PKGMK_SOURCE_DIR/rust"
|
2018-12-26 11:23:08 +01:00
|
|
|
|
|
|
|
cat <<- EOF > .mozconfig
|
|
|
|
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-shared
|
2019-09-07 05:31:43 +02:00
|
|
|
unset MOZ_TELEMETRY_REPORTING
|
2018-12-26 11:23:08 +01:00
|
|
|
ac_add_options --prefix=/usr
|
|
|
|
ac_add_options --enable-default-toolkit=cairo-gtk3
|
2019-02-15 09:56:43 +01:00
|
|
|
ac_add_options --enable-application=browser
|
2018-12-26 11:23:08 +01:00
|
|
|
ac_add_options --with-system-jpeg
|
|
|
|
ac_add_options --with-system-zlib
|
2019-02-15 09:56:43 +01:00
|
|
|
ac_add_options --with-system-bz2
|
2018-12-26 11:23:08 +01:00
|
|
|
ac_add_options --with-system-png
|
|
|
|
ac_add_options --with-system-nspr
|
|
|
|
ac_add_options --with-system-nss
|
2019-09-07 05:31:43 +02:00
|
|
|
ac_add_options --enable-av1
|
2018-12-26 11:23:08 +01:00
|
|
|
ac_add_options --enable-system-ffi
|
|
|
|
ac_add_options --enable-system-pixman
|
|
|
|
ac_add_options --enable-alsa
|
2019-02-15 09:56:43 +01:00
|
|
|
ac_add_options --enable-optimize
|
2020-05-01 15:43:38 +02:00
|
|
|
ac_add_options --enable-release
|
|
|
|
ac_add_options --enable-rust-simd
|
2019-09-07 05:31:43 +02:00
|
|
|
ac_add_options --disable-debug-symbols
|
2018-12-26 11:23:08 +01: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 04:11:48 +02:00
|
|
|
ac_add_options --enable-linker=lld
|
2018-12-26 11:23:08 +01: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
|
|
|
|
ac_add_options --disable-gconf
|
|
|
|
EOF
|
|
|
|
|
2020-04-10 06:53:10 +02:00
|
|
|
[[ -e '/usr/bin/ccache' ]] && echo 'ac_add_options --enable-ccache' >> .mozconfig
|
|
|
|
|
2019-02-15 09:56:43 +01:00
|
|
|
export CC=clang CXX=clang++ AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib
|
2018-12-26 11:23:08 +01:00
|
|
|
export MOZ_MAKE_FLAGS="-j ${JOBS-1}"
|
|
|
|
export MOZBUILD_STATE_PATH="$PKGMK_SOURCE_DIR/.mozbuild"
|
2020-04-10 06:53:10 +02:00
|
|
|
export MOZ_NOSPAM=1
|
2019-05-24 00:55:44 +02:00
|
|
|
|
2018-12-26 11:23:08 +01:00
|
|
|
./mach build
|
2019-02-15 09:56:43 +01:00
|
|
|
#./mach build toolkit/library/rust
|
2018-12-26 11:23:08 +01: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
|
|
|
|
}
|