Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/nodejs/
Date: Tue, 30 Nov 2021 00:50:06
Message-Id: 1638233366.0827d9a8ed0d817b3a83c2563280249a4de89aaf.williamh@gentoo
1 commit: 0827d9a8ed0d817b3a83c2563280249a4de89aaf
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 30 00:49:01 2021 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 30 00:49:26 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0827d9a8
7
8 net-libs/nodejs: 16.13.0 bump
9
10 Package-Manager: Portage-3.0.28, Repoman-3.0.3
11 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
12
13 net-libs/nodejs/Manifest | 1 +
14 net-libs/nodejs/nodejs-16.13.0.ebuild | 230 ++++++++++++++++++++++++++++++++++
15 2 files changed, 231 insertions(+)
16
17 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
18 index 7e133a410589..16cfd3dd9152 100644
19 --- a/net-libs/nodejs/Manifest
20 +++ b/net-libs/nodejs/Manifest
21 @@ -4,4 +4,5 @@ DIST node-v14.17.5.tar.xz 33585724 BLAKE2B cf79397caad8c81e4096f344f9fdb88d8ecea
22 DIST node-v14.17.6.tar.xz 33606464 BLAKE2B c2c449e5eaf8214d7ed4bfab8db0208034cee1d08ef0e1fca478c30fc5cf95be037eb141080dbcfbe4fc58ef734457747dcbd0fe585a0536f9c0bec495435f25 SHA512 581c5698112426042fbf54fa793e56a30cae0c54ce8f23af6ac20d73c69a4f1166c5410f357c5a7b0409a773f99e3b9291e4afffd53b3c0e00569725dc4c47d3
23 DIST node-v14.18.0.tar.xz 33698388 BLAKE2B 0a26aac559f2cd44d863b5375bc26692f1abf121c368df040041c9916e56410c3c919be377f099651e9a5e27bad972705d02a20f108f527cf23044e8ba95dd78 SHA512 0603e2466bf89b57e404e2992dda25012866a347489fb811a9757aea07056fc4f346236adf44a56d52c442f5f298f4dfdfc961f8582cd194d062beeb80c60cbf
24 DIST node-v16.10.0.tar.xz 34046720 BLAKE2B e745443a4707eca97ebfc0d3cb8e697f64cd3eb98a419debde79100291ab64306d2c7cbda6ce1bfe6174cbc53880ddbda2965b0b6b8aa4b4b278781f002da277 SHA512 278f3e29f14362c017fbfa768bf0aa54cd208048741622413a67d3277e35fbdbc099fb84ce1de77837616e0e6f485916ccc771a7bee0b2ac5d30b4d4a6cf94f6
25 +DIST node-v16.13.0.tar.xz 33502788 BLAKE2B d30a63e77ef3b423bfa3a43299f7f6576ee5b0544757d1dbf233cbbc4bc9c70971927283ca87497add5ed05c9bf5d5501b36992cd242468fcd12e7f950ee29c2 SHA512 5d840fa49e8e637398f20b166b590a57e1070fd04c62bcb9b2d56646cf5a97719a70dbd9e0e29a548a268ac84c9a6c63c02ed6d38536ed45d82ffb96896a61c0
26 DIST node-v16.9.1.tar.xz 34026992 BLAKE2B 8bb0d75ab91a00d5b03a31ded17a6b8845894630185d353ded616bf8435b672ea5cef06b4ca5bd01bb3536c5c50774f6ad0aa08a0fa8cbb00d8866e29561c2ab SHA512 e570c39fffa5d79c8d3fa1fe90ece53b22729af6e882416a35b54362be7169eeb3d37cf8be69ee1b748a981b1fbc725d8c85a739bc5cb0b22d6d2e313ab646ac
27
28 diff --git a/net-libs/nodejs/nodejs-16.13.0.ebuild b/net-libs/nodejs/nodejs-16.13.0.ebuild
29 new file mode 100644
30 index 000000000000..b7c26db64cbe
31 --- /dev/null
32 +++ b/net-libs/nodejs/nodejs-16.13.0.ebuild
33 @@ -0,0 +1,230 @@
34 +# Copyright 1999-2021 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +PYTHON_COMPAT=( python3_{8..10} )
40 +PYTHON_REQ_USE="threads(+)"
41 +
42 +inherit bash-completion-r1 flag-o-matic pax-utils python-any-r1 toolchain-funcs xdg-utils
43 +
44 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
45 +HOMEPAGE="https://nodejs.org/"
46 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
47 +
48 +if [[ ${PV} == *9999 ]]; then
49 + inherit git-r3
50 + EGIT_REPO_URI="https://github.com/nodejs/node"
51 + SLOT="0"
52 +else
53 + SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
54 + SLOT="0/$(ver_cut 1)"
55 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x64-macos"
56 + S="${WORKDIR}/node-v${PV}"
57 +fi
58 +
59 +IUSE="cpu_flags_x86_sse2 debug doc +icu inspector lto +npm pax-kernel +snapshot +ssl +system-icu +system-ssl systemtap test"
60 +REQUIRED_USE="inspector? ( icu ssl )
61 + npm? ( ssl )
62 + system-icu? ( icu )
63 + system-ssl? ( ssl )"
64 +
65 +RESTRICT="!test? ( test )"
66 +
67 +RDEPEND=">=app-arch/brotli-1.0.9:=
68 + >=dev-libs/libuv-1.40.0:=
69 + >=net-dns/c-ares-1.17.2:=
70 + >=net-libs/nghttp2-1.41.0:=
71 + sys-libs/zlib
72 + system-icu? ( >=dev-libs/icu-67:= )
73 + system-ssl? ( >=dev-libs/openssl-1.1.1:0= )"
74 +BDEPEND="${PYTHON_DEPS}
75 + sys-apps/coreutils
76 + virtual/pkgconfig
77 + systemtap? ( dev-util/systemtap )
78 + test? ( net-misc/curl )
79 + pax-kernel? ( sys-apps/elfix )"
80 +DEPEND="${RDEPEND}"
81 +
82 +PATCHES=(
83 + "${FILESDIR}"/${PN}-12.22.5-shared_c-ares_nameser_h.patch
84 + "${FILESDIR}"/${PN}-15.2.0-global-npm-config.patch
85 +)
86 +
87 +pkg_pretend() {
88 + (use x86 && ! use cpu_flags_x86_sse2) && \
89 + die "Your CPU doesn't support the required SSE2 instruction."
90 +
91 + if [[ ${MERGE_TYPE} != "binary" ]]; then
92 + if use lto; then
93 + if tc-is-gcc; then
94 + if [[ $(gcc-major-version) -ge 11 ]]; then
95 + # Bug #787158
96 + 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"
97 + fi
98 + fi
99 + fi
100 + fi
101 +}
102 +
103 +src_prepare() {
104 + tc-export AR CC CXX PKG_CONFIG
105 + export V=1
106 + export BUILDTYPE=Release
107 +
108 + # fix compilation on Darwin
109 + # https://code.google.com/p/gyp/issues/detail?id=260
110 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
111 +
112 + # less verbose install output (stating the same as portage, basically)
113 + sed -i -e "/print/d" tools/install.py || die
114 +
115 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
116 + local LIBDIR=$(get_libdir)
117 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
118 + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
119 +
120 + # Avoid writing a depfile, not useful
121 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
122 +
123 + sed -i -e "/'-O3'/d" common.gypi node.gypi || die
124 +
125 + # debug builds. change install path, remove optimisations and override buildtype
126 + if use debug; then
127 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
128 + BUILDTYPE=Debug
129 + fi
130 +
131 + # We need to disable mprotect on two files when it builds Bug 694100.
132 + use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-13.8.0-paxmarking.patch )
133 +
134 + # All this test does is check if the npm CLI produces warnings of any sort,
135 + # failing if it does. Overkill, much? Especially given one possible warning
136 + # is that there is a newer version of npm available upstream (yes, it does
137 + # use the network if available), thus making it a real possibility for this
138 + # test to begin failing one day even though it was fine before.
139 + rm -f test/parallel/test-release-npm.js
140 +
141 + default
142 +}
143 +
144 +src_configure() {
145 + xdg_environment_reset
146 +
147 + # LTO compiler flags are handled by configure.py itself
148 + filter-flags '-flto*'
149 +
150 + local myconf=(
151 + --shared-brotli
152 + --shared-cares
153 + --shared-libuv
154 + --shared-nghttp2
155 + --shared-zlib
156 + )
157 + use debug && myconf+=( --debug )
158 + use lto && myconf+=( --enable-lto )
159 + if use system-icu; then
160 + myconf+=( --with-intl=system-icu )
161 + elif use icu; then
162 + myconf+=( --with-intl=full-icu )
163 + else
164 + myconf+=( --with-intl=none )
165 + fi
166 + use inspector || myconf+=( --without-inspector )
167 + use npm || myconf+=( --without-npm )
168 + use snapshot || myconf+=( --without-node-snapshot )
169 + if use ssl; then
170 + use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store )
171 + else
172 + myconf+=( --without-ssl )
173 + fi
174 +
175 + local myarch=""
176 + case ${ABI} in
177 + amd64) myarch="x64";;
178 + arm) myarch="arm";;
179 + arm64) myarch="arm64";;
180 + lp64*) myarch="riscv64";;
181 + ppc64) myarch="ppc64";;
182 + x32) myarch="x32";;
183 + x86) myarch="ia32";;
184 + *) myarch="${ABI}";;
185 + esac
186 +
187 + GYP_DEFINES="linux_use_gold_flags=0
188 + linux_use_bundled_binutils=0
189 + linux_use_bundled_gold=0" \
190 + "${EPYTHON}" configure.py \
191 + --prefix="${EPREFIX}"/usr \
192 + --dest-cpu=${myarch} \
193 + $(use_with systemtap dtrace) \
194 + "${myconf[@]}" || die
195 +}
196 +
197 +src_compile() {
198 + emake -C out
199 +}
200 +
201 +src_install() {
202 + local LIBDIR="${ED}/usr/$(get_libdir)"
203 + default
204 +
205 + pax-mark -m "${ED}"/usr/bin/node
206 +
207 + # set up a symlink structure that node-gyp expects..
208 + dodir /usr/include/node/deps/{v8,uv}
209 + dosym . /usr/include/node/src
210 + for var in deps/{uv,v8}/include; do
211 + dosym ../.. /usr/include/node/${var}
212 + done
213 +
214 + if use doc; then
215 + docinto html
216 + dodoc -r "${S}"/doc/*
217 + fi
218 +
219 + if use npm; then
220 + keepdir /etc/npm
221 +
222 + # Install bash completion for `npm`
223 + local tmp_npm_completion_file="$(TMPDIR="${T}" mktemp -t npm.XXXXXXXXXX)"
224 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
225 + newbashcomp "${tmp_npm_completion_file}" npm
226 +
227 + # Move man pages
228 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
229 +
230 + # Clean up
231 + rm -f "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile}
232 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man}
233 +
234 + local find_exp="-or -name"
235 + local find_name=()
236 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
237 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
238 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
239 + find_name+=( ${find_exp} "${match}" )
240 + done
241 +
242 + # Remove various development and/or inappropriate files and
243 + # useless docs of dependend packages.
244 + find "${LIBDIR}"/node_modules \
245 + \( -type d -name examples \) -or \( -type f \( \
246 + -iname "LICEN?E*" \
247 + "${find_name[@]}" \
248 + \) \) -exec rm -rf "{}" \;
249 + fi
250 +
251 + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
252 +}
253 +
254 +src_test() {
255 + if has usersandbox ${FEATURES}; then
256 + rm -f "${S}"/test/parallel/test-fs-mkdir.js
257 + ewarn "You are emerging ${PN} with 'usersandbox' enabled. Excluding tests known to fail in this mode." \
258 + "For full test coverage, emerge =${CATEGORY}/${PF} with 'FEATURES=-usersandbox'."
259 + fi
260 +
261 + out/${BUILDTYPE}/cctest || die
262 + "${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} --flaky-tests=dontcare -J message parallel sequential || die
263 +}