From ca144cbf71b2faf598564847378fa40a0090d67c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 15 Oct 2022 19:51:12 +0100 Subject: gentoo auto-resync : 15:10:2022 - 19:51:12 --- net-libs/nodejs/nodejs-99999999.ebuild | 60 +++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 12 deletions(-) (limited to 'net-libs/nodejs/nodejs-99999999.ebuild') diff --git a/net-libs/nodejs/nodejs-99999999.ebuild b/net-libs/nodejs/nodejs-99999999.ebuild index 577230345a35..6c803a2495ee 100644 --- a/net-libs/nodejs/nodejs-99999999.ebuild +++ b/net-libs/nodejs/nodejs-99999999.ebuild @@ -3,10 +3,11 @@ EAPI=8 -PYTHON_COMPAT=( python3_{8..10} ) +CONFIG_CHECK="~ADVISE_SYSCALLS" +PYTHON_COMPAT=( python3_{8..11} ) PYTHON_REQ_USE="threads(+)" -inherit bash-completion-r1 flag-o-matic 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/" @@ -19,7 +20,7 @@ if [[ ${PV} == *9999 ]]; then else SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" SLOT="0/$(ver_cut 1)" - KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos" + KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos" S="${WORKDIR}/node-v${PV}" fi @@ -37,7 +38,8 @@ RDEPEND=">=app-arch/brotli-1.0.9:= >=net-libs/nghttp2-1.41.0:= sys-libs/zlib system-icu? ( >=dev-libs/icu-67:= ) - system-ssl? ( >=dev-libs/openssl-1.1.1:0= )" + system-ssl? ( >=dev-libs/openssl-1.1.1:0= ) + sys-devel/gcc:*" BDEPEND="${PYTHON_DEPS} sys-apps/coreutils virtual/pkgconfig @@ -46,9 +48,36 @@ BDEPEND="${PYTHON_DEPS} pax-kernel? ( sys-apps/elfix )" DEPEND="${RDEPEND}" +PATCHES=( + "${FILESDIR}"/${PN}-12.22.5-shared_c-ares_nameser_h.patch + "${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() { + python-any-r1_pkg_setup + linux-info_pkg_setup } src_prepare() { @@ -97,6 +126,12 @@ src_configure() { # LTO compiler flags are handled by configure.py itself filter-flags '-flto*' + # nodejs unconditionally links to libatomic #869992 + # specifically it requires __atomic_is_lock_free which + # is not yet implemented by sys-libs/compiler-rt (see + # https://reviews.llvm.org/D85044?id=287068), therefore + # we depend on gcc and force using libgcc as the support lib + tc-is-clang && append-ldflags "--rtlib=libgcc --unwindlib=libgcc" local myconf=( --shared-brotli @@ -124,14 +159,15 @@ src_configure() { fi local myarch="" - case ${ABI} in - amd64) myarch="x64";; - arm) myarch="arm";; - arm64) myarch="arm64";; - lp64*) myarch="riscv64";; - ppc64) myarch="ppc64";; - x32) myarch="x32";; - x86) myarch="ia32";; + case "${ARCH}:${ABI}" in + *:amd64) myarch="x64";; + *:arm) myarch="arm";; + *:arm64) myarch="arm64";; + loong:lp64*) myarch="loong64";; + riscv:lp64*) myarch="riscv64";; + *:ppc64) myarch="ppc64";; + *:x32) myarch="x32";; + *:x86) myarch="ia32";; *) myarch="${ABI}";; esac -- cgit v1.2.3