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, 29 Mar 2018 07:23:00
Message-Id: 1522308171.54be82542bfca8b6139b2b3f80c37d5908fd5a30.jer@gentoo
1 commit: 54be82542bfca8b6139b2b3f80c37d5908fd5a30
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 29 07:18:28 2018 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Thu Mar 29 07:22:51 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54be8254
7
8 net-libs/nodejs: Versions 4.9.0 6.14.0 8.11.0 9.10.0.
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11
12 net-libs/nodejs/Manifest | 4 +
13 net-libs/nodejs/nodejs-4.9.0.ebuild | 143 +++++++++++++++++++++++++
14 net-libs/nodejs/nodejs-6.14.0.ebuild | 197 ++++++++++++++++++++++++++++++++++
15 net-libs/nodejs/nodejs-8.11.0.ebuild | 201 +++++++++++++++++++++++++++++++++++
16 net-libs/nodejs/nodejs-9.10.0.ebuild | 200 ++++++++++++++++++++++++++++++++++
17 5 files changed, 745 insertions(+)
18
19 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
20 index 4cc61f58268..95866899a74 100644
21 --- a/net-libs/nodejs/Manifest
22 +++ b/net-libs/nodejs/Manifest
23 @@ -1,10 +1,14 @@
24 DIST node-v0.12.18.tar.gz 19842591 BLAKE2B f94f4de6e2875267be194580c645087a262b90da99f10d651a22838c041da07056df81204bb04ce8da083a080062509dcca4d1e3ac2250d651ead8a4cc025028 SHA512 6866608a43eb213f3b715ea0fcc28983fd959ab679c567a1b464f62acd936506f2bce88ea48a60209d8ef8d98259f4b47cd3434893eb4ff82a132775edb37b7b
25 DIST node-v4.8.7.tar.xz 13370828 BLAKE2B b1ee93a586b66f8582783b1be50667547afe4bf48038ebc0b8148db55542cbc0520ac84ef88e4a7f453cabc245f484c32dbc238c1932bbc708791ceeb5c9d2ab SHA512 25837a31023747723b146c45984a5b2096b61c0aa43cbf45fc8ff50b4bd5079bd0bc9f1dfd3fb076817448dc5537eb93ffb2f345280b7756ba93b67ad757c696
26 +DIST node-v4.9.0.tar.xz 13251332 BLAKE2B ff0e8d21f7e866ae0f47fc55a5c6b133dedee20776a1feb1efe013d05420108d4a7ff27d92f554dbd00a8cd8eab08966cfd2603919079522dcfb44db68e96cc8 SHA512 7dac1eb8848d77d6cc7123b1f1f825f07c09aac5ef3ee1fa6b6e5b26d065fb18b750d857ac3b5b9fa9133a05c4d21c14aba35b32b1dc41e303203a39d9eb8051
27 DIST node-v6.11.5.tar.xz 15699404 BLAKE2B ba2df91bf5ef38cedb60b42919cf56f16807e619a81876fc92a5741e49da7ec91c4239d00f549c5e80d0bb8282bb9b396dd984507916cd18d61b403a3a7cef94 SHA512 62490725ef7957294c1bddf21ef0626c7472876791210168116501255ecee58457e9de9b044e10033706243299bbfd1495efeca169596fbf26f5eeba6d8fa4c9
28 DIST node-v6.13.0.tar.xz 15843504 BLAKE2B 0fdbdf4ccd4b0953f786426aef0c7006972de125d9cd53c8d4ab797ceb5ad1ffad8c87cd271866405db372a871322039c8de865d736a16daec0e10c9a0a0305b SHA512 bcc757adc9ac9fd2d1cc8a575a1fb4b15b1ca893fffa134f5101278d72932c6b7e0cbd491e60fd0833854dfe507823251bd41e34d146a2be8176d46dccc8fb24
29 DIST node-v6.13.1.tar.xz 15842548 BLAKE2B 63148a0923c9b98432672d83895c382eea4eceb3152390eebf3ac3d10e3f0595b7df9ab2175e9a91463c5da6d899c2cac275d5837a3641579ea8b0df5114e141 SHA512 6189a83d86d0b63680139fc45f394f065832962fec7fdb9315d6454cae686ff8823223372dcc64043c2d7c48fd69a04c5840528083f77ed118e3d993478f354f
30 +DIST node-v6.14.0.tar.xz 15758780 BLAKE2B 4bd91ab66973693e0a1d59fe8b1a70329613849972737cc75930509419f5b9ed849529e4531c0d6ca0ef8c2a168315f289bff89681d0c44d420ba4bca4461d9c SHA512 39b37f30a72401958a3e8b524250c4beeffba3aa4256db3990b5bdd0c91a1a393b2f7612055eeaa101debf0af88d549287b968459ffaa9555ca1c382e050a250
31 DIST node-v6.9.4.tar.xz 15519264 BLAKE2B 4dfad88b06b209272b8468501cc3c87c40425781fb55011ee93326555c2df88a166ffaff1877563668e06389703053849361739556f1bc87c1e2386d48b9542e SHA512 86d3e2889031c2b50c021bd3fd63194c2c22c44291d51dff1b5e1652b01853c09d2880c2f58fdad062e3e2a3f637a3f0d78dac66b835b676790cf272e64f8dce
32 DIST node-v8.10.0.tar.xz 18364660 BLAKE2B 624a1205102ee1a1705c039c72930af97b7da1f1381981a4a9d1ca6373b0fb06b7f03a2f49a80a2b8d2a3c5c99d88bd0146a02a76fa5a7e3da3887341e39184f SHA512 21bac03a79c578a95ee67bd31b8908a68d4385c98e48f85ffbd6f8f4ad82a4bea935e3498fb315f25b45cb1615ce2c2ddb3c48b76ba9107a956c4cc55c6b71ff
33 +DIST node-v8.11.0.tar.xz 18278960 BLAKE2B 175b67500eb0052d5476f76026484a79d921c1d305ca5f18dd37124e22027d57f97ad242e900f888187e8da8242fb5b69141b2c40b7d591c41d19e5ed09db5cd SHA512 b523b9b92d69ed83338a28536f95547435b6b665595003997f7e658992f2390434ac3ce7dada1b235620e33475afde17c23c10ff404a4861c8493ce3a0bf28f5
34 DIST node-v8.9.4.tar.xz 18338980 BLAKE2B 81180fc0c9b10cebc051a72649fb40650c89a05d427b826a6f3937e2b108b97edd27dd1c1521e57168e5a92b37e590429735c07c3198e4b912774c305ae61693 SHA512 9656b57145c2b3048ff9ad70f91dbff33a7349dca564efe3b2ff585e2ffad004ea8de920a7a049ff4c5487683986d78b5a578306c2c99f3b1a3de96d9ad1dece
35 +DIST node-v9.10.0.tar.xz 18452040 BLAKE2B 46bbc8041de64fc2b8e03cd06565e701b7f8f208883065ad20d7ec3c240049dba022d38d1d21e3b03e9670c10be362869eaac13a9a7e17a0735bb8c8cbe7a004 SHA512 230e84016132e3155d6e71a40991f3e6483fd3cbf8942a7d296c0dc249b247ad47fd10ac7c73f1210cccbe29a1a9bfa3be040365b3d28604b830b405e03a5f4e
36 DIST node-v9.8.0.tar.xz 18512940 BLAKE2B 1167359e8a7c64ab801841c4fada0ae3d83b38d47c000aaf3e40af5eda64d5b8c76fe7f0ed478efa6f21d238534a9c413fc1c7cda6ac06d768aeb8e134db12e5 SHA512 40c6f721a234c2600475b49774ac4a9ce363be2098bda45c4c360ad41a5b037c8cb6513f79839927cfcf86b415dc507d44fda5da2babad1aa533beb64b7d0cae
37 DIST node-v9.9.0.tar.xz 18530376 BLAKE2B 33c270ccbde9d286eee4098f0170c228a25826808c04f735a70550b0144427da98177a20fee5d9d81f0911597f20b2a896fe89c47a472c6d0c6cc7102265714b SHA512 937ecc6d73b82a6e27a787c96c895078fe6f3a2cc7bf29982eee4d5b6f4d814d1fc0e063c92880c43bea6175e6bef096d0ec2ee18db70af16555bef289616be0
38
39 diff --git a/net-libs/nodejs/nodejs-4.9.0.ebuild b/net-libs/nodejs/nodejs-4.9.0.ebuild
40 new file mode 100644
41 index 00000000000..2d8146e4c39
42 --- /dev/null
43 +++ b/net-libs/nodejs/nodejs-4.9.0.ebuild
44 @@ -0,0 +1,143 @@
45 +# Copyright 1999-2018 Gentoo Foundation
46 +# Distributed under the terms of the GNU General Public License v2
47 +
48 +EAPI=6
49 +
50 +PYTHON_COMPAT=( python2_7 )
51 +PYTHON_REQ_USE="threads"
52 +
53 +inherit flag-o-matic pax-utils python-single-r1 toolchain-funcs
54 +
55 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
56 +HOMEPAGE="https://nodejs.org/"
57 +SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
58 +
59 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
60 +SLOT="0"
61 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~x64-macos"
62 +IUSE="cpu_flags_x86_sse2 debug icu +npm snapshot +ssl test"
63 +
64 +RDEPEND="icu? ( >=dev-libs/icu-55:= )
65 + npm? ( ${PYTHON_DEPS} )
66 + >=net-libs/http-parser-2.5.2:=
67 + >=dev-libs/libuv-1.8.0:=
68 + >=dev-libs/openssl-1.0.2g:0=[-bindist]
69 + sys-libs/zlib"
70 +DEPEND="${RDEPEND}
71 + ${PYTHON_DEPS}
72 + test? ( net-misc/curl )"
73 +
74 +S="${WORKDIR}/node-v${PV}"
75 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
76 +
77 +pkg_pretend() {
78 + (use x86 && ! use cpu_flags_x86_sse2) && \
79 + die "Your CPU doesn't support the required SSE2 instruction."
80 +
81 + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \
82 + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
83 +}
84 +
85 +src_prepare() {
86 + tc-export CC CXX PKG_CONFIG
87 + export V=1 # Verbose build
88 + export BUILDTYPE=Release
89 +
90 + # fix compilation on Darwin
91 + # https://code.google.com/p/gyp/issues/detail?id=260
92 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
93 +
94 + # make sure we use python2.* while using gyp
95 + sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
96 + sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
97 +
98 + # less verbose install output (stating the same as portage, basically)
99 + sed -i -e "/print/d" tools/install.py || die
100 +
101 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
102 + local LIBDIR=$(get_libdir)
103 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
104 + sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die
105 + sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die
106 +
107 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
108 + # seem sandbox related either (invoking it from a sandbox works fine).
109 + # The issue is that no stdin handle is openened when asked for one.
110 + # It doesn't really belong upstream , so it'll just be removed until someone
111 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
112 + rm test/parallel/test-stdout-close-unref.js || die
113 +
114 + # debug builds. change install path, remove optimisations and override buildtype
115 + if use debug; then
116 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
117 + BUILDTYPE=Debug
118 + fi
119 +
120 + default
121 +}
122 +
123 +src_configure() {
124 + local myarch=""
125 + local myconf+=( --shared-openssl --shared-libuv --shared-http-parser --shared-zlib )
126 + use npm || myconf+=( --without-npm )
127 + use icu && myconf+=( --with-intl=system-icu )
128 + use snapshot && myconf+=( --with-snapshot )
129 + use ssl || myconf+=( --without-ssl )
130 + use debug && myconf+=( --debug )
131 +
132 + case ${ABI} in
133 + amd64) myarch="x64";;
134 + arm) myarch="arm";;
135 + arm64) myarch="arm64";;
136 + ppc64) myarch="ppc64";;
137 + x32) myarch="x32";;
138 + x86) myarch="ia32";;
139 + *) die "Unrecognized ARCH ${ARCH}";;
140 + esac
141 +
142 + GYP_DEFINES="linux_use_gold_flags=0
143 + linux_use_bundled_binutils=0
144 + linux_use_bundled_gold=0" \
145 + "${PYTHON}" configure \
146 + --prefix="${EPREFIX}"/usr \
147 + --dest-cpu=${myarch} \
148 + --without-dtrace \
149 + "${myconf[@]}" || die
150 +}
151 +
152 +src_compile() {
153 + emake -C out mksnapshot
154 + pax-mark m "out/${BUILDTYPE}/mksnapshot"
155 + emake -C out
156 +}
157 +
158 +src_install() {
159 + local LIBDIR="${ED}/usr/$(get_libdir)"
160 + emake install DESTDIR="${ED}" PREFIX=/usr
161 + if use npm; then
162 + dodoc -r "${LIBDIR}"/node_modules/npm/html
163 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html} || die
164 + find "${LIBDIR}"/node_modules -type f -name "LICENSE*" -or -name "LICENCE*" -delete || die
165 + fi
166 +
167 + # set up a symlink structure that npm expects..
168 + dodir /usr/include/node/deps/{v8,uv}
169 + dosym . /usr/include/node/src
170 + for var in deps/{uv,v8}/include; do
171 + dosym ../.. /usr/include/node/${var}
172 + done
173 +
174 + pax-mark -m "${ED}"/usr/bin/node
175 +}
176 +
177 +src_test() {
178 + out/${BUILDTYPE}/cctest || die
179 + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
180 +}
181 +
182 +pkg_postinst() {
183 + einfo "When using node-gyp to install native modules, you can avoid"
184 + einfo "having to download the full tarball by doing the following:"
185 + einfo ""
186 + einfo "node-gyp --nodedir /usr/include/node <command>"
187 +}
188
189 diff --git a/net-libs/nodejs/nodejs-6.14.0.ebuild b/net-libs/nodejs/nodejs-6.14.0.ebuild
190 new file mode 100644
191 index 00000000000..d00288db71c
192 --- /dev/null
193 +++ b/net-libs/nodejs/nodejs-6.14.0.ebuild
194 @@ -0,0 +1,197 @@
195 +# Copyright 1999-2018 Gentoo Foundation
196 +# Distributed under the terms of the GNU General Public License v2
197 +
198 +EAPI=6
199 +
200 +PYTHON_COMPAT=( python2_7 )
201 +PYTHON_REQ_USE="threads"
202 +
203 +inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs
204 +
205 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
206 +HOMEPAGE="https://nodejs.org/"
207 +SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
208 +
209 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
210 +SLOT="0"
211 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos"
212 +IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl test"
213 +REQUIRED_USE="
214 + ${PYTHON_REQUIRED_USE}
215 + inspector? ( icu ssl )
216 +"
217 +
218 +RDEPEND="
219 + >=dev-libs/libuv-1.16.1:=
220 + >=net-libs/http-parser-2.7.0:=
221 + sys-libs/zlib
222 + icu? ( >=dev-libs/icu-58.2:= )
223 + ssl? ( >=dev-libs/openssl-1.0.2n:0=[-bindist] )
224 +"
225 +DEPEND="
226 + ${RDEPEND}
227 + ${PYTHON_DEPS}
228 + test? ( net-misc/curl )
229 +"
230 +S="${WORKDIR}/node-v${PV}"
231 +PATCHES=(
232 + "${FILESDIR}"/gentoo-global-npm-config.patch
233 +)
234 +
235 +pkg_pretend() {
236 + (use x86 && ! use cpu_flags_x86_sse2) && \
237 + die "Your CPU doesn't support the required SSE2 instruction."
238 +
239 + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \
240 + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
241 +}
242 +
243 +src_prepare() {
244 + tc-export CC CXX PKG_CONFIG
245 + export V=1
246 + export BUILDTYPE=Release
247 +
248 + # fix compilation on Darwin
249 + # https://code.google.com/p/gyp/issues/detail?id=260
250 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
251 +
252 + # make sure we use python2.* while using gyp
253 + sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
254 + sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
255 +
256 + # less verbose install output (stating the same as portage, basically)
257 + sed -i -e "/print/d" tools/install.py || die
258 +
259 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
260 + local LIBDIR=$(get_libdir)
261 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
262 + sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die
263 + sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die
264 +
265 + # Avoid writing a depfile, not useful
266 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
267 +
268 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
269 + # seem sandbox related either (invoking it from a sandbox works fine).
270 + # The issue is that no stdin handle is openened when asked for one.
271 + # It doesn't really belong upstream , so it'll just be removed until someone
272 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
273 + rm test/parallel/test-stdout-close-unref.js || die
274 +
275 + # debug builds. change install path, remove optimisations and override buildtype
276 + if use debug; then
277 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
278 + BUILDTYPE=Debug
279 + fi
280 +
281 + default
282 +}
283 +
284 +src_configure() {
285 + local myarch=""
286 + local myconf=( --shared-libuv --shared-http-parser --shared-zlib )
287 + use debug && myconf+=( --debug )
288 + use icu && myconf+=( --with-intl=system-icu )
289 + use inspector || myconf+=( --without-inspector )
290 + use npm || myconf+=( --without-npm )
291 + use snapshot && myconf+=( --with-snapshot )
292 + use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl )
293 +
294 + case ${ABI} in
295 + amd64) myarch="x64";;
296 + arm) myarch="arm";;
297 + arm64) myarch="arm64";;
298 + ppc64) myarch="ppc64";;
299 + x32) myarch="x32";;
300 + x86) myarch="ia32";;
301 + *) myarch="${ABI}";;
302 + esac
303 +
304 + GYP_DEFINES="linux_use_gold_flags=0
305 + linux_use_bundled_binutils=0
306 + linux_use_bundled_gold=0" \
307 + "${PYTHON}" configure \
308 + --prefix="${EPREFIX}"/usr \
309 + --dest-cpu=${myarch} \
310 + --without-dtrace \
311 + "${myconf[@]}" || die
312 +}
313 +
314 +src_compile() {
315 + emake -C out mksnapshot
316 + pax-mark m "out/${BUILDTYPE}/mksnapshot"
317 + emake -C out
318 +}
319 +
320 +src_install() {
321 + local LIBDIR="${ED}/usr/$(get_libdir)"
322 + emake install DESTDIR="${D}"
323 + pax-mark -m "${ED}"usr/bin/node
324 +
325 + # set up a symlink structure that node-gyp expects..
326 + dodir /usr/include/node/deps/{v8,uv}
327 + dosym . /usr/include/node/src
328 + for var in deps/{uv,v8}/include; do
329 + dosym ../.. /usr/include/node/${var}
330 + done
331 +
332 + if use doc; then
333 + # Patch docs to make them offline readable
334 + for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do
335 + sed -i '/fonts.googleapis.com/ d' $i;
336 + done
337 + # Install docs!
338 + dohtml -r "${S}"/doc/*
339 + fi
340 +
341 + if use npm; then
342 + dodir /etc/npm
343 +
344 + # Install bash completion for `npm`
345 + # We need to temporarily replace default config path since
346 + # npm otherwise tries to write outside of the sandbox
347 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
348 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
349 + local tmp_npm_completion_file="$(emktemp)"
350 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
351 + newbashcomp "${tmp_npm_completion_file}" npm
352 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
353 +
354 + # Move man pages
355 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
356 +
357 + # Clean up
358 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
359 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
360 +
361 + local find_exp="-or -name"
362 + local find_name=()
363 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
364 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
365 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
366 + find_name+=( ${find_exp} "${match}" )
367 + done
368 +
369 + # Remove various development and/or inappropriate files and
370 + # useless docs of dependend packages.
371 + find "${LIBDIR}"/node_modules \
372 + \( -type d -name examples \) -or \( -type f \( \
373 + -iname "LICEN?E*" \
374 + "${find_name[@]}" \
375 + \) \) -exec rm -rf "{}" \;
376 + fi
377 +}
378 +
379 +src_test() {
380 + out/${BUILDTYPE}/cctest || die
381 + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
382 +}
383 +
384 +pkg_postinst() {
385 + einfo "The global npm config lives in /etc/npm. This deviates slightly"
386 + einfo "from upstream which otherwise would have it live in /usr/etc/."
387 + einfo ""
388 + einfo "Protip: When using node-gyp to install native modules, you can"
389 + einfo "avoid having to download extras by doing the following:"
390 + einfo "$ node-gyp --nodedir /usr/include/node <command>"
391 +}
392
393 diff --git a/net-libs/nodejs/nodejs-8.11.0.ebuild b/net-libs/nodejs/nodejs-8.11.0.ebuild
394 new file mode 100644
395 index 00000000000..da6d42a8cea
396 --- /dev/null
397 +++ b/net-libs/nodejs/nodejs-8.11.0.ebuild
398 @@ -0,0 +1,201 @@
399 +# Copyright 1999-2018 Gentoo Foundation
400 +# Distributed under the terms of the GNU General Public License v2
401 +
402 +EAPI=6
403 +RESTRICT="test"
404 +
405 +PYTHON_COMPAT=( python2_7 )
406 +PYTHON_REQ_USE="threads"
407 +
408 +inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs
409 +
410 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
411 +HOMEPAGE="https://nodejs.org/"
412 +SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
413 +
414 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
415 +SLOT="0"
416 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos"
417 +IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test"
418 +REQUIRED_USE="
419 + ${PYTHON_REQUIRED_USE}
420 + inspector? ( icu ssl )
421 +"
422 +
423 +RDEPEND="
424 + >=dev-libs/libuv-1.19.1:=
425 + >=net-libs/http-parser-2.7.0:=
426 + >=net-libs/nghttp2-1.25.0
427 + sys-libs/zlib
428 + icu? ( >=dev-libs/icu-60.1:= )
429 + ssl? ( >=dev-libs/openssl-1.0.2n:0=[-bindist] )
430 +"
431 +DEPEND="${RDEPEND}
432 + ${PYTHON_DEPS}
433 + systemtap? ( dev-util/systemtap )
434 + test? ( net-misc/curl )"
435 +
436 +S="${WORKDIR}/node-v${PV}"
437 +
438 +PATCHES=(
439 + "${FILESDIR}"/gentoo-global-npm-config.patch
440 +)
441 +
442 +pkg_pretend() {
443 + (use x86 && ! use cpu_flags_x86_sse2) && \
444 + die "Your CPU doesn't support the required SSE2 instruction."
445 +
446 + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \
447 + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
448 +}
449 +
450 +src_prepare() {
451 + tc-export CC CXX PKG_CONFIG
452 + export V=1
453 + export BUILDTYPE=Release
454 +
455 + # fix compilation on Darwin
456 + # https://code.google.com/p/gyp/issues/detail?id=260
457 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
458 +
459 + # make sure we use python2.* while using gyp
460 + sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
461 + sed -i -e "s/|| 'python2'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
462 +
463 + # less verbose install output (stating the same as portage, basically)
464 + sed -i -e "/print/d" tools/install.py || die
465 +
466 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
467 + local LIBDIR=$(get_libdir)
468 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
469 + sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js deps/npm/lib/npm.js || die
470 +
471 + # Avoid writing a depfile, not useful
472 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
473 +
474 + sed -i -e "/'-O3'/d" common.gypi deps/v8/gypfiles/toolchain.gypi || die
475 +
476 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
477 + # seem sandbox related either (invoking it from a sandbox works fine).
478 + # The issue is that no stdin handle is openened when asked for one.
479 + # It doesn't really belong upstream , so it'll just be removed until someone
480 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
481 + rm test/parallel/test-stdout-close-unref.js || die
482 +
483 + # debug builds. change install path, remove optimisations and override buildtype
484 + if use debug; then
485 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
486 + BUILDTYPE=Debug
487 + fi
488 +
489 + default
490 +}
491 +
492 +src_configure() {
493 + local myconf=( --shared-http-parser --shared-libuv --shared-nghttp2 --shared-zlib )
494 + use debug && myconf+=( --debug )
495 + use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none )
496 + use inspector || myconf+=( --without-inspector )
497 + use npm || myconf+=( --without-npm )
498 + use snapshot && myconf+=( --with-snapshot )
499 + use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl )
500 +
501 + local myarch=""
502 + case ${ABI} in
503 + amd64) myarch="x64";;
504 + arm) myarch="arm";;
505 + arm64) myarch="arm64";;
506 + ppc64) myarch="ppc64";;
507 + x32) myarch="x32";;
508 + x86) myarch="ia32";;
509 + *) myarch="${ABI}";;
510 + esac
511 +
512 + GYP_DEFINES="linux_use_gold_flags=0
513 + linux_use_bundled_binutils=0
514 + linux_use_bundled_gold=0" \
515 + "${PYTHON}" configure \
516 + --prefix="${EPREFIX}"/usr \
517 + --dest-cpu=${myarch} \
518 + $(use_with systemtap dtrace) \
519 + "${myconf[@]}" || die
520 +}
521 +
522 +src_compile() {
523 + emake -C out mksnapshot
524 + pax-mark m "out/${BUILDTYPE}/mksnapshot"
525 + emake -C out
526 +}
527 +
528 +src_install() {
529 + local LIBDIR="${ED}/usr/$(get_libdir)"
530 + emake install DESTDIR="${D}"
531 + pax-mark -m "${ED}"usr/bin/node
532 +
533 + # set up a symlink structure that node-gyp expects..
534 + dodir /usr/include/node/deps/{v8,uv}
535 + dosym . /usr/include/node/src
536 + for var in deps/{uv,v8}/include; do
537 + dosym ../.. /usr/include/node/${var}
538 + done
539 +
540 + if use doc; then
541 + # Patch docs to make them offline readable
542 + for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do
543 + sed -i '/fonts.googleapis.com/ d' $i;
544 + done
545 + # Install docs!
546 + dohtml -r "${S}"/doc/*
547 + fi
548 +
549 + if use npm; then
550 + dodir /etc/npm
551 +
552 + # Install bash completion for `npm`
553 + # We need to temporarily replace default config path since
554 + # npm otherwise tries to write outside of the sandbox
555 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
556 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
557 + local tmp_npm_completion_file="$(emktemp)"
558 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
559 + newbashcomp "${tmp_npm_completion_file}" npm
560 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
561 +
562 + # Move man pages
563 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
564 +
565 + # Clean up
566 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
567 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
568 +
569 + local find_exp="-or -name"
570 + local find_name=()
571 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
572 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
573 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
574 + find_name+=( ${find_exp} "${match}" )
575 + done
576 +
577 + # Remove various development and/or inappropriate files and
578 + # useless docs of dependend packages.
579 + find "${LIBDIR}"/node_modules \
580 + \( -type d -name examples \) -or \( -type f \( \
581 + -iname "LICEN?E*" \
582 + "${find_name[@]}" \
583 + \) \) -exec rm -rf "{}" \;
584 + fi
585 +}
586 +
587 +src_test() {
588 + out/${BUILDTYPE}/cctest || die
589 + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
590 +}
591 +
592 +pkg_postinst() {
593 + einfo "The global npm config lives in /etc/npm. This deviates slightly"
594 + einfo "from upstream which otherwise would have it live in /usr/etc/."
595 + einfo ""
596 + einfo "Protip: When using node-gyp to install native modules, you can"
597 + einfo "avoid having to download extras by doing the following:"
598 + einfo "$ node-gyp --nodedir /usr/include/node <command>"
599 +}
600
601 diff --git a/net-libs/nodejs/nodejs-9.10.0.ebuild b/net-libs/nodejs/nodejs-9.10.0.ebuild
602 new file mode 100644
603 index 00000000000..e73e3ad0251
604 --- /dev/null
605 +++ b/net-libs/nodejs/nodejs-9.10.0.ebuild
606 @@ -0,0 +1,200 @@
607 +# Copyright 1999-2018 Gentoo Foundation
608 +# Distributed under the terms of the GNU General Public License v2
609 +
610 +EAPI=6
611 +
612 +PYTHON_COMPAT=( python2_7 )
613 +PYTHON_REQ_USE="threads"
614 +
615 +inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs
616 +
617 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
618 +HOMEPAGE="https://nodejs.org/"
619 +SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
620 +
621 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
622 +SLOT="0"
623 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos"
624 +IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test"
625 +REQUIRED_USE="
626 + ${PYTHON_REQUIRED_USE}
627 + inspector? ( icu ssl )
628 +"
629 +
630 +RDEPEND="
631 + >=dev-libs/libuv-1.19.2:=
632 + >=net-libs/http-parser-2.7.0:=
633 + >=net-libs/nghttp2-1.29.0
634 + sys-libs/zlib
635 + icu? ( >=dev-libs/icu-60.1:= )
636 + ssl? ( >=dev-libs/openssl-1.0.2n:0=[-bindist] )
637 +"
638 +DEPEND="
639 + ${RDEPEND}
640 + ${PYTHON_DEPS}
641 + systemtap? ( dev-util/systemtap )
642 + test? ( net-misc/curl )
643 +"
644 +S="${WORKDIR}/node-v${PV}"
645 +PATCHES=(
646 + "${FILESDIR}"/gentoo-global-npm-config.patch
647 +)
648 +
649 +pkg_pretend() {
650 + (use x86 && ! use cpu_flags_x86_sse2) && \
651 + die "Your CPU doesn't support the required SSE2 instruction."
652 +
653 + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \
654 + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
655 +}
656 +
657 +src_prepare() {
658 + tc-export CC CXX PKG_CONFIG
659 + export V=1
660 + export BUILDTYPE=Release
661 +
662 + # fix compilation on Darwin
663 + # https://code.google.com/p/gyp/issues/detail?id=260
664 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
665 +
666 + # make sure we use python2.* while using gyp
667 + sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
668 + sed -i -e "s/|| 'python2'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
669 +
670 + # less verbose install output (stating the same as portage, basically)
671 + sed -i -e "/print/d" tools/install.py || die
672 +
673 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
674 + local LIBDIR=$(get_libdir)
675 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
676 + sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js deps/npm/lib/npm.js || die
677 +
678 + # Avoid writing a depfile, not useful
679 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
680 +
681 + sed -i -e "/'-O3'/d" common.gypi deps/v8/gypfiles/toolchain.gypi || die
682 +
683 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
684 + # seem sandbox related either (invoking it from a sandbox works fine).
685 + # The issue is that no stdin handle is openened when asked for one.
686 + # It doesn't really belong upstream , so it'll just be removed until someone
687 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
688 + rm test/parallel/test-stdout-close-unref.js || die
689 +
690 + # debug builds. change install path, remove optimisations and override buildtype
691 + if use debug; then
692 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
693 + BUILDTYPE=Debug
694 + fi
695 +
696 + default
697 +}
698 +
699 +src_configure() {
700 + local myconf=( --shared-http-parser --shared-libuv --shared-nghttp2 --shared-zlib )
701 + use debug && myconf+=( --debug )
702 + use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none )
703 + use inspector || myconf+=( --without-inspector )
704 + use npm || myconf+=( --without-npm )
705 + use snapshot && myconf+=( --with-snapshot )
706 + use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl )
707 +
708 + local myarch=""
709 + case ${ABI} in
710 + amd64) myarch="x64";;
711 + arm) myarch="arm";;
712 + arm64) myarch="arm64";;
713 + ppc64) myarch="ppc64";;
714 + x32) myarch="x32";;
715 + x86) myarch="ia32";;
716 + *) myarch="${ABI}";;
717 + esac
718 +
719 + GYP_DEFINES="linux_use_gold_flags=0
720 + linux_use_bundled_binutils=0
721 + linux_use_bundled_gold=0" \
722 + "${PYTHON}" configure \
723 + --prefix="${EPREFIX}"/usr \
724 + --dest-cpu=${myarch} \
725 + $(use_with systemtap dtrace) \
726 + "${myconf[@]}" || die
727 +}
728 +
729 +src_compile() {
730 + emake -C out mksnapshot
731 + pax-mark m "out/${BUILDTYPE}/mksnapshot"
732 + emake -C out
733 +}
734 +
735 +src_install() {
736 + local LIBDIR="${ED}/usr/$(get_libdir)"
737 + emake install DESTDIR="${D}"
738 + pax-mark -m "${ED}"usr/bin/node
739 +
740 + # set up a symlink structure that node-gyp expects..
741 + dodir /usr/include/node/deps/{v8,uv}
742 + dosym . /usr/include/node/src
743 + for var in deps/{uv,v8}/include; do
744 + dosym ../.. /usr/include/node/${var}
745 + done
746 +
747 + if use doc; then
748 + # Patch docs to make them offline readable
749 + for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do
750 + sed -i '/fonts.googleapis.com/ d' $i;
751 + done
752 + # Install docs!
753 + dohtml -r "${S}"/doc/*
754 + fi
755 +
756 + if use npm; then
757 + dodir /etc/npm
758 +
759 + # Install bash completion for `npm`
760 + # We need to temporarily replace default config path since
761 + # npm otherwise tries to write outside of the sandbox
762 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
763 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
764 + local tmp_npm_completion_file="$(emktemp)"
765 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
766 + newbashcomp "${tmp_npm_completion_file}" npm
767 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
768 +
769 + # Move man pages
770 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
771 +
772 + # Clean up
773 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
774 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
775 +
776 + local find_exp="-or -name"
777 + local find_name=()
778 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
779 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
780 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
781 + find_name+=( ${find_exp} "${match}" )
782 + done
783 +
784 + # Remove various development and/or inappropriate files and
785 + # useless docs of dependend packages.
786 + find "${LIBDIR}"/node_modules \
787 + \( -type d -name examples \) -or \( -type f \( \
788 + -iname "LICEN?E*" \
789 + "${find_name[@]}" \
790 + \) \) -exec rm -rf "{}" \;
791 + fi
792 +}
793 +
794 +src_test() {
795 + out/${BUILDTYPE}/cctest || die
796 + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
797 +}
798 +
799 +pkg_postinst() {
800 + einfo "The global npm config lives in /etc/npm. This deviates slightly"
801 + einfo "from upstream which otherwise would have it live in /usr/etc/."
802 + einfo ""
803 + einfo "Protip: When using node-gyp to install native modules, you can"
804 + einfo "avoid having to download extras by doing the following:"
805 + einfo "$ node-gyp --nodedir /usr/include/node <command>"
806 +}