From 189d7618aeabe2768de6d122ab61f514417a3e6c Mon Sep 17 00:00:00 2001 From: Jeroen Roovers Date: Wed, 8 Apr 2020 22:42:25 +0200 Subject: net-libs/nodejs: Version 12.16.2 Package-Manager: Portage-2.3.97, Repoman-2.3.22 Signed-off-by: Jeroen Roovers --- net-libs/nodejs/Manifest | 1 + net-libs/nodejs/nodejs-12.16.2.ebuild | 213 ++++++++++++++++++++++++++++++++++ 2 files changed, 214 insertions(+) create mode 100644 net-libs/nodejs/nodejs-12.16.2.ebuild (limited to 'net-libs/nodejs') diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest index 27d7e33f8f2f..35cfb425f40c 100644 --- a/net-libs/nodejs/Manifest +++ b/net-libs/nodejs/Manifest @@ -1,6 +1,7 @@ DIST node-v10.19.0.tar.xz 21906168 BLAKE2B 395504ef3befa47d8b967114e019e6a76c799871e7eb21e2c6c0453655ffa07f17f42209daddeb5417342cfbad71ba1a35ae15a2d210b692bc60be270c2fc415 SHA512 512efc58415ed789938c434af131d76bdd51772cac9f7e380afaa79d83cc9c433a979068fc7272adba6ba6551d195267978e1fc819236926b0d1fd6cf91c5eee DIST node-v10.20.0.tar.xz 21945800 BLAKE2B af767add881976a648129a999c81bea7e74c2a59ce951cc3cd448e7576782fe8219d67427187a5e5c2bdf684aaddf918bf712ac11f8153cbd511b9d9b7ed3182 SHA512 0472b0d595f8c1dc941612161215e60879dedfe22659878a1c68146c12d92945245135ca951eb84f6c3d16e9a01d084b027903451f7754a7f2028b024c388ebd DIST node-v12.16.1.tar.xz 23481768 BLAKE2B 29371b952c14907778c064269108f1da5e3818c32773e73090c61edcd07190c418189db6a505987ca71f99bb868880e297de5d2181b9a880774eaaf515985f26 SHA512 fe1e9fabb6fe52e3bc4275b33e6c5e4a761550b04964c0ae7dbef7172f5d415207bb2985751d068e357ce45a0ba414b07c0abd1531ef839b9463e98eeae8f9a4 +DIST node-v12.16.2.tar.xz 23654020 BLAKE2B aa4bb764a8731e32ce07d03d96d573632bbf9af79b127c2acec48fcf335c01ea0ea99532670a46befac42e2e1ce5a4dbd2e4cf0d068bac05749d87af59bb80fa SHA512 81688468bc6e20d83f7f58f0c15f9291a801eb2acc8ba7279e65d81f3eb4ea95e3b6cee0d09738c0d0fa35226ae3d52f2bad5da63a20a3edc9129197d42d000d DIST node-v13.10.1.tar.xz 32812128 BLAKE2B 2dc0e1de269a898f57e9fb91d5b3161d43baa89c8617faffa9998b3244354619a5b78e39500bf02b90fbc2587b8477fbd86850141ec7665690040d6920c50fef SHA512 30b7b58c87021be3e0b909bae476c6191eb72722ed00e51716d7eb0793aeb29c05b088c195ffd69a40dd42423ceba20350f6379c11d276eb3398abfc4cdf340c DIST node-v13.11.0.tar.xz 32812056 BLAKE2B 0c3975721916f4594515b37b093fb0640785212b455c3687d63a89bb8c6930ce59c74f8ccedab3579d88bedabb881264725d93e43a384b851897bbb94a5a52ac SHA512 cfe8b46d9cf5c7c10f7099bcf1d3a3ec8ac5d70038c6b33009d0815d68e8c1d2a28cd80a16ef1473eba3927360903bcf6a74e8d5f71f09b5ff7919d908545211 DIST node-v13.12.0.tar.xz 32841080 BLAKE2B 64687e8d5b768f4571b53542bcf5d023953069eba5fdfb746a8dd29e4542141a9b57fc0524429cde9a3c2e579dd47128e06d46d1f3ae1a35326f8b69a750118f SHA512 3166da61a3d84fa9d4cbfc473df7441a6f7e648ad92b095cc357c2440214ddde117fb220270db8e0736eea3b715742f0d73666bba25724770e7e8f6071495d57 diff --git a/net-libs/nodejs/nodejs-12.16.2.ebuild b/net-libs/nodejs/nodejs-12.16.2.ebuild new file mode 100644 index 000000000000..0be68355a99b --- /dev/null +++ b/net-libs/nodejs/nodejs-12.16.2.ebuild @@ -0,0 +1,213 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +PYTHON_COMPAT=( python3_{6,7} ) +PYTHON_REQ_USE="threads(+)" +inherit bash-completion-r1 eutils flag-o-matic pax-utils python-any-r1 toolchain-funcs xdg-utils + +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" +HOMEPAGE="https://nodejs.org/" +SRC_URI=" + https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz +" + +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos" +IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl +system-ssl systemtap test" +REQUIRED_USE=" + inspector? ( icu ssl ) + npm? ( ssl ) + system-ssl? ( ssl ) +" + +RDEPEND=" + >=dev-libs/libuv-1.34.2:= + >=net-dns/c-ares-1.15.0 + >=net-libs/http-parser-2.9.3:= + >=net-libs/nghttp2-1.40.0 + sys-libs/zlib + icu? ( >=dev-libs/icu-64.2:= ) + system-ssl? ( >=dev-libs/openssl-1.1.1:0= ) +" +BDEPEND=" + ${PYTHON_DEPS} + systemtap? ( dev-util/systemtap ) + test? ( net-misc/curl ) +" +DEPEND=" + ${RDEPEND} +" +PATCHES=( + "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch + "${FILESDIR}"/${PN}-99999999-llhttp.patch +) +RESTRICT="test" +S="${WORKDIR}/node-v${PV}" + +pkg_pretend() { + (use x86 && ! use cpu_flags_x86_sse2) && \ + die "Your CPU doesn't support the required SSE2 instruction." + + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." +} + +src_prepare() { + tc-export 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 + + # Avoid a test that I've only been able to reproduce from emerge. It doesnt + # seem sandbox related either (invoking it from a sandbox works fine). + # The issue is that no stdin handle is openened when asked for one. + # It doesn't really belong upstream , so it'll just be removed until someone + # with more gentoo-knowledge than me (jbergstroem) figures it out. + rm test/parallel/test-stdout-close-unref.js || 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 + + default +} + +src_configure() { + xdg_environment_reset + + local myconf=( + --shared-cares + --shared-http-parser + --shared-libuv + --shared-nghttp2 + --shared-zlib + ) + use debug && myconf+=( --debug ) + use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none ) + 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 ${ABI} in + amd64) myarch="x64";; + arm) myarch="arm";; + arm64) myarch="arm64";; + 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 mksnapshot + pax-mark m "out/${BUILDTYPE}/mksnapshot" + 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 + dodir /etc/npm + + # Install bash completion for `npm` + # We need to temporarily replace default config path since + # npm otherwise tries to write outside of the sandbox + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die + local tmp_npm_completion_file="$(emktemp)" + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" + newbashcomp "${tmp_npm_completion_file}" npm + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die + + # Move man pages + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* + + # Clean up + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die + + 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 + + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die +} + +src_test() { + out/${BUILDTYPE}/cctest || die + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die +} + +pkg_postinst() { + elog "The global npm config lives in /etc/npm. This deviates slightly" + elog "from upstream which otherwise would have it live in /usr/etc/." + elog "" + elog "Protip: When using node-gyp to install native modules, you can" + elog "avoid having to download extras by doing the following:" + elog "$ node-gyp --nodedir /usr/include/node " +} -- cgit v1.2.3