1 |
commit: a106610cfc469781813f3ca02797d6fbb0df4b5c |
2 |
Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Dec 11 10:17:49 2017 +0000 |
4 |
Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 11 10:22:08 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a106610c |
7 |
|
8 |
net-libs/nodejs: Version bump. |
9 |
|
10 |
Package-Manager: Portage-2.3.17, Repoman-2.3.6 |
11 |
|
12 |
net-libs/nodejs/Manifest | 2 + |
13 |
net-libs/nodejs/nodejs-8.9.3.ebuild | 203 ++++++++++++++++++++++++++++++++++++ |
14 |
net-libs/nodejs/nodejs-9.2.1.ebuild | 203 ++++++++++++++++++++++++++++++++++++ |
15 |
3 files changed, 408 insertions(+) |
16 |
|
17 |
diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest |
18 |
index 1e2a1b3f4b7..c7f07a90a2b 100644 |
19 |
--- a/net-libs/nodejs/Manifest |
20 |
+++ b/net-libs/nodejs/Manifest |
21 |
@@ -4,4 +4,6 @@ DIST node-v6.11.5.tar.xz 15699404 BLAKE2B ba2df91bf5ef38cedb60b42919cf56f16807e6 |
22 |
DIST node-v6.9.4.tar.xz 15519264 BLAKE2B 4dfad88b06b209272b8468501cc3c87c40425781fb55011ee93326555c2df88a166ffaff1877563668e06389703053849361739556f1bc87c1e2386d48b9542e SHA512 86d3e2889031c2b50c021bd3fd63194c2c22c44291d51dff1b5e1652b01853c09d2880c2f58fdad062e3e2a3f637a3f0d78dac66b835b676790cf272e64f8dce |
23 |
DIST node-v8.9.1.tar.xz 18290848 BLAKE2B b2a89d759bd19df6a6ea8db31ab3e63d111f24d9e00dbd8cdfc2d5d89a56ee7789c51b936516cdbce8384cc91591f4c1fb1eb0f2b3c18148a9211168cfe8121f SHA512 e1d93def34c1b91de90b807031e2f313661658cd045d44d290950190b10512770df05cb92e9657bab7ad6654d3359364193567cf693ddb2b3574d2a48e4ee256 |
24 |
DIST node-v8.9.2.tar.xz 18294828 BLAKE2B dab8389814baa3b965050aa15f70410a1de376431d5be1026176ddccf44c94068e6ce724b3b0f0d4fb33fc16cb91ca91177926c1efed1453c200799da4ccea51 SHA512 94d442c69eea1548281bd068a6dd1fb2a8ccddda3615dd2a364e7f9095554f6d114e3aeba0034198cfa3e0782506a36c56a7c75a86a099478ca456d15fee0da7 |
25 |
+DIST node-v8.9.3.tar.xz 18298212 BLAKE2B 7d19fcb77c496fb3aa717d426a3db4630e382738f0fe3273bba3137814470a5fe5e9593c18934cfd62816a0ac33d195eb241c810f4756d84eaa8f974606a485b SHA512 7bd037189925387bfd1339eef5be9af10af0a063914b4cdb2a1f3befec2e76eb566f7d14874b8c70a02172ebeb4d1c1fdbb0715ca8f18b0b5711a38b30214bc8 |
26 |
DIST node-v9.2.0.tar.xz 18347108 BLAKE2B ff98445ac3e7649b4c6fde3a2fe8375e541f7e120d0b2dbd39a07f3953784793752a927c99a74da50f34cfe1447672f8b14af84a56e899fd46e52b9a7f8d19bc SHA512 3335a2ec17f4698bda58f2a2c9548546912b9a4109c0bff0ffc57bca14d40101bcc00356231c95c08733860286ac340e227ca79debac581835f84ae3967cdb4b |
27 |
+DIST node-v9.2.1.tar.xz 18346796 BLAKE2B 8fe82a9b50636fef21f9bba05e89381f6785f18599adb5183d4276df4d0e5b2a4d1bb3d8137143fb87d8638ce82f6812ff237764f7b76f1bee65199a93c91e88 SHA512 379a340186c8299df02a90dce730250d46b502ef58ca4720ede48a5053d0f1e6ee958003dd9e3c0b76f4575980217d9dc5a9cd93a2a4e58da324d04d6d5edc7e |
28 |
|
29 |
diff --git a/net-libs/nodejs/nodejs-8.9.3.ebuild b/net-libs/nodejs/nodejs-8.9.3.ebuild |
30 |
new file mode 100644 |
31 |
index 00000000000..e3f1fec1f46 |
32 |
--- /dev/null |
33 |
+++ b/net-libs/nodejs/nodejs-8.9.3.ebuild |
34 |
@@ -0,0 +1,203 @@ |
35 |
+# Copyright 1999-2017 Gentoo Foundation |
36 |
+# Distributed under the terms of the GNU General Public License v2 |
37 |
+ |
38 |
+EAPI=6 |
39 |
+RESTRICT="test" |
40 |
+ |
41 |
+PYTHON_COMPAT=( python2_7 ) |
42 |
+PYTHON_REQ_USE="threads" |
43 |
+ |
44 |
+inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs |
45 |
+ |
46 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
47 |
+HOMEPAGE="https://nodejs.org/" |
48 |
+SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" |
49 |
+ |
50 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
51 |
+SLOT="0" |
52 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos" |
53 |
+IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test" |
54 |
+REQUIRED_USE=" |
55 |
+ ${PYTHON_REQUIRED_USE} |
56 |
+ inspector? ( icu ssl ) |
57 |
+" |
58 |
+ |
59 |
+RDEPEND=" |
60 |
+ >=dev-libs/libuv-1.15.0:= |
61 |
+ >=net-libs/http-parser-2.7.0:= |
62 |
+ >=net-libs/nghttp2-1.25.0 |
63 |
+ sys-libs/zlib |
64 |
+ icu? ( >=dev-libs/icu-56:= ) |
65 |
+ npm? ( ${PYTHON_DEPS} ) |
66 |
+ ssl? ( >=dev-libs/openssl-1.0.2g:0=[-bindist] ) |
67 |
+" |
68 |
+DEPEND="${RDEPEND} |
69 |
+ ${PYTHON_DEPS} |
70 |
+ systemtap? ( dev-util/systemtap ) |
71 |
+ test? ( net-misc/curl )" |
72 |
+ |
73 |
+S="${WORKDIR}/node-v${PV}" |
74 |
+ |
75 |
+PATCHES=( |
76 |
+ "${FILESDIR}"/gentoo-global-npm-config.patch |
77 |
+ "${FILESDIR}"/nodejs-8.9.0-shared-nghttp2.patch |
78 |
+) |
79 |
+ |
80 |
+pkg_pretend() { |
81 |
+ (use x86 && ! use cpu_flags_x86_sse2) && \ |
82 |
+ die "Your CPU doesn't support the required SSE2 instruction." |
83 |
+ |
84 |
+ ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ |
85 |
+ die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." |
86 |
+} |
87 |
+ |
88 |
+src_prepare() { |
89 |
+ tc-export CC CXX PKG_CONFIG |
90 |
+ export V=1 |
91 |
+ export BUILDTYPE=Release |
92 |
+ |
93 |
+ # fix compilation on Darwin |
94 |
+ # https://code.google.com/p/gyp/issues/detail?id=260 |
95 |
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die |
96 |
+ |
97 |
+ # make sure we use python2.* while using gyp |
98 |
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die |
99 |
+ sed -i -e "s/|| 'python2'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die |
100 |
+ |
101 |
+ # less verbose install output (stating the same as portage, basically) |
102 |
+ sed -i -e "/print/d" tools/install.py || die |
103 |
+ |
104 |
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 |
105 |
+ local LIBDIR=$(get_libdir) |
106 |
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die |
107 |
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js deps/npm/lib/npm.js || die |
108 |
+ |
109 |
+ # Avoid writing a depfile, not useful |
110 |
+ sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die |
111 |
+ |
112 |
+ sed -i -e "/'-O3'/d" common.gypi deps/v8/gypfiles/toolchain.gypi || die |
113 |
+ |
114 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
115 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
116 |
+ # The issue is that no stdin handle is openened when asked for one. |
117 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
118 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
119 |
+ rm test/parallel/test-stdout-close-unref.js || die |
120 |
+ |
121 |
+ # debug builds. change install path, remove optimisations and override buildtype |
122 |
+ if use debug; then |
123 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
124 |
+ BUILDTYPE=Debug |
125 |
+ fi |
126 |
+ |
127 |
+ default |
128 |
+} |
129 |
+ |
130 |
+src_configure() { |
131 |
+ local myconf=( --shared-http-parser --shared-libuv --shared-nghttp2 --shared-zlib ) |
132 |
+ use debug && myconf+=( --debug ) |
133 |
+ use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none ) |
134 |
+ use inspector || myconf+=( --without-inspector ) |
135 |
+ use npm || myconf+=( --without-npm ) |
136 |
+ use snapshot && myconf+=( --with-snapshot ) |
137 |
+ use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl ) |
138 |
+ |
139 |
+ local myarch="" |
140 |
+ case ${ABI} in |
141 |
+ amd64) myarch="x64";; |
142 |
+ arm) myarch="arm";; |
143 |
+ arm64) myarch="arm64";; |
144 |
+ ppc64) myarch="ppc64";; |
145 |
+ x32) myarch="x32";; |
146 |
+ x86) myarch="ia32";; |
147 |
+ *) myarch="${ABI}";; |
148 |
+ esac |
149 |
+ |
150 |
+ GYP_DEFINES="linux_use_gold_flags=0 |
151 |
+ linux_use_bundled_binutils=0 |
152 |
+ linux_use_bundled_gold=0" \ |
153 |
+ "${PYTHON}" configure \ |
154 |
+ --prefix="${EPREFIX}"/usr \ |
155 |
+ --dest-cpu=${myarch} \ |
156 |
+ $(use_with systemtap dtrace) \ |
157 |
+ "${myconf[@]}" || die |
158 |
+} |
159 |
+ |
160 |
+src_compile() { |
161 |
+ emake -C out mksnapshot |
162 |
+ pax-mark m "out/${BUILDTYPE}/mksnapshot" |
163 |
+ emake -C out |
164 |
+} |
165 |
+ |
166 |
+src_install() { |
167 |
+ local LIBDIR="${ED}/usr/$(get_libdir)" |
168 |
+ emake install DESTDIR="${D}" |
169 |
+ pax-mark -m "${ED}"usr/bin/node |
170 |
+ |
171 |
+ # set up a symlink structure that node-gyp expects.. |
172 |
+ dodir /usr/include/node/deps/{v8,uv} |
173 |
+ dosym . /usr/include/node/src |
174 |
+ for var in deps/{uv,v8}/include; do |
175 |
+ dosym ../.. /usr/include/node/${var} |
176 |
+ done |
177 |
+ |
178 |
+ if use doc; then |
179 |
+ # Patch docs to make them offline readable |
180 |
+ for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do |
181 |
+ sed -i '/fonts.googleapis.com/ d' $i; |
182 |
+ done |
183 |
+ # Install docs! |
184 |
+ dohtml -r "${S}"/doc/* |
185 |
+ fi |
186 |
+ |
187 |
+ if use npm; then |
188 |
+ dodir /etc/npm |
189 |
+ |
190 |
+ # Install bash completion for `npm` |
191 |
+ # We need to temporarily replace default config path since |
192 |
+ # npm otherwise tries to write outside of the sandbox |
193 |
+ local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" |
194 |
+ sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die |
195 |
+ local tmp_npm_completion_file="$(emktemp)" |
196 |
+ "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" |
197 |
+ newbashcomp "${tmp_npm_completion_file}" npm |
198 |
+ sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die |
199 |
+ |
200 |
+ # Move man pages |
201 |
+ doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* |
202 |
+ |
203 |
+ # Clean up |
204 |
+ rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die |
205 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die |
206 |
+ |
207 |
+ local find_exp="-or -name" |
208 |
+ local find_name=() |
209 |
+ for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ |
210 |
+ ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ |
211 |
+ "*.md" "*.markdown" "*.bat" "*.cmd"; do |
212 |
+ find_name+=( ${find_exp} "${match}" ) |
213 |
+ done |
214 |
+ |
215 |
+ # Remove various development and/or inappropriate files and |
216 |
+ # useless docs of dependend packages. |
217 |
+ find "${LIBDIR}"/node_modules \ |
218 |
+ \( -type d -name examples \) -or \( -type f \( \ |
219 |
+ -iname "LICEN?E*" \ |
220 |
+ "${find_name[@]}" \ |
221 |
+ \) \) -exec rm -rf "{}" \; |
222 |
+ fi |
223 |
+} |
224 |
+ |
225 |
+src_test() { |
226 |
+ out/${BUILDTYPE}/cctest || die |
227 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
228 |
+} |
229 |
+ |
230 |
+pkg_postinst() { |
231 |
+ einfo "The global npm config lives in /etc/npm. This deviates slightly" |
232 |
+ einfo "from upstream which otherwise would have it live in /usr/etc/." |
233 |
+ einfo "" |
234 |
+ einfo "Protip: When using node-gyp to install native modules, you can" |
235 |
+ einfo "avoid having to download extras by doing the following:" |
236 |
+ einfo "$ node-gyp --nodedir /usr/include/node <command>" |
237 |
+} |
238 |
|
239 |
diff --git a/net-libs/nodejs/nodejs-9.2.1.ebuild b/net-libs/nodejs/nodejs-9.2.1.ebuild |
240 |
new file mode 100644 |
241 |
index 00000000000..782c1225204 |
242 |
--- /dev/null |
243 |
+++ b/net-libs/nodejs/nodejs-9.2.1.ebuild |
244 |
@@ -0,0 +1,203 @@ |
245 |
+# Copyright 1999-2017 Gentoo Foundation |
246 |
+# Distributed under the terms of the GNU General Public License v2 |
247 |
+ |
248 |
+EAPI=6 |
249 |
+RESTRICT="test" |
250 |
+ |
251 |
+PYTHON_COMPAT=( python2_7 ) |
252 |
+PYTHON_REQ_USE="threads" |
253 |
+ |
254 |
+inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs |
255 |
+ |
256 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
257 |
+HOMEPAGE="https://nodejs.org/" |
258 |
+SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" |
259 |
+ |
260 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
261 |
+SLOT="0" |
262 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos" |
263 |
+IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test" |
264 |
+REQUIRED_USE=" |
265 |
+ ${PYTHON_REQUIRED_USE} |
266 |
+ inspector? ( icu ssl ) |
267 |
+" |
268 |
+ |
269 |
+RDEPEND=" |
270 |
+ >=dev-libs/libuv-1.16.1:= |
271 |
+ >=net-libs/http-parser-2.7.0:= |
272 |
+ >=net-libs/nghttp2-1.25.0 |
273 |
+ sys-libs/zlib |
274 |
+ icu? ( >=dev-libs/icu-59:= ) |
275 |
+ npm? ( ${PYTHON_DEPS} ) |
276 |
+ ssl? ( >=dev-libs/openssl-1.0.2g:0=[-bindist] ) |
277 |
+" |
278 |
+DEPEND="${RDEPEND} |
279 |
+ ${PYTHON_DEPS} |
280 |
+ systemtap? ( dev-util/systemtap ) |
281 |
+ test? ( net-misc/curl )" |
282 |
+ |
283 |
+S="${WORKDIR}/node-v${PV}" |
284 |
+ |
285 |
+PATCHES=( |
286 |
+ "${FILESDIR}"/gentoo-global-npm-config.patch |
287 |
+ "${FILESDIR}"/nodejs-9.2.0-shared-nghttp2.patch |
288 |
+) |
289 |
+ |
290 |
+pkg_pretend() { |
291 |
+ (use x86 && ! use cpu_flags_x86_sse2) && \ |
292 |
+ die "Your CPU doesn't support the required SSE2 instruction." |
293 |
+ |
294 |
+ ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ |
295 |
+ die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." |
296 |
+} |
297 |
+ |
298 |
+src_prepare() { |
299 |
+ tc-export CC CXX PKG_CONFIG |
300 |
+ export V=1 |
301 |
+ export BUILDTYPE=Release |
302 |
+ |
303 |
+ # fix compilation on Darwin |
304 |
+ # https://code.google.com/p/gyp/issues/detail?id=260 |
305 |
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die |
306 |
+ |
307 |
+ # make sure we use python2.* while using gyp |
308 |
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die |
309 |
+ sed -i -e "s/|| 'python2'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die |
310 |
+ |
311 |
+ # less verbose install output (stating the same as portage, basically) |
312 |
+ sed -i -e "/print/d" tools/install.py || die |
313 |
+ |
314 |
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 |
315 |
+ local LIBDIR=$(get_libdir) |
316 |
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die |
317 |
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js deps/npm/lib/npm.js || die |
318 |
+ |
319 |
+ # Avoid writing a depfile, not useful |
320 |
+ sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die |
321 |
+ |
322 |
+ sed -i -e "/'-O3'/d" common.gypi deps/v8/gypfiles/toolchain.gypi || die |
323 |
+ |
324 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
325 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
326 |
+ # The issue is that no stdin handle is openened when asked for one. |
327 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
328 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
329 |
+ rm test/parallel/test-stdout-close-unref.js || die |
330 |
+ |
331 |
+ # debug builds. change install path, remove optimisations and override buildtype |
332 |
+ if use debug; then |
333 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
334 |
+ BUILDTYPE=Debug |
335 |
+ fi |
336 |
+ |
337 |
+ default |
338 |
+} |
339 |
+ |
340 |
+src_configure() { |
341 |
+ local myconf=( --shared-http-parser --shared-libuv --shared-nghttp2 --shared-zlib ) |
342 |
+ use debug && myconf+=( --debug ) |
343 |
+ use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none ) |
344 |
+ use inspector || myconf+=( --without-inspector ) |
345 |
+ use npm || myconf+=( --without-npm ) |
346 |
+ use snapshot && myconf+=( --with-snapshot ) |
347 |
+ use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl ) |
348 |
+ |
349 |
+ local myarch="" |
350 |
+ case ${ABI} in |
351 |
+ amd64) myarch="x64";; |
352 |
+ arm) myarch="arm";; |
353 |
+ arm64) myarch="arm64";; |
354 |
+ ppc64) myarch="ppc64";; |
355 |
+ x32) myarch="x32";; |
356 |
+ x86) myarch="ia32";; |
357 |
+ *) myarch="${ABI}";; |
358 |
+ esac |
359 |
+ |
360 |
+ GYP_DEFINES="linux_use_gold_flags=0 |
361 |
+ linux_use_bundled_binutils=0 |
362 |
+ linux_use_bundled_gold=0" \ |
363 |
+ "${PYTHON}" configure \ |
364 |
+ --prefix="${EPREFIX}"/usr \ |
365 |
+ --dest-cpu=${myarch} \ |
366 |
+ $(use_with systemtap dtrace) \ |
367 |
+ "${myconf[@]}" || die |
368 |
+} |
369 |
+ |
370 |
+src_compile() { |
371 |
+ emake -C out mksnapshot |
372 |
+ pax-mark m "out/${BUILDTYPE}/mksnapshot" |
373 |
+ emake -C out |
374 |
+} |
375 |
+ |
376 |
+src_install() { |
377 |
+ local LIBDIR="${ED}/usr/$(get_libdir)" |
378 |
+ emake install DESTDIR="${D}" |
379 |
+ pax-mark -m "${ED}"usr/bin/node |
380 |
+ |
381 |
+ # set up a symlink structure that node-gyp expects.. |
382 |
+ dodir /usr/include/node/deps/{v8,uv} |
383 |
+ dosym . /usr/include/node/src |
384 |
+ for var in deps/{uv,v8}/include; do |
385 |
+ dosym ../.. /usr/include/node/${var} |
386 |
+ done |
387 |
+ |
388 |
+ if use doc; then |
389 |
+ # Patch docs to make them offline readable |
390 |
+ for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do |
391 |
+ sed -i '/fonts.googleapis.com/ d' $i; |
392 |
+ done |
393 |
+ # Install docs! |
394 |
+ dohtml -r "${S}"/doc/* |
395 |
+ fi |
396 |
+ |
397 |
+ if use npm; then |
398 |
+ dodir /etc/npm |
399 |
+ |
400 |
+ # Install bash completion for `npm` |
401 |
+ # We need to temporarily replace default config path since |
402 |
+ # npm otherwise tries to write outside of the sandbox |
403 |
+ local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" |
404 |
+ sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die |
405 |
+ local tmp_npm_completion_file="$(emktemp)" |
406 |
+ "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" |
407 |
+ newbashcomp "${tmp_npm_completion_file}" npm |
408 |
+ sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die |
409 |
+ |
410 |
+ # Move man pages |
411 |
+ doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* |
412 |
+ |
413 |
+ # Clean up |
414 |
+ rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die |
415 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die |
416 |
+ |
417 |
+ local find_exp="-or -name" |
418 |
+ local find_name=() |
419 |
+ for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ |
420 |
+ ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ |
421 |
+ "*.md" "*.markdown" "*.bat" "*.cmd"; do |
422 |
+ find_name+=( ${find_exp} "${match}" ) |
423 |
+ done |
424 |
+ |
425 |
+ # Remove various development and/or inappropriate files and |
426 |
+ # useless docs of dependend packages. |
427 |
+ find "${LIBDIR}"/node_modules \ |
428 |
+ \( -type d -name examples \) -or \( -type f \( \ |
429 |
+ -iname "LICEN?E*" \ |
430 |
+ "${find_name[@]}" \ |
431 |
+ \) \) -exec rm -rf "{}" \; |
432 |
+ fi |
433 |
+} |
434 |
+ |
435 |
+src_test() { |
436 |
+ out/${BUILDTYPE}/cctest || die |
437 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
438 |
+} |
439 |
+ |
440 |
+pkg_postinst() { |
441 |
+ einfo "The global npm config lives in /etc/npm. This deviates slightly" |
442 |
+ einfo "from upstream which otherwise would have it live in /usr/etc/." |
443 |
+ einfo "" |
444 |
+ einfo "Protip: When using node-gyp to install native modules, you can" |
445 |
+ einfo "avoid having to download extras by doing the following:" |
446 |
+ einfo "$ node-gyp --nodedir /usr/include/node <command>" |
447 |
+} |