solus-packages/packages/f/firefox/package.yml
Reilly Brogan c32bca49d0
firefox: Rebuild for unstable
Signed-off-by: Reilly Brogan <reilly@reillybrogan.com>
2024-03-24 20:49:13 -05:00

145 lines
5.9 KiB
YAML

name : firefox
version : 124.0.1
release : 310
source :
- https://ftp.mozilla.org/pub/firefox/releases/124.0.1/source/firefox-124.0.1.source.tar.xz : ddac16aea855e057ff6be3c143f7155cc20f452e1f45eb6288ff27e9346ab843
- https://sources.getsol.us/mozilla/firefox/firefox-124.0.1-langpacks.tar.zst : e56bcbc1e0c7518ccec7dbfe2649ecd53a204fb302e9ede95a7757d3bfa8211c
homepage : https://www.mozilla.org/firefox/
license :
- GPL-2.0-or-later
- MPL-2.0
component : network.web.browser
summary : Firefox web browser
description: |
Mozilla Firefox is an open-source web browser, designed for standards compliance, performance and portability. Its functionality can be enhanced via a plethora of extensions.
clang : yes
optimize : icf-safe
builddeps :
- pkgconfig(alsa)
# Temporarily disabled until Fedora patch is updated
# - pkgconfig(aom)
- pkgconfig(bzip2)
# Temporarily disabled until Fedora patch is updated
# - pkgconfig(dav1d)
- pkgconfig(dbus-glib-1)
- pkgconfig(gbm)
- pkgconfig(gconf-2.0)
- pkgconfig(gtk+-2.0)
- pkgconfig(gtk+-3.0)
- pkgconfig(libevent)
- pkgconfig(libffi)
- pkgconfig(libpci)
- pkgconfig(libpulse)
- pkgconfig(libturbojpeg)
- pkgconfig(libva)
- pkgconfig(libwebp)
- pkgconfig(nspr)
- pkgconfig(nss)
- pkgconfig(pixman-1)
- pkgconfig(vpx)
- pkgconfig(vulkan)
- pkgconfig(xcomposite)
- pkgconfig(xt)
- autoconf213
- cargo
- cbindgen
- dump_syms
- llvm-clang
- nodejs-devel
- noto-sans-ttf
- xorg-server-xvfb
- yasm
rundeps :
- ffmpeg
environment: |
export MOZ_NOSPAM=1
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
export MOZBUILD_STATE_PATH=$PWD
export MOZ_BUILD_DATE="$(date -u${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH} +%Y%m%d%H%M%S)"
setup : |
%patch -p1 -i $pkgfiles/firefox-enable-vaapi.patch
# Temporarily disabled until Fedora patch is updated
# %patch -p1 -i $pkgfiles/bmo-1559213-Support-system-av1.patch
# %patch -p1 -i $pkgfiles/bmo-1559213-fix-system-av1-libs.patch
%patch -p1 -i $pkgfiles/icu74.patch
cp $pkgfiles/{google-safebrowsing,mozilla}-api-key .
cp $pkgfiles/config .mozconfig
sed 's@\#\#JOBCOUNT\#\#@%JOBS%@' -i .mozconfig
echo "ac_add_options --with-mozilla-api-keyfile=${workdir}/mozilla-api-key" >> .mozconfig
echo "ac_add_options --with-google-safebrowsing-api-keyfile=${workdir}/google-safebrowsing-api-key" >> .mozconfig
./mach configure
build : |
# Set this to 0 if you want to create a release build, 1 if you're just doing builds locally for testing purposes
# Note that you still need to do a full release build locally and test it before pushing it
FULL_BUILD=0
if [ $FULL_BUILD -ne 0 ]; then
./mach build
else
# Instrument build
echo "ac_add_options --enable-profile-generate=cross" >> .mozconfig
./mach build
# Package and run automated benchmarks for profiling
# Use software rendering (LIBGL_ALWAYS_SOFTWARE=true) everywhere to work around potential display issues
./mach package
JARLOG_FILE="$PWD/jarlog" \
LLVM_PROFDATA=llvm-profdata \
LIBGL_ALWAYS_SOFTWARE=true \
MOZ_REMOTE_SETTINGS_DEVTOOLS=1 \
XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)" \
xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" \
./mach python build/pgo/profileserver.py
stat -c "Profile data found (%s bytes)" merged.profdata
test -s merged.profdata
stat -c "Jar log found (%s bytes)" jarlog
test -s jarlog
# Clean for rebuild
./mach clobber
# Profile use build and enable lto
sed -i '/--enable-profile-generate=cross/d' .mozconfig
echo "ac_add_options --enable-lto=cross" >> .mozconfig
echo "ac_add_options --enable-profile-use=cross" >> .mozconfig
echo "ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata" >> .mozconfig
echo "ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog" >> .mozconfig
./mach build
./mach buildsymbols
fi
install : |
# Install locales first
langpackdir="$installdir/%libdir%/firefox/langpacks"
install -D -d -m 00755 "${langpackdir}"
tar xf "${sources}/firefox-${version}-langpacks.tar.zst"
for i in ff_lang_pack/*.xpi; do
lname="$(basename ${i})"
install -Dm00644 "ff_lang_pack/${lname}" "${langpackdir}"/$lname
done
DESTDIR=$installdir ./mach install
# Desktop file, icons, appdata
for s in 16 22 24 32 48 256; do
install -Dm00644 browser/branding/official/default${s}.png $installdir/usr/share/icons/hicolor/${s}x${s}/apps/firefox.png
done
install -Dm00644 $pkgfiles/firefox-symbolic.svg $installdir/usr/share/icons/hicolor/symbolic/apps/firefox-symbolic.svg
install -Dm00644 $pkgfiles/firefox.desktop $installdir/usr/share/applications/firefox.desktop
install -Dm00644 $pkgfiles/org.mozilla.firefox.appdata.xml $installdir/usr/share/metainfo/org.mozilla.firefox.appdata.xml
# Man page
install -Dm00644 $pkgfiles/firefox.1 $installdir/usr/share/man/man1/firefox.1
sed -i "s|@@VERSION@@|$version|g" $installdir/usr/share/man/man1/firefox.1
# Use a wrapper script to launch in Wayland, as well as ensure that Firefox correctly detects whether or not it's the default browser
install build/unix/run-mozilla.sh -t $installdir/%libdir%/firefox/
rm -v $installdir/usr/bin/firefox
install -D -m 00755 $pkgfiles/firefox-wrapper.sh $installdir/usr/bin/firefox
# set up defaults
mkdir -p $installdir/%libdir%/firefox/browser/defaults/preferences
install -m00644 $pkgfiles/prefs.js $installdir/%libdir%/firefox/browser/defaults/preferences/prefs.js
install -m00644 $pkgfiles/firefox-l10n.js $installdir/%libdir%/firefox/browser/defaults/preferences/firefox-l10n.js