From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1224146-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id DDA8E13835A
	for <garchives@archives.gentoo.org>; Sat, 21 Nov 2020 21:36:38 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 0A7F6E077A;
	Sat, 21 Nov 2020 21:36:38 +0000 (UTC)
Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id DC07AE077A
	for <gentoo-commits@lists.gentoo.org>; Sat, 21 Nov 2020 21:36:37 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 2CF3C340E22
	for <gentoo-commits@lists.gentoo.org>; Sat, 21 Nov 2020 21:36:36 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 6F379261
	for <gentoo-commits@lists.gentoo.org>; Sat, 21 Nov 2020 21:36:34 +0000 (UTC)
From: "Marek Szuba" <marecki@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Marek Szuba" <marecki@gentoo.org>
Message-ID: <1605994583.5d8c279936a29f2455ed9aa85ba735b77530cf7b.marecki@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/nodejs/files/, net-libs/nodejs/
X-VCS-Repository: repo/gentoo
X-VCS-Files: net-libs/nodejs/Manifest net-libs/nodejs/files/nodejs-15.2.0-global-npm-config.patch net-libs/nodejs/nodejs-15.2.1.ebuild
X-VCS-Directories: net-libs/nodejs/ net-libs/nodejs/files/
X-VCS-Committer: marecki
X-VCS-Committer-Name: Marek Szuba
X-VCS-Revision: 5d8c279936a29f2455ed9aa85ba735b77530cf7b
X-VCS-Branch: master
Date: Sat, 21 Nov 2020 21:36:34 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 57d4d39f-e5b5-446c-b421-d99c237c8323
X-Archives-Hash: 97a9a057a7eef59842823c1c47d7a42c

commit:     5d8c279936a29f2455ed9aa85ba735b77530cf7b
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 21 21:32:24 2020 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Sat Nov 21 21:36:23 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d8c2799

net-libs/nodejs: bump to 15.2.0

No PaX support yet, will be added separately.

Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 net-libs/nodejs/Manifest                           |   1 +
 .../files/nodejs-15.2.0-global-npm-config.patch    |  13 ++
 net-libs/nodejs/nodejs-15.2.1.ebuild               | 196 +++++++++++++++++++++
 3 files changed, 210 insertions(+)

diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
index b981c6dec8b..87cfe291987 100644
--- a/net-libs/nodejs/Manifest
+++ b/net-libs/nodejs/Manifest
@@ -1,3 +1,4 @@
 DIST node-v12.19.1.tar.xz 23829692 BLAKE2B 244ca8ef29e315ce027638d9d5c66469ac8cd69abec47d5bf6370b990da0d9d2a7af812963530e5187d273d3f20638be0d23ccb1c0409fbbd678677740939f4f SHA512 7c628ca214d3b17b34658aae32e335ce863d90853c92f1cd4119e9a82b7097ddf47d0d4cc7c9bbdbfdd4b403811aa6ee08e844078a947f31a3adc78f569b931a
 DIST node-v14.15.0.tar.xz 33440584 BLAKE2B dda9fb44f163b2268db126dfcda34e80064eba24921e4f8e6c14c212deb9170c79f31f7b2be272c8fa7ca992d14540df490c6cad078833514bd348825934ad95 SHA512 2a0cd1b9d95e0ac228a90aca82cb04b9f4fc4d08ab86f0286eed7a519ca6e756081b37375ad5d14d7f0e09affdd27bad658c3e364237eb3c212fe5b5e27af96e
 DIST node-v14.15.1.tar.xz 33437304 BLAKE2B f08251d2a76e4030433001fd7f062c71193de190036d1147ade0ea36350df0d65df9e1b749fbac77837dd090cbeda6c133ff88099691c932bc29e75b7bfa2acc SHA512 cbab757e370a09b73c29a9bcb310b4122e4424d6baeaeaf1b10919ed6b348bc6ddbfc0e0eaff99d8ebb4d3d74f0206f575e2656245151eda564dd2cd33ff823a
+DIST node-v15.2.1.tar.xz 33172472 BLAKE2B d63dbc138ec161253f996fb61c9f40db2eabb5a598804eca7f2446b654ae8a11164820d46ea3c2b41b6a891bb0a3f15fe67712988ed67c1344ab72e2e4749fac SHA512 b05663131d6bb458fe49cf610a7296cdd169b6e957df3e5117ad5553de9891ed4cb71c7d3dc0dbb7774153c884cf245f49faecfa308736086fe6f041f83c8a57

diff --git a/net-libs/nodejs/files/nodejs-15.2.0-global-npm-config.patch b/net-libs/nodejs/files/nodejs-15.2.0-global-npm-config.patch
new file mode 100644
index 00000000000..2b0705b1d71
--- /dev/null
+++ b/net-libs/nodejs/files/nodejs-15.2.0-global-npm-config.patch
@@ -0,0 +1,13 @@
+--- a/deps/npm/node_modules/@npmcli/config/lib/index.js
++++ b/deps/npm/node_modules/@npmcli/config/lib/index.js
+@@ -275,8 +275,9 @@
+     // default the globalconfig file to that location, instead of the default
+     // global prefix.  It's weird that `npm get globalconfig --prefix=/foo`
+     // returns `/foo/etc/npmrc`, but better to not change it at this point.
++    // gentoo deviates wrt global config; store in /etc/npm
+     settableGetter(data, 'globalconfig', () =>
+-      resolve(this[_get]('prefix'), 'etc/npmrc'))
++      resolve('/etc', 'npmrc'))
+   }
+ 
+   loadHome () {

diff --git a/net-libs/nodejs/nodejs-15.2.1.ebuild b/net-libs/nodejs/nodejs-15.2.1.ebuild
new file mode 100644
index 00000000000..a69a9626746
--- /dev/null
+++ b/net-libs/nodejs/nodejs-15.2.1.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_REQ_USE="threads(+)"
+
+inherit bash-completion-r1 flag-o-matic 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/$(ver_cut 1)"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x64-macos"
+
+IUSE="cpu_flags_x86_sse2 debug doc +icu inspector +npm +snapshot +ssl system-icu +system-ssl systemtap test"
+REQUIRED_USE="inspector? ( icu ssl )
+	npm? ( ssl )
+	system-icu? ( icu )
+	system-ssl? ( ssl )"
+
+# FIXME: test-fs-mkdir fails with "no such file or directory". Investigate.
+RESTRICT="test"
+
+RDEPEND=">=app-arch/brotli-1.0.9
+	>=dev-libs/libuv-1.40.0:=
+	>=net-dns/c-ares-1.17.0
+	>=net-libs/nghttp2-1.41.0
+	sys-libs/zlib
+	system-icu? ( >=dev-libs/icu-67:= )
+	system-ssl? ( >=dev-libs/openssl-1.1.1:0= )"
+BDEPEND="${PYTHON_DEPS}
+	sys-apps/coreutils
+	systemtap? ( dev-util/systemtap )
+	test? ( net-misc/curl )"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-15.2.0-global-npm-config.patch
+)
+
+S="${WORKDIR}/node-v${PV}"
+
+pkg_pretend() {
+	(use x86 && ! use cpu_flags_x86_sse2) && \
+		die "Your CPU doesn't support the required SSE2 instruction."
+}
+
+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
+
+	# 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-brotli
+		--shared-cares
+		--shared-libuv
+		--shared-nghttp2
+		--shared-zlib
+	)
+	use debug && myconf+=( --debug )
+	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 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
+}
+
+src_install() {
+	local LIBDIR="${ED}/usr/$(get_libdir)"
+	default
+
+	# 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
+
+		# 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 "${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
+	"${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
+}