diff options
Diffstat (limited to 'net-libs/nodejs')
-rw-r--r-- | net-libs/nodejs/Manifest | 2 | ||||
-rw-r--r-- | net-libs/nodejs/nodejs-20.9.0.ebuild | 257 |
2 files changed, 259 insertions, 0 deletions
diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest index cfe794e1e195..d4518d8782dc 100644 --- a/net-libs/nodejs/Manifest +++ b/net-libs/nodejs/Manifest @@ -9,6 +9,7 @@ DIST node-v18.18.2.tar.xz 40834428 BLAKE2B b2fcedd79fc8ca6a5b9236614874b9840d4df 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 +DIST node-v20.9.0.tar.xz 41857572 BLAKE2B 0f4acc579e27b61bc3aa4179abcd9d137e9343427da138bf0114cb2a030b46848d4ec5b5bdca15fafc5afa1ae35200b8d98586f85444c73a5f78d70135260b73 SHA512 2b9453723149e0a94e759131460699a6fdf8656f0c1b7243307442cabef606a4e1d40781b80eaf632874952cb2468fa1e766ababdaa103d5dab623e0ca2f85de 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 @@ -17,5 +18,6 @@ EBUILD nodejs-20.6.1.ebuild 7480 BLAKE2B 96c7b64dadfe2283d0053a56cf20f1f4111ce55 EBUILD nodejs-20.7.0.ebuild 7485 BLAKE2B 5908b0f1174bdb46eecbc1a10d7205c498bf0ac642c9b4351bd9f806cd17894d8590d319780148a30586565ab7eea03d829cbff6b85e4eff3d683b77e7d7e9b5 SHA512 b00a2c473ba03384cee2152276b187ed42e63a7c86f84437c719d328217f79fd1ed8239c1f7f1d8b5800af1025194f7c708a3fee08ca959af310cfb00229a06b EBUILD nodejs-20.8.1-r1.ebuild 7465 BLAKE2B 233eb4c49f06a5ce94ae2cab57b19e7a06ef295173fab71ef251ce933940c30e44f8ac8e55f0412fee99b00b2f2b6a69108c0ecd274ea546656b3bce2c592188 SHA512 8545c8647a944b35ab4507d206692b70d4e839486cd3460047964671cea8076f0523e6a96b942fd3c8122ccc6c2a865afef99a48c7a8b9409bad8648ecb24ba8 EBUILD nodejs-20.8.1.ebuild 7465 BLAKE2B 02618bb72124bbfb8fd3c2b0f24ee9de866e2dc8d9f632f00a174811dc970d5bb987e772844c077d749935a040a8cab1a7b267c62ef28a3371193eebd7658531 SHA512 aadc2d27b2d8440d2be4a86b51c353fcc02b76b916da75d4b267a0f8a15a8c50521ce43a17ea8e28b825f179f70352fa989d2154eb9c0f27b13ef1a733c85201 +EBUILD nodejs-20.9.0.ebuild 7409 BLAKE2B 420ea84e10dbf129397b39cefd41bf3a74271f0230f9601b32a3f875c8e930c9512143f449f1a07a84bbc937a87e24c1dd85f5548046cf279611c0695cd315c2 SHA512 0ea7df60fae15eaca59cef5565a1c809f110f06f5b589513d01fd2accb82e40681e55d4df4848ef3077e0baf8586bd78745ba5932d0d6318d62d79905a050238 EBUILD nodejs-99999999.ebuild 7391 BLAKE2B 892d8f21fafdc5602eb04a877102dbc0d563fbf1c4f2e5f5dca8bdb9dc190eace29023aeec91a8796b63088711e93e67887bc216c3034d08b8ebc4b15e8ba2f9 SHA512 b917bbaa35426b520a2e5af5441a71127d40d7a243e00dbba6602efccb2441a47addb6cd34e4f3d6296016aca10e5190b97314cfce06aa69a2bf9f713554cdae MISC metadata.xml 986 BLAKE2B 67133c97db85eced638323a93514e084da381b7cbebcab2f0f2ce2781cf0da02be705ab5781c18205a8d4e8b679b6f77f3c9e97ea6ef72b36b6a8a854a39617d SHA512 3f749720ea0623fefa703f8b4563ebabfd5e4aeff4f2e8998576860177d3b1a075afaabc2aa0dc5100df59b3cb787d70d44284976bad3409966b68c11ec64d7a diff --git a/net-libs/nodejs/nodejs-20.9.0.ebuild b/net-libs/nodejs/nodejs-20.9.0.ebuild new file mode 100644 index 000000000000..58de8a867c1e --- /dev/null +++ b/net-libs/nodejs/nodejs-20.9.0.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 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:= + 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} + 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" + +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 +} |