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