commit: f7a871b4b3d3d10226c29f3e09cb74a2353e9b8c Author: WANG Xuerui <xen0n <AT> gentoo <DOT> org> AuthorDate: Thu Aug 18 15:15:58 2022 +0000 Commit: William Hubbs <williamh <AT> gentoo <DOT> org> CommitDate: Thu Aug 18 15:21:33 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7a871b4
net-libs/nodejs: run check-reqs when building with debugging CFLAGS Bug: https://github.com/gentoo/gentoo/pull/25655 Signed-off-by: WANG Xuerui <xen0n <AT> gentoo.org> Signed-off-by: William Hubbs <williamh <AT> gentoo.org> net-libs/nodejs/nodejs-18.7.0.ebuild | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/net-libs/nodejs/nodejs-18.7.0.ebuild b/net-libs/nodejs/nodejs-18.7.0.ebuild index 6b031ed0b96c..34ed47477bc6 100644 --- a/net-libs/nodejs/nodejs-18.7.0.ebuild +++ b/net-libs/nodejs/nodejs-18.7.0.ebuild @@ -7,7 +7,7 @@ CONFIG_CHECK="~ADVISE_SYSCALLS" PYTHON_COMPAT=( python3_{8..11} ) PYTHON_REQ_USE="threads(+)" -inherit bash-completion-r1 flag-o-matic linux-info pax-utils python-any-r1 toolchain-funcs xdg-utils +inherit bash-completion-r1 check-reqs flag-o-matic linux-info pax-utils python-any-r1 toolchain-funcs xdg-utils DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" HOMEPAGE="https://nodejs.org/" @@ -52,9 +52,26 @@ PATCHES=( "${FILESDIR}"/${PN}-15.2.0-global-npm-config.patch ) +# These are measured on a loong machine with -ggdb on, and only checked +# if debugging flags are present in CFLAGS. +# +# The final link consumed a little more than 7GiB alone, so 8GiB is the lower +# limit for memory usage. Disk usage was 19.1GiB for the build directory and +# 1.2GiB for the installed image, so we leave some room for architectures with +# fatter binaries and set the disk requirement to 22GiB. +CHECKREQS_MEMORY="8G" +CHECKREQS_DISK_BUILD="22G" + pkg_pretend() { (use x86 && ! use cpu_flags_x86_sse2) && \ die "Your CPU doesn't support the required SSE2 instruction." + + if [[ ${MERGE_TYPE} != "binary" ]]; then + if is-flagq "-g*" && ! is-flagq "-g*0" ; then + einfo "Checking for sufficient disk space and memory to build ${PN} with debugging CFLAGS" + check-reqs_pkg_pretend + fi + fi } pkg_setup() {