summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoonas Niilola <juippis@gentoo.org>2023-05-01 20:42:59 +0300
committerJoonas Niilola <juippis@gentoo.org>2023-05-01 20:49:44 +0300
commit14bb75bbae34f7671c7dd622f7130d7580d0a226 (patch)
tree0485dc8a82cf6bb2751050f8444df7cd5a931c40 /www-client
parentgames-emulation/ppsspp: bump to 1.15 (diff)
downloadgentoo-14bb75bbae34f7671c7dd622f7130d7580d0a226.tar.gz
gentoo-14bb75bbae34f7671c7dd622f7130d7580d0a226.tar.bz2
gentoo-14bb75bbae34f7671c7dd622f7130d7580d0a226.zip
www-client/firefox: enable 'jumbo-build' for unified files
- "jumbo-build" allows adjusting resource-usage on weaker hardware, e.g. x86 & arm. "Jumbo-build" has been default-enabled and should only be disabled to control resource usage, or if a build error happens. - making it possible to adjust FILES_PER_UNIFIED_FILE but going above the defaults always crashed the build for me. Bug: https://bugs.gentoo.org/905431 Bug: https://bugs.gentoo.org/905262 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'www-client')
-rw-r--r--www-client/firefox/firefox-112.0.2.ebuild20
-rw-r--r--www-client/firefox/metadata.xml1
2 files changed, 20 insertions, 1 deletions
diff --git a/www-client/firefox/firefox-112.0.2.ebuild b/www-client/firefox/firefox-112.0.2.ebuild
index b7c280646a74..9b8d6211fc3a 100644
--- a/www-client/firefox/firefox-112.0.2.ebuild
+++ b/www-client/firefox/firefox-112.0.2.ebuild
@@ -63,7 +63,7 @@ SLOT="rapid"
LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
IUSE="+clang cpu_flags_arm_neon dbus debug eme-free hardened hwaccel"
-IUSE+=" jack libproxy lto +openh264 pgo pulseaudio sndio selinux"
+IUSE+=" jack +jumbo-build libproxy lto +openh264 pgo pulseaudio sndio selinux"
IUSE+=" +system-av1 +system-harfbuzz +system-icu +system-jpeg +system-libevent +system-libvpx system-png system-python-libs +system-webp"
IUSE+=" +telemetry wayland wifi +X"
@@ -664,8 +664,24 @@ src_prepare() {
|| die "sed failed to disable ccache stats call"
einfo "Removing pre-built binaries ..."
+
find "${S}"/third_party -type f \( -name '*.so' -o -name '*.o' \) -print -delete || die
+ # Respect choice for "jumbo-build"
+ # Changing the value for FILES_PER_UNIFIED_FILE may not work, see #905431
+ if use jumbo-build; then
+ local my_files_per_unified_file=${FILES_PER_UNIFIED_FILE:=16}
+ elog ""
+ elog "jumbo-build enabled with ${my_files_per_unified_file}."
+ elog "if you get a build failure, try -jumbo-build before opening a bug report."
+ elog ""
+
+ sed -i -e "s/\"FILES_PER_UNIFIED_FILE\", 16/\"FILES_PER_UNIFIED_FILE\", "${my_files_per_unified_file}"/" python/mozbuild/mozbuild/frontend/data.py ||
+ die "Failed to adjust FILES_PER_UNIFIED_FILE in python/mozbuild/mozbuild/frontend/data.py"
+ sed -i -e "s/FILES_PER_UNIFIED_FILE = 6/FILES_PER_UNIFIED_FILE = "${my_files_per_unified_file}"/" js/src/moz.build ||
+ die "Failed to adjust FILES_PER_UNIFIED_FILE in js/src/moz.build"
+ fi
+
# Create build dir
BUILD_DIR="${WORKDIR}/${PN}_build"
mkdir -p "${BUILD_DIR}" || die
@@ -873,6 +889,8 @@ src_configure() {
mozconfig_use_enable wifi necko-wifi
+ ! use jumbo-build && mozconfig_add_options_ac '--disable-unified-build' --disable-unified-build
+
if use X && use wayland ; then
mozconfig_add_options_ac '+x11+wayland' --enable-default-toolkit=cairo-gtk3-x11-wayland
elif ! use X && use wayland ; then
diff --git a/www-client/firefox/metadata.xml b/www-client/firefox/metadata.xml
index f1207e1b8b77..4da06e8a17fe 100644
--- a/www-client/firefox/metadata.xml
+++ b/www-client/firefox/metadata.xml
@@ -12,6 +12,7 @@
<flag name="gmp-autoupdate">Allow Gecko Media Plugins (binary blobs) to be automatically
downloaded and kept up-to-date in user profiles</flag>
<flag name="hwaccel">Force-enable hardware-accelerated rendering (Mozilla bug 594876)</flag>
+ <flag name="jumbo-build">Enable unified build - combines source files to speed up build process, but requires more memory</flag>
<flag name="libproxy">Enable libproxy support</flag>
<flag name="lto">Enable Link Time Optimization (LTO)</flag>
<flag name="openh264">Use <pkg>media-libs/openh264</pkg> for H264 support