www-client/firefox: make USE=lto respect MAKEOPTS
authorThomas Deutschmann <whissi@gentoo.org>
Tue, 14 Apr 2020 23:13:27 +0000 (01:13 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Tue, 14 Apr 2020 23:42:03 +0000 (01:42 +0200)
Closes: https://bugs.gentoo.org/716758
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
www-client/firefox/firefox-68.7.0.ebuild
www-client/firefox/firefox-75.0.ebuild

index 035e41b50ae759bb3ec37066498c5eb2bc9c5a34..4e8dd7c4d52411c0ef390e72248748d953ff15cf 100644 (file)
@@ -42,7 +42,7 @@ LLVM_MAX_SLOT=10
 
 inherit check-reqs eapi7-ver flag-o-matic toolchain-funcs eutils \
                gnome2-utils llvm mozcoreconf-v6 pax-utils xdg-utils \
-               autotools mozlinguas-v2 virtualx
+               autotools mozlinguas-v2 multiprocessing virtualx
 
 DESCRIPTION="Firefox Web Browser"
 HOMEPAGE="https://www.mozilla.com/firefox"
@@ -303,6 +303,12 @@ src_prepare() {
        # Allow user to apply any additional patches without modifing ebuild
        eapply_user
 
+       # Make LTO respect MAKEOPTS
+       sed -i \
+               -e "s/multiprocessing.cpu_count()/$(makeopts_jobs)/" \
+               "${S}"/build/moz.configure/toolchain.configure \
+               || die "sed failed to set num_cores"
+
        # Enable gnomebreakpad
        if use debug ; then
                sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
index 6661604f0cc3378feee346b9c569a11f2bc32afa..0302a4b7d3f8477555cba201562379e9af105c2d 100644 (file)
@@ -41,8 +41,9 @@ fi
 LLVM_MAX_SLOT=10
 
 inherit check-reqs eapi7-ver flag-o-matic toolchain-funcs eutils \
-               gnome2-utils llvm mozcoreconf-v6 pax-utils xdg-utils \
-               autotools mozlinguas-v2 virtualx eapi7-ver
+               gnome2-utils llvm mozcoreconf-v6 multiprocessing \
+               pax-utils xdg-utils autotools mozlinguas-v2 virtualx \
+               eapi7-ver
 
 DESCRIPTION="Firefox Web Browser"
 HOMEPAGE="https://www.mozilla.com/firefox"
@@ -315,6 +316,12 @@ src_unpack() {
 src_prepare() {
        eapply "${WORKDIR}/firefox"
 
+       # Make LTO respect MAKEOPTS
+       sed -i \
+               -e "s/multiprocessing.cpu_count()/$(makeopts_jobs)/" \
+               "${S}"/build/moz.configure/lto-pgo.configure \
+               || die "sed failed to set num_cores"
+
        # Allow user to apply any additional patches without modifing ebuild
        eapply_user