Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/nodejs/
Date: Thu, 06 Feb 2020 10:04:04
Message-Id: 1580983434.96189439cfa4dfd23cbfafb931588a2f9100832a.jer@gentoo
1 commit: 96189439cfa4dfd23cbfafb931588a2f9100832a
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 6 10:03:24 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 6 10:03:54 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96189439
7
8 net-libs/nodejs: Versions 10.19.0 12.15.0 13.8.0
9
10 Package-Manager: Portage-2.3.87, Repoman-2.3.20
11 Bug: https://bugs.gentoo.org/708458
12 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
13
14 net-libs/nodejs/Manifest | 3 +
15 net-libs/nodejs/nodejs-10.19.0.ebuild | 200 ++++++++++++++++++++++++++++++++
16 net-libs/nodejs/nodejs-12.15.0.ebuild | 208 ++++++++++++++++++++++++++++++++++
17 net-libs/nodejs/nodejs-13.8.0.ebuild | 204 +++++++++++++++++++++++++++++++++
18 4 files changed, 615 insertions(+)
19
20 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
21 index 01e36edd74c..ccd85f63cac 100644
22 --- a/net-libs/nodejs/Manifest
23 +++ b/net-libs/nodejs/Manifest
24 @@ -1,8 +1,11 @@
25 DIST node-v10.18.0.tar.xz 21913328 BLAKE2B 84b0b5157671dcc3e96bb2cfd11e085251fd2942c03b27491f712f5603797bab7503d8f7c0eb45ca8e348b20a0555c1767d4d1964fff474c8590a47eb01523a5 SHA512 8fc9062e150af6f054f1ebebbdf67151b16f14bcca9cbb35338a4c7fcd7fa1c3f05c4a7ace12d4153180cec0007a195cbc94942c4d04c3895384dc18951d2c1c
26 DIST node-v10.18.1.tar.xz 21920068 BLAKE2B 9dc0887a33f0888a347628e5bf15eb3687f15cba264a00317a15336fda48e41da9b4c45df6d0f223f2017c6b55b99eda0c4cd6f5913673da29c52a61450d03e2 SHA512 0979d264ef5286caea61a527771e2ac2fbe1b909a151061dbb7d9e0fde9461edd76b6060f55cfbd49d3ae2e7e10595a2eb4d2e98182e735e7df10940120fb9b6
27 +DIST node-v10.19.0.tar.xz 21906168 BLAKE2B 395504ef3befa47d8b967114e019e6a76c799871e7eb21e2c6c0453655ffa07f17f42209daddeb5417342cfbad71ba1a35ae15a2d210b692bc60be270c2fc415 SHA512 512efc58415ed789938c434af131d76bdd51772cac9f7e380afaa79d83cc9c433a979068fc7272adba6ba6551d195267978e1fc819236926b0d1fd6cf91c5eee
28 DIST node-v12.14.0.tar.xz 23244684 BLAKE2B 0e25cbba5e256b139efd45908236f008834afdf01f57a8e84c7e55ba950e56b786cd52eba9a02986eb0e1d38cbf6df38e1cd719d7dcd8085e8c71767adf8155e SHA512 12e887709a54be911c5a81ab7b7be995247b47ebbd2954ca942f9ed8a784ae1a8e4bdb2613e5bb671196f9101d8861cd29e10650a3f0c414db4d096df94b309b
29 DIST node-v12.14.1.tar.xz 23258936 BLAKE2B 125289ce3e342c2e5e7bbb6f0b1af109f0ba8fbf2d6630f2cdc4aa31c25a3d846afe773e84daed9824360a6680a2d21378af4fbc42c6337399a143f92850a82f SHA512 2e2b6fa8351b59450ab5491b5e31dc36ce4d9be13c55a14e6e4d95a82cc8334f9fc35261a56a8843903f8021ff333a333bb4d5f24c92b5d7483d4779c3d88342
30 +DIST node-v12.15.0.tar.xz 23271600 BLAKE2B 20e31e2ecb6352f6fa9e2c60fc505046034434e287e827edd5e0b091c4d5e124b681ba178e1669db26ab3d1b588e3b0894595e9cd1fa46d560f7100d8ab7e1c1 SHA512 40cc5fc252e8939856886cd57cad50df11eedc37de8e50b1b2d49a2e7439d1f4bbba8de90efc030a659919106eca72facf8b31280323fc4803bed9a175ffbbfa
31 DIST node-v13.6.0.tar.xz 32706824 BLAKE2B 69e66354570e057fe215830a2d5bd157e5decfd1e58e4ead4304e0dfcf64e5adfe48503f3bf54afe2cc27df581a0f2ae79e9b730257ceb70c412bd2a47fa5603 SHA512 e7dc8356ac1b167cc32055e209f13cee82c9251440b6a6cc99b26c91f9625e11bd025cfc1c22b6ece95ea178640209a7c8700d678678b3e8bad26080aa2762c6
32 DIST node-v13.7.0.tar.xz 32739116 BLAKE2B 2bc4331a059d18f37f41bb472bb19d864366cebae32b6be18d9c14ab91019fbfa6dcb2a8c3c1c256ddd54773d801e852e1820d90bc3b55f3509bfa8e5425121d SHA512 e2a9b0b6c6e038b9c5c55b51531ed30e8767dd492d3c5c50a0de764f7a97f22a3fcb65c4f50adff62219b076e0c688f1320dc87061fbb751a867746e22c60ccf
33 +DIST node-v13.8.0.tar.xz 32745596 BLAKE2B 14bf82e8cecde1a4125c7c00c4c9e613c1dbc5bb0241b20f4d30cb8d172612d5a8c362ac786ae516baf9553d5a9c3053414b269fb040cebb664f09096a57985c SHA512 b50d79f029bc04caf193f137b7b3d03f1e1ec9252712015cab2efdeef92bc3176cf7eb36e835cda6221950792e516f9c1894cd2c480e082106e07a11aa1d0761
34 DIST node-v8.12.0.tar.xz 18310452 BLAKE2B 79634fc57cd76a97e72bab4be37da91d5eff4d13cdaa2b48e83f013885fa3590ba4a28378baf036ed26b7304bf234753d1d4014f72571496f5bb6cd5b221e5f0 SHA512 665d2dba287d78bcd723d7b4d00a6897fb996f4aa69a541e010a3dfeb2614257892117fcce7123966b1ecaddc9269a6667e0e262df693baea1f476c96de55c42
35 DIST node-v8.17.0.tar.xz 19013844 BLAKE2B 2f35f61ccc2d67132441dace8b59df6565e5df9e14e6798ab0cb0a024493182881708368248964db30e1213fa7b66301bd73b5146944129d7b14cd2b5b1a9583 SHA512 9f7b0b5695e882b4f727802ad855d398da596f908e64263902781e01f6222a4044be48c104eb76182ddb525dedfc4b28ccd07d64dfa126c462a248d9e8b49fca
36
37 diff --git a/net-libs/nodejs/nodejs-10.19.0.ebuild b/net-libs/nodejs/nodejs-10.19.0.ebuild
38 new file mode 100644
39 index 00000000000..9134f5e478f
40 --- /dev/null
41 +++ b/net-libs/nodejs/nodejs-10.19.0.ebuild
42 @@ -0,0 +1,200 @@
43 +# Copyright 1999-2020 Gentoo Authors
44 +# Distributed under the terms of the GNU General Public License v2
45 +
46 +EAPI=7
47 +PYTHON_COMPAT=( python2_7 )
48 +PYTHON_REQ_USE="threads"
49 +inherit bash-completion-r1 flag-o-matic pax-utils python-any-r1 toolchain-funcs xdg-utils
50 +
51 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
52 +HOMEPAGE="https://nodejs.org/"
53 +SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
54 +
55 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
56 +SLOT="0"
57 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos"
58 +IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test"
59 +REQUIRED_USE="
60 + inspector? ( icu ssl )
61 + npm? ( ssl )
62 +"
63 +
64 +RDEPEND="
65 + >=dev-libs/libuv-1.28.0:=
66 + >=net-dns/c-ares-1.15.0
67 + >=net-libs/http-parser-2.9.3:=
68 + >=net-libs/nghttp2-1.39.2
69 + sys-libs/zlib
70 + icu? ( >=dev-libs/icu-64.2:= )
71 + ssl? ( >=dev-libs/openssl-1.1.1:0= )
72 +"
73 +DEPEND="
74 + ${RDEPEND}
75 + ${PYTHON_DEPS}
76 + systemtap? ( dev-util/systemtap )
77 + test? ( net-misc/curl )
78 +"
79 +PATCHES=(
80 + "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
81 +)
82 +RESTRICT="test"
83 +S="${WORKDIR}/node-v${PV}"
84 +
85 +pkg_pretend() {
86 + (use x86 && ! use cpu_flags_x86_sse2) && \
87 + die "Your CPU doesn't support the required SSE2 instruction."
88 +
89 + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \
90 + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
91 +}
92 +
93 +src_prepare() {
94 + tc-export CC CXX PKG_CONFIG
95 + export V=1
96 + export BUILDTYPE=Release
97 +
98 + # fix compilation on Darwin
99 + # https://code.google.com/p/gyp/issues/detail?id=260
100 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
101 +
102 + # make sure we use python2.* while using gyp
103 + sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
104 + sed -i -e "s/|| 'python2'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
105 +
106 + # less verbose install output (stating the same as portage, basically)
107 + sed -i -e "/print/d" tools/install.py || die
108 +
109 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
110 + local LIBDIR=$(get_libdir)
111 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
112 + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
113 +
114 + # Avoid writing a depfile, not useful
115 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
116 +
117 + sed -i -e "/'-O3'/d" common.gypi deps/v8/gypfiles/toolchain.gypi || die
118 +
119 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
120 + # seem sandbox related either (invoking it from a sandbox works fine).
121 + # The issue is that no stdin handle is openened when asked for one.
122 + # It doesn't really belong upstream , so it'll just be removed until someone
123 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
124 + rm test/parallel/test-stdout-close-unref.js || die
125 +
126 + # debug builds. change install path, remove optimisations and override buildtype
127 + if use debug; then
128 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
129 + BUILDTYPE=Debug
130 + fi
131 +
132 + default
133 +}
134 +
135 +src_configure() {
136 + xdg_environment_reset
137 +
138 + local myconf=( --shared-cares --shared-http-parser --shared-libuv --shared-nghttp2 --shared-zlib )
139 + use debug && myconf+=( --debug )
140 + use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none )
141 + use inspector || myconf+=( --without-inspector )
142 + use npm || myconf+=( --without-npm )
143 + use snapshot && myconf+=( --with-snapshot )
144 + use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl )
145 +
146 + local myarch=""
147 + case ${ABI} in
148 + amd64) myarch="x64";;
149 + arm) myarch="arm";;
150 + arm64) myarch="arm64";;
151 + ppc64) myarch="ppc64";;
152 + x32) myarch="x32";;
153 + x86) myarch="ia32";;
154 + *) myarch="${ABI}";;
155 + esac
156 +
157 + GYP_DEFINES="linux_use_gold_flags=0
158 + linux_use_bundled_binutils=0
159 + linux_use_bundled_gold=0" \
160 + "${PYTHON}" configure \
161 + --prefix="${EPREFIX}"/usr \
162 + --dest-cpu=${myarch} \
163 + $(use_with systemtap dtrace) \
164 + "${myconf[@]}" || die
165 +}
166 +
167 +src_compile() {
168 + emake -C out mksnapshot
169 + pax-mark m "out/${BUILDTYPE}/mksnapshot"
170 + emake -C out
171 +}
172 +
173 +src_install() {
174 + local LIBDIR="${ED}/usr/$(get_libdir)"
175 + emake install DESTDIR="${D}"
176 + pax-mark -m "${ED}"/usr/bin/node
177 +
178 + # set up a symlink structure that node-gyp expects..
179 + dodir /usr/include/node/deps/{v8,uv}
180 + dosym . /usr/include/node/src
181 + for var in deps/{uv,v8}/include; do
182 + dosym ../.. /usr/include/node/${var}
183 + done
184 +
185 + if use doc; then
186 + docinto html
187 + dodoc -r "${S}"/doc/*
188 + fi
189 +
190 + if use npm; then
191 + dodir /etc/npm
192 +
193 + # Install bash completion for `npm`
194 + # We need to temporarily replace default config path since
195 + # npm otherwise tries to write outside of the sandbox
196 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
197 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
198 + local tmp_npm_completion_file="$(emktemp)"
199 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
200 + newbashcomp "${tmp_npm_completion_file}" npm
201 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
202 +
203 + # Move man pages
204 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
205 +
206 + # Clean up
207 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
208 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
209 +
210 + local find_exp="-or -name"
211 + local find_name=()
212 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
213 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
214 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
215 + find_name+=( ${find_exp} "${match}" )
216 + done
217 +
218 + # Remove various development and/or inappropriate files and
219 + # useless docs of dependend packages.
220 + find "${LIBDIR}"/node_modules \
221 + \( -type d -name examples \) -or \( -type f \( \
222 + -iname "LICEN?E*" \
223 + "${find_name[@]}" \
224 + \) \) -exec rm -rf "{}" \;
225 + fi
226 +
227 + mv "${D}"/usr/share/doc/node "${D}"/usr/share/doc/${PF} || die
228 +}
229 +
230 +src_test() {
231 + out/${BUILDTYPE}/cctest || die
232 + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
233 +}
234 +
235 +pkg_postinst() {
236 + einfo "The global npm config lives in /etc/npm. This deviates slightly"
237 + einfo "from upstream which otherwise would have it live in /usr/etc/."
238 + einfo ""
239 + einfo "Protip: When using node-gyp to install native modules, you can"
240 + einfo "avoid having to download extras by doing the following:"
241 + einfo "$ node-gyp --nodedir /usr/include/node <command>"
242 +}
243
244 diff --git a/net-libs/nodejs/nodejs-12.15.0.ebuild b/net-libs/nodejs/nodejs-12.15.0.ebuild
245 new file mode 100644
246 index 00000000000..217d400d971
247 --- /dev/null
248 +++ b/net-libs/nodejs/nodejs-12.15.0.ebuild
249 @@ -0,0 +1,208 @@
250 +# Copyright 1999-2020 Gentoo Authors
251 +# Distributed under the terms of the GNU General Public License v2
252 +
253 +EAPI=7
254 +PYTHON_COMPAT=( python{2_7,3_{6,7}} )
255 +PYTHON_REQ_USE="threads(+)"
256 +inherit bash-completion-r1 flag-o-matic pax-utils python-any-r1 toolchain-funcs xdg-utils
257 +
258 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
259 +HOMEPAGE="https://nodejs.org/"
260 +SRC_URI="
261 + https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz
262 +"
263 +
264 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
265 +SLOT="0"
266 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos"
267 +IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test"
268 +REQUIRED_USE="
269 + inspector? ( icu ssl )
270 + npm? ( ssl )
271 +"
272 +
273 +RDEPEND="
274 + >=dev-libs/libuv-1.33.1:=
275 + >=net-dns/c-ares-1.15.0
276 + >=net-libs/http-parser-2.9.3:=
277 + >=net-libs/nghttp2-1.40.0
278 + sys-libs/zlib
279 + icu? ( >=dev-libs/icu-64.2:= )
280 + ssl? ( >=dev-libs/openssl-1.1.1:0= )
281 +"
282 +BDEPEND="
283 + ${PYTHON_DEPS}
284 + systemtap? ( dev-util/systemtap )
285 + test? ( net-misc/curl )
286 +"
287 +DEPEND="
288 + ${RDEPEND}
289 +"
290 +PATCHES=(
291 + "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
292 + "${FILESDIR}"/${PN}-99999999-llhttp.patch
293 +)
294 +RESTRICT="test"
295 +S="${WORKDIR}/node-v${PV}"
296 +
297 +pkg_pretend() {
298 + (use x86 && ! use cpu_flags_x86_sse2) && \
299 + die "Your CPU doesn't support the required SSE2 instruction."
300 +
301 + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \
302 + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
303 +}
304 +
305 +src_prepare() {
306 + tc-export CC CXX PKG_CONFIG
307 + export V=1
308 + export BUILDTYPE=Release
309 +
310 + # fix compilation on Darwin
311 + # https://code.google.com/p/gyp/issues/detail?id=260
312 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
313 +
314 + # less verbose install output (stating the same as portage, basically)
315 + sed -i -e "/print/d" tools/install.py || die
316 +
317 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
318 + local LIBDIR=$(get_libdir)
319 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
320 + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
321 +
322 + # Avoid writing a depfile, not useful
323 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
324 +
325 + sed -i -e "/'-O3'/d" common.gypi node.gypi || die
326 +
327 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
328 + # seem sandbox related either (invoking it from a sandbox works fine).
329 + # The issue is that no stdin handle is openened when asked for one.
330 + # It doesn't really belong upstream , so it'll just be removed until someone
331 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
332 + rm test/parallel/test-stdout-close-unref.js || die
333 +
334 + # debug builds. change install path, remove optimisations and override buildtype
335 + if use debug; then
336 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
337 + BUILDTYPE=Debug
338 + fi
339 +
340 + default
341 +}
342 +
343 +src_configure() {
344 + xdg_environment_reset
345 +
346 + local myconf=(
347 + --shared-cares
348 + --shared-http-parser
349 + --shared-libuv
350 + --shared-nghttp2
351 + --shared-zlib
352 + )
353 + use debug && myconf+=( --debug )
354 + use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none )
355 + use inspector || myconf+=( --without-inspector )
356 + use npm || myconf+=( --without-npm )
357 + use snapshot || myconf+=( --without-node-snapshot )
358 + use ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store ) || myconf+=( --without-ssl )
359 +
360 + local myarch=""
361 + case ${ABI} in
362 + amd64) myarch="x64";;
363 + arm) myarch="arm";;
364 + arm64) myarch="arm64";;
365 + ppc64) myarch="ppc64";;
366 + x32) myarch="x32";;
367 + x86) myarch="ia32";;
368 + *) myarch="${ABI}";;
369 + esac
370 +
371 + GYP_DEFINES="linux_use_gold_flags=0
372 + linux_use_bundled_binutils=0
373 + linux_use_bundled_gold=0" \
374 + "${EPYTHON}" configure.py \
375 + --prefix="${EPREFIX}"/usr \
376 + --dest-cpu=${myarch} \
377 + $(use_with systemtap dtrace) \
378 + "${myconf[@]}" || die
379 +}
380 +
381 +src_compile() {
382 + emake -C out mksnapshot
383 + pax-mark m "out/${BUILDTYPE}/mksnapshot"
384 + emake -C out
385 +}
386 +
387 +src_install() {
388 + local LIBDIR="${ED}/usr/$(get_libdir)"
389 + default
390 +
391 + pax-mark -m "${ED}"/usr/bin/node
392 +
393 + # set up a symlink structure that node-gyp expects..
394 + dodir /usr/include/node/deps/{v8,uv}
395 + dosym . /usr/include/node/src
396 + for var in deps/{uv,v8}/include; do
397 + dosym ../.. /usr/include/node/${var}
398 + done
399 +
400 + if use doc; then
401 + docinto html
402 + dodoc -r "${S}"/doc/*
403 + fi
404 +
405 + if use npm; then
406 + dodir /etc/npm
407 +
408 + # Install bash completion for `npm`
409 + # We need to temporarily replace default config path since
410 + # npm otherwise tries to write outside of the sandbox
411 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
412 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
413 + local tmp_npm_completion_file="$(emktemp)"
414 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
415 + newbashcomp "${tmp_npm_completion_file}" npm
416 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
417 +
418 + # Move man pages
419 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
420 +
421 + # Clean up
422 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
423 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
424 +
425 + local find_exp="-or -name"
426 + local find_name=()
427 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
428 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
429 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
430 + find_name+=( ${find_exp} "${match}" )
431 + done
432 +
433 + # Remove various development and/or inappropriate files and
434 + # useless docs of dependend packages.
435 + find "${LIBDIR}"/node_modules \
436 + \( -type d -name examples \) -or \( -type f \( \
437 + -iname "LICEN?E*" \
438 + "${find_name[@]}" \
439 + \) \) -exec rm -rf "{}" \;
440 + fi
441 +
442 + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
443 +}
444 +
445 +src_test() {
446 + out/${BUILDTYPE}/cctest || die
447 + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
448 +}
449 +
450 +pkg_postinst() {
451 + elog "The global npm config lives in /etc/npm. This deviates slightly"
452 + elog "from upstream which otherwise would have it live in /usr/etc/."
453 + elog ""
454 + elog "Protip: When using node-gyp to install native modules, you can"
455 + elog "avoid having to download extras by doing the following:"
456 + elog "$ node-gyp --nodedir /usr/include/node <command>"
457 +}
458
459 diff --git a/net-libs/nodejs/nodejs-13.8.0.ebuild b/net-libs/nodejs/nodejs-13.8.0.ebuild
460 new file mode 100644
461 index 00000000000..35f1444b8a4
462 --- /dev/null
463 +++ b/net-libs/nodejs/nodejs-13.8.0.ebuild
464 @@ -0,0 +1,204 @@
465 +# Copyright 1999-2020 Gentoo Authors
466 +# Distributed under the terms of the GNU General Public License v2
467 +
468 +EAPI=7
469 +PYTHON_COMPAT=( python{2_7,3_{6,7}} )
470 +PYTHON_REQ_USE="threads(+)"
471 +inherit bash-completion-r1 flag-o-matic pax-utils python-any-r1 toolchain-funcs xdg-utils
472 +
473 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
474 +HOMEPAGE="https://nodejs.org/"
475 +SRC_URI="
476 + https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz
477 +"
478 +
479 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
480 +SLOT="0"
481 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos"
482 +IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm pax_kernel +snapshot +ssl systemtap test"
483 +REQUIRED_USE="
484 + inspector? ( icu ssl )
485 + npm? ( ssl )
486 +"
487 +
488 +RDEPEND="
489 + >=dev-libs/libuv-1.34.1:=
490 + >=net-dns/c-ares-1.15.0
491 + >=net-libs/nghttp2-1.40.0
492 + sys-libs/zlib
493 + icu? ( >=dev-libs/icu-64.2:= )
494 + ssl? ( >=dev-libs/openssl-1.1.1:0= )
495 +"
496 +BDEPEND="
497 + ${PYTHON_DEPS}
498 + systemtap? ( dev-util/systemtap )
499 + test? ( net-misc/curl )
500 + pax_kernel? ( sys-apps/elfix )
501 +"
502 +DEPEND="
503 + ${RDEPEND}
504 +"
505 +PATCHES=(
506 + "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
507 +)
508 +RESTRICT="test"
509 +S="${WORKDIR}/node-v${PV}"
510 +
511 +pkg_pretend() {
512 + (use x86 && ! use cpu_flags_x86_sse2) && \
513 + die "Your CPU doesn't support the required SSE2 instruction."
514 +
515 + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \
516 + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
517 +}
518 +
519 +src_prepare() {
520 + tc-export CC CXX PKG_CONFIG
521 + export V=1
522 + export BUILDTYPE=Release
523 +
524 + # fix compilation on Darwin
525 + # https://code.google.com/p/gyp/issues/detail?id=260
526 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
527 +
528 + # less verbose install output (stating the same as portage, basically)
529 + sed -i -e "/print/d" tools/install.py || die
530 +
531 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
532 + local LIBDIR=$(get_libdir)
533 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
534 + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
535 +
536 + # Avoid writing a depfile, not useful
537 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
538 +
539 + sed -i -e "/'-O3'/d" common.gypi node.gypi || die
540 +
541 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
542 + # seem sandbox related either (invoking it from a sandbox works fine).
543 + # The issue is that no stdin handle is openened when asked for one.
544 + # It doesn't really belong upstream , so it'll just be removed until someone
545 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
546 + rm test/parallel/test-stdout-close-unref.js || die
547 +
548 + # debug builds. change install path, remove optimisations and override buildtype
549 + if use debug; then
550 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
551 + BUILDTYPE=Debug
552 + fi
553 +
554 + # We need to disable mprotect on two files when it builds Bug 694100.
555 + use pax_kernel && PATCHES+=( "${FILESDIR}"/${PN}-13.2.0-paxmarking.patch )
556 +
557 + default
558 +}
559 +
560 +src_configure() {
561 + xdg_environment_reset
562 +
563 + local myconf=(
564 + --shared-cares --shared-libuv --shared-nghttp2 --shared-zlib
565 + )
566 + use debug && myconf+=( --debug )
567 + use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none )
568 + use inspector || myconf+=( --without-inspector )
569 + use npm || myconf+=( --without-npm )
570 + use snapshot || myconf+=( --without-node-snapshot )
571 + use ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store ) || myconf+=( --without-ssl )
572 +
573 + local myarch=""
574 + case ${ABI} in
575 + amd64) myarch="x64";;
576 + arm) myarch="arm";;
577 + arm64) myarch="arm64";;
578 + ppc64) myarch="ppc64";;
579 + x32) myarch="x32";;
580 + x86) myarch="ia32";;
581 + *) myarch="${ABI}";;
582 + esac
583 +
584 + GYP_DEFINES="linux_use_gold_flags=0
585 + linux_use_bundled_binutils=0
586 + linux_use_bundled_gold=0" \
587 + "${EPYTHON}" configure.py \
588 + --prefix="${EPREFIX}"/usr \
589 + --dest-cpu=${myarch} \
590 + $(use_with systemtap dtrace) \
591 + "${myconf[@]}" || die
592 +}
593 +
594 +src_compile() {
595 + emake -C out
596 +}
597 +
598 +src_install() {
599 + local LIBDIR="${ED}/usr/$(get_libdir)"
600 + default
601 +
602 + pax-mark -m "${ED}"/usr/bin/node
603 +
604 + # set up a symlink structure that node-gyp expects..
605 + dodir /usr/include/node/deps/{v8,uv}
606 + dosym . /usr/include/node/src
607 + for var in deps/{uv,v8}/include; do
608 + dosym ../.. /usr/include/node/${var}
609 + done
610 +
611 + if use doc; then
612 + docinto html
613 + dodoc -r "${S}"/doc/*
614 + fi
615 +
616 + if use npm; then
617 + dodir /etc/npm
618 +
619 + # Install bash completion for `npm`
620 + # We need to temporarily replace default config path since
621 + # npm otherwise tries to write outside of the sandbox
622 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
623 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
624 + local tmp_npm_completion_file="$(emktemp)"
625 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
626 + newbashcomp "${tmp_npm_completion_file}" npm
627 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
628 +
629 + # Move man pages
630 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
631 +
632 + # Clean up
633 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
634 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
635 +
636 + local find_exp="-or -name"
637 + local find_name=()
638 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
639 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
640 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
641 + find_name+=( ${find_exp} "${match}" )
642 + done
643 +
644 + # Remove various development and/or inappropriate files and
645 + # useless docs of dependend packages.
646 + find "${LIBDIR}"/node_modules \
647 + \( -type d -name examples \) -or \( -type f \( \
648 + -iname "LICEN?E*" \
649 + "${find_name[@]}" \
650 + \) \) -exec rm -rf "{}" \;
651 + fi
652 +
653 + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
654 +}
655 +
656 +src_test() {
657 + out/${BUILDTYPE}/cctest || die
658 + "${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
659 +}
660 +
661 +pkg_postinst() {
662 + elog "The global npm config lives in /etc/npm. This deviates slightly"
663 + elog "from upstream which otherwise would have it live in /usr/etc/."
664 + elog ""
665 + elog "Protip: When using node-gyp to install native modules, you can"
666 + elog "avoid having to download extras by doing the following:"
667 + elog "$ node-gyp --nodedir /usr/include/node <command>"
668 +}