From 94dd707d272879a8dfdd31d71113b1b7bba98366 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 17 Oct 2023 22:03:16 +0100 Subject: gentoo auto-resync : 17:10:2023 - 22:03:16 --- net-libs/nodejs/Manifest | 4 + net-libs/nodejs/nodejs-18.18.2.ebuild | 257 +++++++++++++++++++++++++++++++++ net-libs/nodejs/nodejs-20.8.1.ebuild | 261 ++++++++++++++++++++++++++++++++++ 3 files changed, 522 insertions(+) create mode 100644 net-libs/nodejs/nodejs-18.18.2.ebuild create mode 100644 net-libs/nodejs/nodejs-20.8.1.ebuild (limited to 'net-libs/nodejs') diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest index 5a181a661527..15d0b89d4af0 100644 --- a/net-libs/nodejs/Manifest +++ b/net-libs/nodejs/Manifest @@ -5,12 +5,16 @@ AUX nodejs-20.6.0-paxmarking.patch 3143 BLAKE2B 34b93f63481177f1b70d26bdbdb27674 DIST node-v16.20.2.tar.xz 36834468 BLAKE2B 88bd0d91a6b69f7e5fba2b087684b07b8986fd1492f51f6fdccc02f043970303808c0cc1eeda29670aacddd4234ec3181752c916fefee060624b0462dff8cbcf SHA512 c7953630b7d0eb832ab5a4b839c07e6505cf5f4e37853f59cd0ffc6b8742ac2ecaba20bfb47d8995ef88f3c7005bb456c1eb70cb2fc6b6fc506e1d8b81f25cb4 DIST node-v18.17.1.tar.xz 40788836 BLAKE2B 50e0dc0eecd68620ffa7457319e71124bbba302f6acff79286a30cf97442fb09a96cf8781456bafd5c2e497ba88cf392c141f0e221683da421b87f653b1ad7ca SHA512 fd6f586447ecd44ac6738da1cf7d54e74bd33ffd1ee1acc2e0e1bdaf0031bcaef85751d3dd590bb278eb502daf9c77f0763b5a181a30ee4cf537aef254629622 DIST node-v18.18.0.tar.xz 40813264 BLAKE2B 6cea11a663e5df730faef9125a80e730da83fdccebf8c4f454435ee622207803d59132b5d8e112741702103a6814a491b29bb9f22ddec60fba204236a763b95e SHA512 c10fb40902fc290cc069e86659ff4c7768215f80a7016402915cae7731bfd69aa901b7dc813d480f86fc39a850960f600ddde342d67b9bb570a3d2424b04f733 +DIST node-v18.18.2.tar.xz 40834428 BLAKE2B b2fcedd79fc8ca6a5b9236614874b9840d4df5f37f5ecfa5599a177b237543788eb985e8828f7a028f5fbca17aa0c4879393b956d08dce13bd04ec9e253aa48e SHA512 00af3c737d735a320481d764f1c23b1348c0454f2b9700cadb10e087feb47c75e7e9344277bb3149305c3e08ff69d9b17b0da81b1b9d9e978fd830c67858ce92 DIST node-v20.6.1.tar.xz 41791920 BLAKE2B c131aa9dd2a155eb24dda80e4997895aab7d935e46d1f21e9e176aa15021aa68be41f49cc43557f0b2c962baf3b2da4ea0ba044efd5016ea58bf2dc0b76c4edd SHA512 8a6d998ae9b52872ff8cdcd44261f644161f31bcb565329ae05e68945c8da939eabcb76d2e0f628c8eb634de37d7b16334823f64122e4483c390117d8aa511bf DIST node-v20.7.0.tar.xz 41824232 BLAKE2B ac13e5fea6af99309c5a5e77de79eebe42f894e6182daa13d0d287bed07eb0fbed1e6103c3600216da7bbcbc572900a2a44c622095ff37e0af40a49d0213a866 SHA512 5d95079d8ebe3992d5e34fac607ebb9601f33645874be0e81093a376a57ea23e3a1b74a06dfede1c9289258d40273fa23140bf1954e5d04eed4ec6beafcbc67c +DIST node-v20.8.1.tar.xz 41863408 BLAKE2B 84bd93d9d49f54e655a78194050e91a91ede2d6d415f929e2b942955a3b082d902601b40fdc9eb16a5e16fe46627110d1f43d94ab464d812f165915cf1aa598b SHA512 d76245a8ec35fdb481e898efc457d3804d425a0d8e2da9175cdcc41036c57b5a6c23a5c2e84b7b417d3f48be631bff86708b2cae9e65ca3a22908caa3190ed1b EBUILD nodejs-16.20.2.ebuild 6492 BLAKE2B dfe025a55b69ff058e890fd743d968ea298aac98d29dca26da6335b1344e9b3ce151e28508adf7c9fd00b41a531a76baf5f57ec77bba7e902dc1eaa5d4dcb687 SHA512 62c711f68491f98976f00640ff21d5afbfc8de64a32d4f760674f309621816ccb3c3dabca3e23862a643bd682c278e1fd1f0fa2fd4ecc32e55575ce87bc91d56 EBUILD nodejs-18.17.1.ebuild 7473 BLAKE2B 9a92f610c0886af35d9929d116f64fe1f078f0be4493e9f4e601fc3ddb4c3f0843d880e9f0555dcc38efa6249c36305a5cd1a7e9c1990f62ab7aea7e3b6db61a SHA512 ea8ae3651581da40bd4bfa138228eb8b0bb0bbfa8bbebb923d72d3eaa53212b2b39c8ef820066a89f221c2de646f21b25caaf8dcc9152e0ac574c2321f9ed89f EBUILD nodejs-18.18.0.ebuild 7478 BLAKE2B 3d4987f96a43604f05f29da8ae79b3f5a97b153f470bbf03768eab0336381d897995b1832ce2226eb9cdf288409981f138224a203475854cb5d80bf3a71e9bf5 SHA512 ca6eff67e5aa31499fa91810bf71ee4dd57e9b87b088433c0874a0f92d7c14859a1f6617780f66177161dcc10f2b88e1f986fcdaa7e9ba5357cb1605e888aaf0 +EBUILD nodejs-18.18.2.ebuild 7458 BLAKE2B 01b42a409e58cb86e36e0fcd3a7f8eb3518ba82e30d0c1b6a2345b44f4b169726d8952b02a0bd451a0aba8e378bf98e0a4a6cf51162b1d3fa5b4722f3d5773e7 SHA512 8b71816ed44923ae812e269128b2ed04a3a9c6654395aac4527a3baef7462e1a300b21eceb3e347b3f74f2ac782196619cc2ef944ec79f245d27fa61eb9e4568 EBUILD nodejs-20.6.1.ebuild 7480 BLAKE2B 63cf4bc0211d3a32802bedab391011dac988e2cb0b4979d44a9f8f99eb0c1f4e6c68cc0a22e3a78f03b124dc1b386bcfead1ed6c3054272a8dedfa91d71eb442 SHA512 a42ea387cef136c13f3de6c94d2aae6880d805c4c0554a40da1de64bb6a688aaa865529c233447909971d5874bc5803a8b32b4cd4b99e554a6053921e9af67b7 EBUILD nodejs-20.7.0.ebuild 7485 BLAKE2B 9391bf2a61da2e8667f33a7f042b51955c4e352b5d2a872e3dc7e48d03ff7f2eebe5cf334e3f43ba288a28cce5b5bcbcd0a2c7542182acb803812705fe4302fe SHA512 4d7f415d5f38b074a121e7bc26145b9cd9ed1fbdcad13519659c0e139f1cc12dcb1e61a4abf744939b8e117ac18ed171e327832cfc616827fda3bf83896e5730 +EBUILD nodejs-20.8.1.ebuild 7465 BLAKE2B 98267abd52d688697892d67bae47c3ac5d25918a56f96b4d304706399a068190d39f582b0ea7fc02a3cf7d78338dd0099881ff3cbaa7262711f77b9b8d37b398 SHA512 b99dad7e257dfa445ca17d4e468ffc72e7d31736a10ff71b536760a7e15731522d842a690c91d7b5ef646e9369e7bdee94c5fa032cfae46eb262c2cecdc5fc5d EBUILD nodejs-99999999.ebuild 7391 BLAKE2B 9036b0461f447aee6e75723085bae591264f0bb20aa33480398b5f17458912e2a8f75a6c76c3761879e216e437a0cb2c9eda8aeb84c3f65fd0c1ce590cc6c7b5 SHA512 ea53f8f425b2ea902d6e1b2e24ce9eaab9b290e672d432241a22dbd7ca23c8357e5f9cb438da16f5aa3cb6d9cb0cf7e1af426e1c733f0631b560e0b758d21ded MISC metadata.xml 986 BLAKE2B 67133c97db85eced638323a93514e084da381b7cbebcab2f0f2ce2781cf0da02be705ab5781c18205a8d4e8b679b6f77f3c9e97ea6ef72b36b6a8a854a39617d SHA512 3f749720ea0623fefa703f8b4563ebabfd5e4aeff4f2e8998576860177d3b1a075afaabc2aa0dc5100df59b3cb787d70d44284976bad3409966b68c11ec64d7a diff --git a/net-libs/nodejs/nodejs-18.18.2.ebuild b/net-libs/nodejs/nodejs-18.18.2.ebuild new file mode 100644 index 000000000000..26ecbd197ff8 --- /dev/null +++ b/net-libs/nodejs/nodejs-18.18.2.ebuild @@ -0,0 +1,257 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CONFIG_CHECK="~ADVISE_SYSCALLS" +PYTHON_COMPAT=( python3_{9..11} ) +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 systemtap test" +REQUIRED_USE="inspector? ( icu ssl ) + npm? ( ssl ) + system-icu? ( icu ) + system-ssl? ( ssl )" + +RESTRICT="!test? ( test )" + +RDEPEND=">=app-arch/brotli-1.0.9:= + >=dev-libs/libuv-1.44.0:= + >=net-dns/c-ares-1.18.1:= + >=net-libs/nghttp2-1.41.0:= + sys-libs/zlib + corepack? ( !sys-apps/yarn ) + system-icu? ( >=dev-libs/icu-67:= ) + system-ssl? ( >=dev-libs/openssl-1.1.1:0= ) + sys-devel/gcc:*" +BDEPEND="${PYTHON_DEPS} + sys-apps/coreutils + virtual/pkgconfig + systemtap? ( dev-util/systemtap ) + 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() { + (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() { + 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 + + # less verbose install output (stating the same as portage, basically) + sed -i -e "/print/d" tools/install.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}-18.16.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=( + --shared-brotli + --shared-cares + --shared-libuv + --shared-nghttp2 + --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} \ + $(use_with systemtap dtrace) \ + "${myconf[@]}" || die +} + +src_compile() { + emake -C out +} + +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-setserver-when-querying.js + test/parallel/test-fs-mkdir.js + test/parallel/test-fs-utimes-y2K38.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-20.8.1.ebuild b/net-libs/nodejs/nodejs-20.8.1.ebuild new file mode 100644 index 000000000000..f0917cbb11f0 --- /dev/null +++ b/net-libs/nodejs/nodejs-20.8.1.ebuild @@ -0,0 +1,261 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CONFIG_CHECK="~ADVISE_SYSCALLS" +PYTHON_COMPAT=( python3_{9..11} ) +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.44.0:= + >=net-dns/c-ares-1.18.1:= + >=net-libs/nghttp2-1.41.0:= + sys-libs/zlib + corepack? ( !sys-apps/yarn ) + system-icu? ( >=dev-libs/icu-67:= ) + system-ssl? ( >=dev-libs/openssl-1.1.1:0= ) + sys-devel/gcc:*" +BDEPEND="${PYTHON_DEPS} + dev-util/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" + +PATCHES=( + "${FILESDIR}"/"${PN}"-20.3.0-gcc14.patch + ) + +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 + + # less verbose install output (stating the same as portage, basically) + sed -i -e "/print/d" tools/install.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-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 +} + +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-fs-read-stream.js + test/parallel/test-dns-setserver-when-querying.js + test/parallel/test-fs-mkdir.js + test/parallel/test-fs-utimes-y2K38.js + test/parallel/test-fs-watch-recursive-add-file.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 +} -- cgit v1.2.3