diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-06-26 00:12:24 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-06-26 00:12:24 +0100 |
commit | 9f6a82a85d400d6ae7de04c43cee88dbc6bc4da0 (patch) | |
tree | 2d53ee03e360a9c66a5d8dd8986eee286514336b /net-libs/nodejs | |
parent | 996a2bda06cb164877d5d952774a6db1b271c2f3 (diff) |
gentoo auto-resync : 26:06:2024 - 00:12:24
Diffstat (limited to 'net-libs/nodejs')
-rw-r--r-- | net-libs/nodejs/Manifest | 5 | ||||
-rw-r--r-- | net-libs/nodejs/files/nodejs-22.2.0-riscv.patch | 37 | ||||
-rw-r--r-- | net-libs/nodejs/nodejs-20.15.0.ebuild | 261 | ||||
-rw-r--r-- | net-libs/nodejs/nodejs-22.3.0.ebuild | 3 |
4 files changed, 305 insertions, 1 deletions
diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest index fc0238a8b557..c4d3ef36fbc8 100644 --- a/net-libs/nodejs/Manifest +++ b/net-libs/nodejs/Manifest @@ -1,15 +1,18 @@ AUX nodejs-18.16.0-paxmarking.patch 3470 BLAKE2B 4de01a4b3267d24c7c899a9caf8dae3975a8ed4a82cfe4df2ffc6858a3e1153bd6801ec5f5dc17ab5984ffa2d3b5ec9651c80e6993bd20c14865b0d873f58547 SHA512 5f49c1ca953421b3aa07e0b93375e99c9e5f543b48df3cff833f5e55f7e1b511971c56ed250e36c8a7465229db135a8d2bd1319f2d09368788f6152f06ced4f9 AUX nodejs-20.11.0-riscv.patch 7660 BLAKE2B 8af657b4c87f892a7e8ab4e0b0f6c8927841585cf71971cb3a0e9b508c182222ace7178fd76f12000432df8a1b51c1a553616a3797a16b35f9499edce1e84638 SHA512 29b42307e017de0ef54c2e80e5e56d771a04f282ca858bcd3300c68ef4d72bb2fb5f2841a85a9845ee17f1909a33a64c798da9ed624feb34fcb11661dbe9fe69 AUX nodejs-20.6.0-paxmarking.patch 3143 BLAKE2B 34b93f63481177f1b70d26bdbdb27674533016dd5cefe4161cfa49c3defc6316cbbf22df024d28e9d42687be78fb0a6ce6e95334cad386d6371ff1f7fd9063ee SHA512 6604a1c8041e28bea0ea8c4dd168d44fb4ae7d25b15db4e20c220bcf3697d08de5205dde502dda4d061ace36e3f8f3511f646b00acc0382c2c8dff64cf1bf8b8 +AUX nodejs-22.2.0-riscv.patch 1760 BLAKE2B f5f033dd589637481d2a2f3e67cdbb7a6052bdb187d2666b145a76f23da6e36adeddfe2b6e1718ae4412df914f8517bec2cdc5c15b18eb9dca5dad7a6668cc04 SHA512 f2ff6da8cf5dcc994a7a20342e2928dc1821fbbf42891009a6234b6051277e0200d7e3fbba63b9a2773887591d0ad5ceb1bb3d25e5efeb557f6d00109a80253c DIST node-v18.20.1.tar.xz 40434200 BLAKE2B 560e04d5da8c2f3f4ef82e67b483f2c5d9a59b0646108a1dfc0bd80b410b60b15ee517be7d720834232fc49ed5d94785ebd64282c9abd3c10bdcb883a6960a38 SHA512 08864a164cfde08e369653abd17f6fe549db014697bd36abd07233d5ae746417ef18ea80e3d3f3630503a21110bb5e0ebd0073b4f2885b00c2d46e6f31c386a3 DIST node-v18.20.3.tar.xz 40610412 BLAKE2B 7f1cb88cd4bf51ca8933344a11f710c8748b88a9cfa38f6960b8f12f0b78afbecd0fae86608b81fcaca44d98042aae5807924bb09e2088491831d6eb08615ca2 SHA512 0f518e8f3985274d5b0f48eb574675fa0a1ade6f5e59a9de706b2ade3f8a82dbea1557611a6353422090a95846b5ed107ea2476f78bee787ef4f0db8c07bc999 DIST node-v20.12.1.tar.xz 41743360 BLAKE2B 1e2819724051720321a429bb18967a12608e8f93ef1760c520a40c9130e6138f95ab4e87f1acbaa72142bdd801ec3050bc42d7e4fae8d6a62192c3511b922e0a SHA512 c51c4aa37cc80f3fe34381f2cdf431053124ec6b83fc8490573502adfab48601c382448132c9962ab135bebaffc257a9d5b63334ba8ff480db57b5706bbfed67 DIST node-v20.14.0.tar.xz 41795876 BLAKE2B 588c380751c12f05ccc95146f6e7f9c3eadfc77e769d836cdca1832a7739a40723fd9a7a4e59a2ab4ad087a2b2def5da76ec28077996b59ae0a6d5b2bd15d2c6 SHA512 b6148c705b2152b20c6567a9bbcbbb3925972d17273e126613b350d1d117600e2d895a93d70f793523cb903337ace9527c541a38cb10137eb81ba992778ed243 +DIST node-v20.15.0.tar.xz 41868532 BLAKE2B 07049df11e18b90ee3ebc72fdd953a64a4a925f234fcf7bfb26c472d841bd3f6f34233670d1cc67ba592eeaa714de74c6a7b89ac5a9f62a321764023a86760de SHA512 2b041ee368ca27fa1f92ec8a43237423b7e2f81dabf525e20df7b9b200a46e6d9a8c4b82beb33ec58a9351e0eea865eadfadac3d9e4d3733b1d699f0b5d4bbf3 DIST node-v22.3.0.tar.xz 44517412 BLAKE2B 38ed4e6de9be48fb252b809a0174420f0f201f583ef5fb46a446d74168a25b39e1fa95ede44bfee8e7099dfe5636b3fb2bcd1ba3d626d7dfcac01dec0bd84d0a SHA512 70d1508bb576d98ef138db5618a5b07ca4412ec8a2aa35c8ff1d76fc93221bff6d7b418ff60b9194c420ad810523d5aeb0ffa662d2fa99f9cecf299317698710 EBUILD nodejs-18.20.1.ebuild 7433 BLAKE2B e366853288364eddb38a0a598db70f83e5188a489ac2c5970eb21f9c993abd4807d87826536d0a1ea12315603edd5f0a714876d95d2aae1ef8e1ded8ee3e7030 SHA512 0a20a965b9c25f7319bc5dfca87e0ddf9f78f603a4dc334c68e750b847d5687b0e636fa199f089a004e72536435b334309ad042753a95f93800fb65515d77402 EBUILD nodejs-18.20.3.ebuild 7438 BLAKE2B 485d422711687c69adb1d5e7bd6c4dcc63cd451c90bf893252d6c81ac6fdbcdf6a64675dcba588e5190de5a44717de7cefc84561265e5fb322a81fb600a7196b SHA512 ba369ee0899f78cfda0de173a4f61b2ecd5c4321f544cfe56d6c696f6971c7c897711697626e69a3d1283367efc77015e2adaefbdc6802d4cac7385a1ce8b044 EBUILD nodejs-20.12.1.ebuild 7599 BLAKE2B 10339e186e827ab88b9830fbd76bab4a12a181fab9d6a6ce054948d8e1e64c32e54491bcc29ef6304827da39352f25ad73b01122c872c2667ee9d945f43368ca SHA512 cac02959f6cdfc3d99dbf918b910453a8175b2fce0a8dcaeebc64a21e4cb4186b19d5f4ce46b237de52c7e66e8f9a9dc4a353b9c12969f7370c82d91ef281b02 EBUILD nodejs-20.14.0.ebuild 7567 BLAKE2B f91ca9f6bc88e927ae20a5af0f74a8fad87c995610eda2132a55ddbe9ab2df279d0f717dcc8e3e660358d6609de50dbb3fd76c6d4715c8e4d0e8b4016b7c65c0 SHA512 730eac7fa64742cda816d710720ca30d42a1a95db9b60e85282c7895115c437bb4e27986ff713657199a6947bb0b0cda8a2fc94912c8f7f0c032155eafe9509b -EBUILD nodejs-22.3.0.ebuild 7788 BLAKE2B 8e1de08dd2d0d60367d72c4dae504f0cd542da5f316daf1f706b9a871a5ed3cc52ee4f153ed83ca82d29e1da32744452badcdaed22351761378f08a01b6f8d27 SHA512 d302640c0c5857204d18d759ce607bdbce5bc490f6188b6218f52fb9b96bf2c20a182c819bd4bcc49aff7e2e951155fec34861a9f27401cc71adf0c7b9c8b625 +EBUILD nodejs-20.15.0.ebuild 7567 BLAKE2B f91ca9f6bc88e927ae20a5af0f74a8fad87c995610eda2132a55ddbe9ab2df279d0f717dcc8e3e660358d6609de50dbb3fd76c6d4715c8e4d0e8b4016b7c65c0 SHA512 730eac7fa64742cda816d710720ca30d42a1a95db9b60e85282c7895115c437bb4e27986ff713657199a6947bb0b0cda8a2fc94912c8f7f0c032155eafe9509b +EBUILD nodejs-22.3.0.ebuild 7861 BLAKE2B fb2ce11bdcaf245ab37ce6cdd96802fe99521779fce4862b554544b86dff5b7118f531d1897b0bb1f8ee1b4b1fd8646e92e7e6b77d65b25486021ad8341a1bd9 SHA512 73bb62bb04bbf600b0c49b49814a3e83e4c071c8c988349c5c76e820aba51670e4d924216f2e29fdc4e799bc461d56091e2531c8684496308ee0eccadb7c835c EBUILD nodejs-99999999.ebuild 7406 BLAKE2B 71b0f9acf3a3cdf3181c7f1dc3ca2a290c5fefce6be6ab017483750a31f7bf3c996984b91f03e1144b2b6bf3cb852529b9f620974ab0484928d6a390890cf2dc SHA512 bc0b7c5171f11b9b2d29915e03614272653baba609d505885e4aaf5d51ed40291e82c5970bb7e914e41604dcb3788ecb85a0d5e8a9770aea73f77136f6915d1e MISC metadata.xml 983 BLAKE2B 7e455047a955185d1e53797b2b0592c5242b7eb849617cf39366acbab41e4fd066d36d723dbc32760f591c933f068e643475fc1b58a2873a2f1221e1c5d44b71 SHA512 5e08a76e2704000aa83a2c63f6e821e83c302939c1a729c4ac73774cc85189da4eccc1a19b700babfe87c8f07327865171526550ddf16a4fc25fed834f4bf7a6 diff --git a/net-libs/nodejs/files/nodejs-22.2.0-riscv.patch b/net-libs/nodejs/files/nodejs-22.2.0-riscv.patch new file mode 100644 index 000000000000..44c696307240 --- /dev/null +++ b/net-libs/nodejs/files/nodejs-22.2.0-riscv.patch @@ -0,0 +1,37 @@ +From 2674676fe3b01cc9652a5922badc9b044080fce7 Mon Sep 17 00:00:00 2001 +From: Lu Yahan <yahan@iscas.ac.cn> +Date: Wed, 8 May 2024 16:34:24 +0800 +Subject: [PATCH] tools: fix riscv64 build failed + +--- + tools/v8_gypfiles/v8.gyp | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp +index 1e2b3645132aab..ab96e0c7d2c1f2 100644 +--- a/tools/v8_gypfiles/v8.gyp ++++ b/tools/v8_gypfiles/v8.gyp +@@ -1150,6 +1150,23 @@ + 'sources': [ + '<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_wasm_gdb_remote_debugging.*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")', + ], ++ 'conditions': [ ++ ['v8_enable_webassembly==1', { ++ 'conditions': [ ++ ['(_toolset=="host" and host_arch=="arm64" or _toolset=="target" and target_arch=="arm64") or (_toolset=="host" and host_arch=="riscv64" or _toolset=="target" and target_arch=="riscv64") or (_toolset=="host" and host_arch=="x64" or _toolset=="target" and target_arch=="x64")', { ++ 'sources': [ ++ '<(V8_ROOT)/src/trap-handler/handler-inside-posix.cc', ++ '<(V8_ROOT)/src/trap-handler/handler-outside-posix.cc', ++ ], ++ }], ++ ['(_toolset=="host" and host_arch=="x64" or _toolset=="target" and target_arch=="x64") and (OS=="linux" or OS=="mac" or OS=="win")', { ++ 'sources': [ ++ '<(V8_ROOT)/src/trap-handler/handler-outside-simulator.cc', ++ ], ++ }], ++ ], ++ }], ++ ], + }], + ['v8_target_arch=="loong64"', { + 'sources': [ diff --git a/net-libs/nodejs/nodejs-20.15.0.ebuild b/net-libs/nodejs/nodejs-20.15.0.ebuild new file mode 100644 index 000000000000..1ce818bc4013 --- /dev/null +++ b/net-libs/nodejs/nodejs-20.15.0.ebuild @@ -0,0 +1,261 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CONFIG_CHECK="~ADVISE_SYSCALLS" +PYTHON_COMPAT=( python3_{9..12} ) +PYTHON_REQ_USE="threads(+)" + +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/" +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/nodejs/node" + SLOT="0" +else + SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" + SLOT="0/$(ver_cut 1)" + KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86 ~amd64-linux ~x64-macos" + S="${WORKDIR}/node-v${PV}" +fi + +IUSE="corepack cpu_flags_x86_sse2 debug doc +icu inspector lto +npm pax-kernel +snapshot +ssl +system-icu +system-ssl test" +REQUIRED_USE="inspector? ( icu ssl ) + npm? ( ssl ) + system-icu? ( icu ) + system-ssl? ( ssl ) + x86? ( cpu_flags_x86_sse2 )" + +RESTRICT="!test? ( test )" + +RDEPEND=">=app-arch/brotli-1.0.9:= + >=dev-libs/libuv-1.46.0:= + >=net-dns/c-ares-1.18.1:= + >=net-libs/nghttp2-1.41.0:= + >=net-libs/ngtcp2-1.1.0:= + sys-libs/zlib + corepack? ( !sys-apps/yarn ) + system-icu? ( >=dev-libs/icu-71:= ) + system-ssl? ( >=dev-libs/openssl-1.1.1:0= ) + sys-devel/gcc:*" +BDEPEND="${PYTHON_DEPS} + app-alternatives/ninja + sys-apps/coreutils + virtual/pkgconfig + test? ( net-misc/curl ) + pax-kernel? ( sys-apps/elfix )" +DEPEND="${RDEPEND}" + +# 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() { + 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() { + tc-export AR CC CXX PKG_CONFIG + export V=1 + export BUILDTYPE=Release + + # fix compilation on Darwin + # https://code.google.com/p/gyp/issues/detail?id=260 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die + + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 + local LIBDIR=$(get_libdir) + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die + + # Avoid writing a depfile, not useful + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die + + sed -i -e "/'-O3'/d" common.gypi node.gypi || die + + # debug builds. change install path, remove optimisations and override buildtype + if use debug; then + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die + BUILDTYPE=Debug + fi + + # We need to disable mprotect on two files when it builds Bug 694100. + use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-20.6.0-paxmarking.patch ) + + default +} + +src_configure() { + xdg_environment_reset + + # LTO compiler flags are handled by configure.py itself + filter-lto + # 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=( + --ninja + --shared-brotli + --shared-cares + --shared-libuv + --shared-nghttp2 + --shared-ngtcp2 + --shared-zlib + ) + use debug && myconf+=( --debug ) + use lto && myconf+=( --enable-lto ) + if use system-icu; then + myconf+=( --with-intl=system-icu ) + elif use icu; then + myconf+=( --with-intl=full-icu ) + else + myconf+=( --with-intl=none ) + fi + use corepack || myconf+=( --without-corepack ) + use inspector || myconf+=( --without-inspector ) + use npm || myconf+=( --without-npm ) + use snapshot || myconf+=( --without-node-snapshot ) + if use ssl; then + use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store ) + else + myconf+=( --without-ssl ) + fi + + local myarch="" + 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 + + GYP_DEFINES="linux_use_gold_flags=0 + linux_use_bundled_binutils=0 + linux_use_bundled_gold=0" \ + "${EPYTHON}" configure.py \ + --prefix="${EPREFIX}"/usr \ + --dest-cpu=${myarch} \ + "${myconf[@]}" || die +} + +src_compile() { + emake -Onone +} + +src_install() { + local LIBDIR="${ED}/usr/$(get_libdir)" + default + + pax-mark -m "${ED}"/usr/bin/node + + # set up a symlink structure that node-gyp expects.. + dodir /usr/include/node/deps/{v8,uv} + dosym . /usr/include/node/src + for var in deps/{uv,v8}/include; do + dosym ../.. /usr/include/node/${var} + done + + if use doc; then + docinto html + dodoc -r "${S}"/doc/* + fi + + if use npm; then + keepdir /etc/npm + echo "NPM_CONFIG_GLOBALCONFIG=${EPREFIX}/etc/npm/npmrc" > "${T}"/50npm + doenvd "${T}"/50npm + + # Install bash completion for `npm` + local tmp_npm_completion_file="$(TMPDIR="${T}" mktemp -t npm.XXXXXXXXXX)" + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" + newbashcomp "${tmp_npm_completion_file}" npm + + # Move man pages + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* + + # Clean up + rm -f "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} + + local find_exp="-or -name" + local find_name=() + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ + "*.md" "*.markdown" "*.bat" "*.cmd"; do + find_name+=( ${find_exp} "${match}" ) + done + + # Remove various development and/or inappropriate files and + # useless docs of dependend packages. + find "${LIBDIR}"/node_modules \ + \( -type d -name examples \) -or \( -type f \( \ + -iname "LICEN?E*" \ + "${find_name[@]}" \ + \) \) -exec rm -rf "{}" \; + fi + + use corepack && + "${D}"/usr/bin/corepack enable --install-directory "${D}"/usr/bin + + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die +} + +src_test() { + local drop_tests=( + test/parallel/test-dns-resolveany-bad-ancount.js + test/parallel/test-dns-setserver-when-querying.js + test/parallel/test-fs-mkdir.js + test/parallel/test-fs-read-stream.js + test/parallel/test-fs-utimes-y2K38.js + test/parallel/test-fs-watch-recursive-add-file.js + test/parallel/test-process-euid-egid.js + test/parallel/test-process-initgroups.js + test/parallel/test-process-setgroups.js + test/parallel/test-process-uid-gid.js + test/parallel/test-release-npm.js + test/parallel/test-socket-write-after-fin-error.js + test/parallel/test-strace-openat-openssl.js + test/sequential/test-util-debug.js + ) + rm -f "${drop_tests[@]}" || die "disabling tests failed" + + out/${BUILDTYPE}/cctest || die + "${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} --flaky-tests=dontcare -J message parallel sequential || die +} + +pkg_postinst() { + if use npm; then + ewarn "remember to run: source /etc/profile if you plan to use nodejs" + ewarn " in your current shell" + fi +} diff --git a/net-libs/nodejs/nodejs-22.3.0.ebuild b/net-libs/nodejs/nodejs-22.3.0.ebuild index 37c99da5a59e..ee0eb0823bd1 100644 --- a/net-libs/nodejs/nodejs-22.3.0.ebuild +++ b/net-libs/nodejs/nodejs-22.3.0.ebuild @@ -104,6 +104,9 @@ src_prepare() { # We need to disable mprotect on two files when it builds Bug 694100. use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-20.6.0-paxmarking.patch ) + # bug 931256 + use riscv && PATCHES+=( "${FILESDIR}"/${P}-riscv.patch ) + default } |