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