public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/nodejs/, net-libs/nodejs/files/
Date: Thu, 17 Mar 2022 21:39:33 +0000 (UTC)	[thread overview]
Message-ID: <1647553158.4d409d22398cb3d4937d00663d3fdaed05f19763.williamh@gentoo> (raw)

commit:     4d409d22398cb3d4937d00663d3fdaed05f19763
Author:     William Hubbs <williamh <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 21:39:18 2022 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Mar 17 21:39:18 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d409d22

net-libs/nodejs: add 14.19.0

Bug: https://bugs.gentoo.org/831037
Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 net-libs/nodejs/Manifest                           |   1 +
 .../files/nodejs-14.19.0-global-npm-config.patch   |  20 ++
 net-libs/nodejs/nodejs-14.19.0.ebuild              | 241 +++++++++++++++++++++
 3 files changed, 262 insertions(+)

diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
index 12b01fcf7686..4877d0318846 100644
--- a/net-libs/nodejs/Manifest
+++ b/net-libs/nodejs/Manifest
@@ -5,6 +5,7 @@ DIST node-v14.17.5.tar.xz 33585724 BLAKE2B cf79397caad8c81e4096f344f9fdb88d8ecea
 DIST node-v14.17.6.tar.xz 33606464 BLAKE2B c2c449e5eaf8214d7ed4bfab8db0208034cee1d08ef0e1fca478c30fc5cf95be037eb141080dbcfbe4fc58ef734457747dcbd0fe585a0536f9c0bec495435f25 SHA512 581c5698112426042fbf54fa793e56a30cae0c54ce8f23af6ac20d73c69a4f1166c5410f357c5a7b0409a773f99e3b9291e4afffd53b3c0e00569725dc4c47d3
 DIST node-v14.18.0.tar.xz 33698388 BLAKE2B 0a26aac559f2cd44d863b5375bc26692f1abf121c368df040041c9916e56410c3c919be377f099651e9a5e27bad972705d02a20f108f527cf23044e8ba95dd78 SHA512 0603e2466bf89b57e404e2992dda25012866a347489fb811a9757aea07056fc4f346236adf44a56d52c442f5f298f4dfdfc961f8582cd194d062beeb80c60cbf
 DIST node-v14.18.1.tar.xz 33693816 BLAKE2B 310a53a7319620d8ff77b4e5947c7f2196efe96eb0d4311c8fb91b500331128750096e7b0471def73bee00cfa6a9da968cc8176b1d46d06d14c3409dedb9203b SHA512 a92d6f392e960008efd0c1f48471a3e294aa5292065fb31acc62723e8924f7f1a22bb02f3ab51a440f6e190bdee3c1667a275808c6b76d053a77aa6d7ad68aef
+DIST node-v14.19.0.tar.xz 34486868 BLAKE2B 12e571a366c1d4b2475ef258e338f516bb81e9c08f7e6b7f951decbf371028cdcf32c72181d8504d0890496eaecce0d6b23437b8dad6c6e498d30bf6636bd1e7 SHA512 80573fa3a0882c1f2a40b991f187f49714748ca4c56c78133e2d2be0322f201816eb059a1a7d38ea8a925229c1b1324d0ffc28ff4002d0115bfae44fe87efe97
 DIST node-v16.10.0.tar.xz 34046720 BLAKE2B e745443a4707eca97ebfc0d3cb8e697f64cd3eb98a419debde79100291ab64306d2c7cbda6ce1bfe6174cbc53880ddbda2965b0b6b8aa4b4b278781f002da277 SHA512 278f3e29f14362c017fbfa768bf0aa54cd208048741622413a67d3277e35fbdbc099fb84ce1de77837616e0e6f485916ccc771a7bee0b2ac5d30b4d4a6cf94f6
 DIST node-v16.13.0.tar.xz 33502788 BLAKE2B d30a63e77ef3b423bfa3a43299f7f6576ee5b0544757d1dbf233cbbc4bc9c70971927283ca87497add5ed05c9bf5d5501b36992cd242468fcd12e7f950ee29c2 SHA512 5d840fa49e8e637398f20b166b590a57e1070fd04c62bcb9b2d56646cf5a97719a70dbd9e0e29a548a268ac84c9a6c63c02ed6d38536ed45d82ffb96896a61c0
 DIST node-v16.13.1.tar.xz 33907544 BLAKE2B 9243145f53619cb8285dc686d30317b71f474e67853eb16266b4bf4f2af2f81ad1d78d39ffa70024c4a99612230f07605fce69674a5b12013291e7746252dbc4 SHA512 bb0739089965785dff59721303ac68605a459d40318e1eada071c720e1499569cefb61a59a378062794d8533b8d54b8d5fef0e380f7e159206a89b0bb0b9cebf

diff --git a/net-libs/nodejs/files/nodejs-14.19.0-global-npm-config.patch b/net-libs/nodejs/files/nodejs-14.19.0-global-npm-config.patch
new file mode 100644
index 000000000000..09d9dbe47be0
--- /dev/null
+++ b/net-libs/nodejs/files/nodejs-14.19.0-global-npm-config.patch
@@ -0,0 +1,20 @@
+diff --git a/deps/npm/lib/config/core.js b/deps/npm/lib/config/core.js
+index 36420b3450..0afb0b6792 100644
+--- a/deps/npm/lib/config/core.js
++++ b/deps/npm/lib/config/core.js
+@@ -151,11 +151,10 @@ function load_ (builtin, rc, cli, cb) {
+     // Eg, `npm config get globalconfig --prefix ~/local` should
+     // return `~/local/etc/npmrc`
+     // annoying humans and their expectations!
+-    if (conf.get('prefix')) {
+-      var etc = path.resolve(conf.get('prefix'), 'etc')
+-      defaults.globalconfig = path.resolve(etc, 'npmrc')
+-      defaults.globalignorefile = path.resolve(etc, 'npmignore')
+-    }
++    // gentoo deviates wrt global config; store in /etc/npm
++    var globalconfig = path.resolve('/etc', 'npm')
++    defaults.globalconfig = path.resolve(globalconfig, 'npmrc')
++    defaults.globalignorefile = path.resolve(globalconfig, 'npmignore')
+ 
+     conf.addFile(conf.get('globalconfig'), 'global')
+ 

diff --git a/net-libs/nodejs/nodejs-14.19.0.ebuild b/net-libs/nodejs/nodejs-14.19.0.ebuild
new file mode 100644
index 000000000000..b20f2cfef7e5
--- /dev/null
+++ b/net-libs/nodejs/nodejs-14.19.0.ebuild
@@ -0,0 +1,241 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_REQ_USE="threads(+)"
+
+inherit bash-completion-r1 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/"
+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 ~ppc64 -riscv ~x86 ~amd64-linux ~x64-macos"
+	S="${WORKDIR}/node-v${PV}"
+fi
+
+IUSE="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.40.0:=
+	>=net-dns/c-ares-1.17.2:=
+	>=net-libs/nghttp2-1.41.0:=
+	sys-libs/zlib
+	system-icu? ( >=dev-libs/icu-67:= )
+	system-ssl? (
+		>=dev-libs/openssl-1.1.1:0=
+		<dev-libs/openssl-3.0.0_beta1:0=
+	)"
+BDEPEND="${PYTHON_DEPS}
+	sys-apps/coreutils
+	virtual/pkgconfig
+	systemtap? ( dev-util/systemtap )
+	test? ( net-misc/curl )
+	pax-kernel? ( sys-apps/elfix )"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-12.22.5-shared_c-ares_nameser_h.patch
+	"${FILESDIR}"/${PN}-14.15.0-fix_ppc64_crashes.patch
+	"${FILESDIR}"/${P}-global-npm-config.patch
+)
+
+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 use lto; then
+			if tc-is-gcc; then
+				if [[ $(gcc-major-version) -ge 11 ]]; then
+					# Bug #787158
+					die "LTO builds of ${PN} using gcc-11+ currently fail tests and produce runtime errors. Either switch to gcc-10 or unset USE=lto for this ebuild"
+				fi
+			else
+				# configure.py will abort on this later if we do not
+				die "${PN} only supports LTO for gcc"
+			fi
+		fi
+	fi
+}
+
+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}-13.8.0-paxmarking.patch )
+
+	# All this test does is check if the npm CLI produces warnings of any sort,
+	# failing if it does. Overkill, much? Especially given one possible warning
+	# is that there is a newer version of npm available upstream (yes, it does
+	# use the network if available), thus making it a real possibility for this
+	# test to begin failing one day even though it was fine before.
+	rm -f test/parallel/test-release-npm.js
+
+	default
+}
+
+src_configure() {
+	xdg_environment_reset
+
+	# LTO compiler flags are handled by configure.py itself
+	filter-flags '-flto*'
+
+	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 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
+
+	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="$(TMPDIR="${T}" mktemp -t npm.XXXXXXXXXX)"
+		"${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 -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
+
+	mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
+}
+
+src_test() {
+	if has usersandbox ${FEATURES}; then
+		rm -f "${S}"/test/parallel/test-fs-mkdir.js
+		ewarn "You are emerging ${PN} with 'usersandbox' enabled. Excluding tests known to fail in this mode." \
+			"For full test coverage, emerge =${CATEGORY}/${PF} with 'FEATURES=-usersandbox'."
+	fi
+
+	out/${BUILDTYPE}/cctest || die
+	"${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} --flaky-tests=dontcare -J message parallel sequential || die
+}


             reply	other threads:[~2022-03-17 21:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 21:39 William Hubbs [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-25 16:45 [gentoo-commits] repo/gentoo:master commit in: net-libs/nodejs/, net-libs/nodejs/files/ Jakov Smolić
2024-02-04  0:37 Jakov Smolić
2024-01-22 21:16 William Hubbs
2023-11-02 21:34 William Hubbs
2023-08-09 19:21 William Hubbs
2023-06-10 19:32 William Hubbs
2023-05-05 15:16 William Hubbs
2023-04-30  1:24 William Hubbs
2022-05-06  5:21 Joonas Niilola
2021-09-16 16:42 Marek Szuba
2021-08-13 17:36 Marek Szuba
2021-05-13 21:36 Marek Szuba
2021-05-13 15:30 Georgy Yakovlev
2021-04-22 15:27 Marek Szuba
2021-04-20 17:48 Marek Szuba
2020-11-20 20:28 William Hubbs
2020-08-27 17:48 Jeroen Roovers
2020-02-17  0:38 Magnus Granberg
2018-12-13 12:12 Jeroen Roovers
2018-12-09 14:59 Jeroen Roovers
2018-05-30  7:46 Jeroen Roovers
2017-11-02 22:59 Jeroen Roovers
2017-11-01 11:42 Jeroen Roovers
2016-02-11 12:07 Patrick Lauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1647553158.4d409d22398cb3d4937d00663d3fdaed05f19763.williamh@gentoo \
    --to=williamh@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox