1 |
commit: 9e9fe5372bd6c85aae705b9f036c8cd93b61b02c |
2 |
Author: Patrick Lauer <patrick <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 29 15:39:39 2016 +0000 |
4 |
Commit: Patrick Lauer <patrick <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 29 15:39:55 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e9fe537 |
7 |
|
8 |
net-libs/nodejs: Bump |
9 |
|
10 |
Package-Manager: portage-2.3.0 |
11 |
|
12 |
net-libs/nodejs/Manifest | 2 + |
13 |
net-libs/nodejs/nodejs-4.6.0.ebuild | 144 +++++++++++++++++++++++++++ |
14 |
net-libs/nodejs/nodejs-6.7.0.ebuild | 193 ++++++++++++++++++++++++++++++++++++ |
15 |
3 files changed, 339 insertions(+) |
16 |
|
17 |
diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest |
18 |
index 6e17046..9440a84 100644 |
19 |
--- a/net-libs/nodejs/Manifest |
20 |
+++ b/net-libs/nodejs/Manifest |
21 |
@@ -6,8 +6,10 @@ DIST node-v4.4.1.tar.xz 13112424 SHA256 3a37c89a3ac965688f9e6557579993b73eee4419 |
22 |
DIST node-v4.4.6.tar.xz 13211732 SHA256 0f6bbfbea525469c91932b1aac35e0810e6bcda96f1c720e42a433942ee66106 SHA512 b06219ab63de89eeb1268d677769cb17c8290555962b1cbfaafbede3d2dbefaafb455f32a611160fcfbf7400059fa79ec3f9c2f3287c8746669c05b42d7aaa7c WHIRLPOOL ffb1372193a72a2e1ae6e21c281a28e770443e36e5e349b48bf30e92b3f6f9d9ba901794eaf1f7c8eaf05c7365e1249bb210760fa26680ed13d1a6d8854c8ce8 |
23 |
DIST node-v4.4.7.tar.xz 13231156 SHA256 1ef900b9cb3ffb617c433a3247a9d67ff36c9455cbc9c34175bee24bdbfdf731 SHA512 0b4df07057ad8661fec7a2194d608e37d9c4d50b3e023bcc8c3b40308af6925098c280ca4b0c96454ea4f03f556d6b92133a6e5d3d61036afc5dd89e18c95c9e WHIRLPOOL 3559240a51f77c64db5edd8d3436085f8a4164a25e442df90bdd4c4a81f06a863fe94c4bf26e7ad5b0c1bf6e1102b769fc18fa89ea76c548d84e4cfc9ee43d87 |
24 |
DIST node-v4.5.0.tar.xz 13271372 SHA256 97b99d378c56802444208409568e2e66c46332897f06aead74d1ffbe733bd488 SHA512 3f4f826c5a6b7717b4fa000475a7f32d47f92ea6a7d83752139713dae5544ec6d4db39f3200b4162bbe262d85d8f697938d83fb96b83acc572d30cd7fc2c7127 WHIRLPOOL 7321132e887f21f83ed87455c2783d947acaa65e66915bd41b25451b49ebc584161695c96e990a54e0439a34089519a0d4ca03f1463c5b29f44fae0ee07dd46f |
25 |
+DIST node-v4.6.0.tar.xz 13295184 SHA256 42910dbd34e49bfc40580e06753947c30d31101455a38e9f0343a23d67c0c694 SHA512 d3e79f7e361af888955f311818c0d0401a29fd99a86fa125924b3f7891f209f84f4f662dba071c9bdbb3d11a3b3097274d95bdc4a51143a2e816400ff71b041f WHIRLPOOL 011d1de801b87be413b7838e0b0ea216909bbe4a2d88a5045536d65d3b85cca64f9e94923859a65d8b6ed1fcbbf34a9463c7a8fc036ba1f0b902f8b4a07b83ac |
26 |
DIST node-v5.10.1.tar.xz 13317868 SHA256 9eecd853cdd06ebee24a1bb8d753cd20af5a19297c5d3a3b1680fe36b47d5cbe SHA512 e0dcd5fd6d23c4905a4fbf483621cb2a878516a5bfeefad68901edd1be2dba76281cd22fff073f5f8e2432dbac3c68728c597e1aab753ce3b3dfe9e0674ef808 WHIRLPOOL 2aecbb9a538320c09d6306a756ed6cde2537fd4d9e5ef9b6713956062178ba8070d060e1ae2fab264d834fbb1e5452eaf744b4c0a9cd70ffa181e6c479b4086a |
27 |
DIST node-v5.11.0.tar.xz 13298460 SHA256 083766aff72fc5c78f6999dd0d00bc0340a052ab270fd60d6928b719ca2b3fd1 SHA512 47f2b25007877dc7597af9dd841e4f30197a9df6dcf01f45336c2eaec8d5c75057534b962df361e9bdaf461dab8cb97a878d326d74105a38a7797b77ed67df44 WHIRLPOOL 0b670baa82e3dbd0a2492476f3ebca8006d7c1c4efef47e85954624ad776517a3f0403d8556e438c16c8373818bed444bc66a72500c3a55025d50cdb694ec411 |
28 |
DIST node-v5.9.1.tar.xz 13226192 SHA256 668067077dfceb3d2039d0df693fec6aa20b920d01a42b53dc61d4aa91e0ae55 SHA512 34774d88eda775bdf153a76bd02b26c499e4a9ef47d8e94ad7b66d360d04891b45ce8f211833ca69e8c0a786ca36424b0c620a90b1fbc6d5afc77d20f4b5fadb WHIRLPOOL d666aa6fd4d577f7a6f89c3bfa75e62a0281e0dd7592373f384bfe01fa2dcbf81156bf6a21fc2097d48d5024a39057713c2593f4609c70ff8f84090471b073a9 |
29 |
DIST node-v6.5.0.tar.xz 15555848 SHA256 ddf2056a9164c723db707b6c016f9e617f17166298dc88c5a7cb1d7d5ddb1290 SHA512 1a0ba9de2b6f270d124275cb1d098fd4c667a6c408a48fac3d92bfc3d957e3de5c1fea8172c96dd94a3b7826ef1d93859152cc835a07cf07d7b09858f874b2da WHIRLPOOL 3ffdbbcbbe94a0bf8f7bbe86a9832cc97f9796a35e7638daf07acd9822ef9b0afb4946e24664e15007b8c31948c3a686f2208a96d72acf3337a7fa7e1a443b44 |
30 |
DIST node-v6.6.0.tar.xz 15580876 SHA256 640485d2b672d3313203eae164576539e61f1e55d68122ff2c7fb59896e21a33 SHA512 3b382f98d9c92dbb1fa9c93969b14aa0be8d7b7eabbecf8be30ff92e9a5519cbaa5f5349b2dc88e919281638d6b7f109ff0f2fa03f84c7765c0fae496d51b1f2 WHIRLPOOL 395a4cfe26877cf6f1271d677d1538ddb78024030f5d8404426e7ef2acc4eb88e0914d8f27760cac4508dccbedfb1cfe8692eeaa2e091e2dc6b961a25053b273 |
31 |
+DIST node-v6.7.0.tar.xz 15609148 SHA256 ceb028324aab1ee8c7ea6a62026f036f3ea71f5ef5212593d0f833f999dd3be5 SHA512 acf86362e33d10c5c59349a086fa2e07368e8bbb58b00c3d0df2c571e8ba637c5bee8f08d344d8693a24fcd75884448f9f3d389f2af48de6a86fc6b064c3e1ba WHIRLPOOL 3c3adf10ad6abd5aa71b5773def1661b2acd873c63ebcbe79c8f409ed83fc309a1cde4a45d241687485e709a5996062a046439bad8f2644616c5c839522baf4b |
32 |
|
33 |
diff --git a/net-libs/nodejs/nodejs-4.6.0.ebuild b/net-libs/nodejs/nodejs-4.6.0.ebuild |
34 |
new file mode 100644 |
35 |
index 00000000..4da7b46 |
36 |
--- /dev/null |
37 |
+++ b/net-libs/nodejs/nodejs-4.6.0.ebuild |
38 |
@@ -0,0 +1,144 @@ |
39 |
+# Copyright 1999-2016 Gentoo Foundation |
40 |
+# Distributed under the terms of the GNU General Public License v2 |
41 |
+# $Id$ |
42 |
+ |
43 |
+EAPI=5 |
44 |
+ |
45 |
+PYTHON_COMPAT=( python2_7 ) |
46 |
+PYTHON_REQ_USE="threads" |
47 |
+ |
48 |
+inherit flag-o-matic pax-utils python-single-r1 toolchain-funcs |
49 |
+ |
50 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
51 |
+HOMEPAGE="https://nodejs.org/" |
52 |
+SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" |
53 |
+ |
54 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
55 |
+SLOT="0" |
56 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~x64-macos" |
57 |
+IUSE="cpu_flags_x86_sse2 debug icu +npm snapshot +ssl test" |
58 |
+ |
59 |
+RDEPEND="icu? ( >=dev-libs/icu-55:= ) |
60 |
+ npm? ( ${PYTHON_DEPS} ) |
61 |
+ >=net-libs/http-parser-2.5.2:= |
62 |
+ >=dev-libs/libuv-1.8.0:= |
63 |
+ >=dev-libs/openssl-1.0.2g:0=[-bindist] |
64 |
+ sys-libs/zlib" |
65 |
+DEPEND="${RDEPEND} |
66 |
+ ${PYTHON_DEPS} |
67 |
+ test? ( net-misc/curl )" |
68 |
+ |
69 |
+S="${WORKDIR}/node-v${PV}" |
70 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
71 |
+ |
72 |
+pkg_pretend() { |
73 |
+ (use x86 && ! use cpu_flags_x86_sse2) && \ |
74 |
+ die "Your CPU doesn't support the required SSE2 instruction." |
75 |
+ |
76 |
+ ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ |
77 |
+ die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." |
78 |
+} |
79 |
+ |
80 |
+src_prepare() { |
81 |
+ tc-export CC CXX PKG_CONFIG |
82 |
+ export V=1 # Verbose build |
83 |
+ export BUILDTYPE=Release |
84 |
+ |
85 |
+ # fix compilation on Darwin |
86 |
+ # https://code.google.com/p/gyp/issues/detail?id=260 |
87 |
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die |
88 |
+ |
89 |
+ # make sure we use python2.* while using gyp |
90 |
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die |
91 |
+ sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die |
92 |
+ |
93 |
+ # less verbose install output (stating the same as portage, basically) |
94 |
+ sed -i -e "/print/d" tools/install.py || die |
95 |
+ |
96 |
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 |
97 |
+ local LIBDIR=$(get_libdir) |
98 |
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die |
99 |
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die |
100 |
+ sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die |
101 |
+ |
102 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
103 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
104 |
+ # The issue is that no stdin handle is openened when asked for one. |
105 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
106 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
107 |
+ rm test/parallel/test-stdout-close-unref.js || die |
108 |
+ |
109 |
+ # debug builds. change install path, remove optimisations and override buildtype |
110 |
+ if use debug; then |
111 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
112 |
+ BUILDTYPE=Debug |
113 |
+ fi |
114 |
+ |
115 |
+ epatch_user |
116 |
+} |
117 |
+ |
118 |
+src_configure() { |
119 |
+ local myarch="" |
120 |
+ local myconf+=( --shared-openssl --shared-libuv --shared-http-parser --shared-zlib ) |
121 |
+ use npm || myconf+=( --without-npm ) |
122 |
+ use icu && myconf+=( --with-intl=system-icu ) |
123 |
+ use snapshot && myconf+=( --with-snapshot ) |
124 |
+ use ssl || myconf+=( --without-ssl ) |
125 |
+ use debug && myconf+=( --debug ) |
126 |
+ |
127 |
+ case ${ABI} in |
128 |
+ amd64) myarch="x64";; |
129 |
+ arm) myarch="arm";; |
130 |
+ arm64) myarch="arm64";; |
131 |
+ ppc64) myarch="ppc64";; |
132 |
+ x32) myarch="x32";; |
133 |
+ x86) myarch="ia32";; |
134 |
+ *) die "Unrecognized ARCH ${ARCH}";; |
135 |
+ esac |
136 |
+ |
137 |
+ GYP_DEFINES="linux_use_gold_flags=0 |
138 |
+ linux_use_bundled_binutils=0 |
139 |
+ linux_use_bundled_gold=0" \ |
140 |
+ "${PYTHON}" configure \ |
141 |
+ --prefix="${EPREFIX}"/usr \ |
142 |
+ --dest-cpu=${myarch} \ |
143 |
+ --without-dtrace \ |
144 |
+ "${myconf[@]}" || die |
145 |
+} |
146 |
+ |
147 |
+src_compile() { |
148 |
+ emake -C out mksnapshot |
149 |
+ pax-mark m "out/${BUILDTYPE}/mksnapshot" |
150 |
+ emake -C out |
151 |
+} |
152 |
+ |
153 |
+src_install() { |
154 |
+ local LIBDIR="${ED}/usr/$(get_libdir)" |
155 |
+ emake install DESTDIR="${ED}" PREFIX=/usr |
156 |
+ if use npm; then |
157 |
+ dodoc -r "${LIBDIR}"/node_modules/npm/html |
158 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html} || die |
159 |
+ find "${LIBDIR}"/node_modules -type f -name "LICENSE*" -or -name "LICENCE*" -delete || die |
160 |
+ fi |
161 |
+ |
162 |
+ # set up a symlink structure that npm expects.. |
163 |
+ dodir /usr/include/node/deps/{v8,uv} |
164 |
+ dosym . /usr/include/node/src |
165 |
+ for var in deps/{uv,v8}/include; do |
166 |
+ dosym ../.. /usr/include/node/${var} |
167 |
+ done |
168 |
+ |
169 |
+ pax-mark -m "${ED}"/usr/bin/node |
170 |
+} |
171 |
+ |
172 |
+src_test() { |
173 |
+ out/${BUILDTYPE}/cctest || die |
174 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
175 |
+} |
176 |
+ |
177 |
+pkg_postinst() { |
178 |
+ einfo "When using node-gyp to install native modules, you can avoid" |
179 |
+ einfo "having to download the full tarball by doing the following:" |
180 |
+ einfo "" |
181 |
+ einfo "node-gyp --nodedir /usr/include/node <command>" |
182 |
+} |
183 |
|
184 |
diff --git a/net-libs/nodejs/nodejs-6.7.0.ebuild b/net-libs/nodejs/nodejs-6.7.0.ebuild |
185 |
new file mode 100644 |
186 |
index 00000000..4e76890 |
187 |
--- /dev/null |
188 |
+++ b/net-libs/nodejs/nodejs-6.7.0.ebuild |
189 |
@@ -0,0 +1,193 @@ |
190 |
+# Copyright 1999-2016 Gentoo Foundation |
191 |
+# Distributed under the terms of the GNU General Public License v2 |
192 |
+# $Id$ |
193 |
+ |
194 |
+EAPI=6 |
195 |
+ |
196 |
+PYTHON_COMPAT=( python2_7 ) |
197 |
+PYTHON_REQ_USE="threads" |
198 |
+ |
199 |
+inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs |
200 |
+ |
201 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
202 |
+HOMEPAGE="https://nodejs.org/" |
203 |
+SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" |
204 |
+ |
205 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
206 |
+SLOT="0" |
207 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x64-macos" |
208 |
+IUSE="cpu_flags_x86_sse2 debug doc icu +npm +snapshot +ssl test" |
209 |
+ |
210 |
+RDEPEND="icu? ( >=dev-libs/icu-56:= ) |
211 |
+ npm? ( ${PYTHON_DEPS} ) |
212 |
+ >=net-libs/http-parser-2.6.2:= |
213 |
+ >=dev-libs/libuv-1.9.0:= |
214 |
+ >=dev-libs/openssl-1.0.2g:0=[-bindist] |
215 |
+ sys-libs/zlib" |
216 |
+DEPEND="${RDEPEND} |
217 |
+ ${PYTHON_DEPS} |
218 |
+ test? ( net-misc/curl )" |
219 |
+ |
220 |
+S="${WORKDIR}/node-v${PV}" |
221 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
222 |
+ |
223 |
+PATCHES=( |
224 |
+ "${FILESDIR}"/gentoo-global-npm-config.patch |
225 |
+) |
226 |
+ |
227 |
+pkg_pretend() { |
228 |
+ (use x86 && ! use cpu_flags_x86_sse2) && \ |
229 |
+ die "Your CPU doesn't support the required SSE2 instruction." |
230 |
+ |
231 |
+ ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ |
232 |
+ die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." |
233 |
+} |
234 |
+ |
235 |
+src_prepare() { |
236 |
+ tc-export CC CXX PKG_CONFIG |
237 |
+ export V=1 |
238 |
+ export BUILDTYPE=Release |
239 |
+ |
240 |
+ # fix compilation on Darwin |
241 |
+ # https://code.google.com/p/gyp/issues/detail?id=260 |
242 |
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die |
243 |
+ |
244 |
+ # make sure we use python2.* while using gyp |
245 |
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die |
246 |
+ sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die |
247 |
+ |
248 |
+ # less verbose install output (stating the same as portage, basically) |
249 |
+ sed -i -e "/print/d" tools/install.py || die |
250 |
+ |
251 |
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 |
252 |
+ local LIBDIR=$(get_libdir) |
253 |
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die |
254 |
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die |
255 |
+ sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die |
256 |
+ |
257 |
+ # Avoid writing a depfile, not useful |
258 |
+ sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die |
259 |
+ |
260 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
261 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
262 |
+ # The issue is that no stdin handle is openened when asked for one. |
263 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
264 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
265 |
+ rm test/parallel/test-stdout-close-unref.js || die |
266 |
+ |
267 |
+ # debug builds. change install path, remove optimisations and override buildtype |
268 |
+ if use debug; then |
269 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
270 |
+ BUILDTYPE=Debug |
271 |
+ fi |
272 |
+ |
273 |
+ default |
274 |
+} |
275 |
+ |
276 |
+src_configure() { |
277 |
+ local myarch="" |
278 |
+ local myconf=( --shared-openssl --shared-libuv --shared-http-parser --shared-zlib ) |
279 |
+ use npm || myconf+=( --without-npm ) |
280 |
+ use icu && myconf+=( --with-intl=system-icu ) |
281 |
+ use snapshot && myconf+=( --with-snapshot ) |
282 |
+ use ssl || myconf+=( --without-ssl ) |
283 |
+ use debug && myconf+=( --debug ) |
284 |
+ |
285 |
+ case ${ABI} in |
286 |
+ amd64) myarch="x64";; |
287 |
+ arm) myarch="arm";; |
288 |
+ arm64) myarch="arm64";; |
289 |
+ ppc64) myarch="ppc64";; |
290 |
+ x32) myarch="x32";; |
291 |
+ x86) myarch="ia32";; |
292 |
+ *) myarch="${ABI}";; |
293 |
+ esac |
294 |
+ |
295 |
+ GYP_DEFINES="linux_use_gold_flags=0 |
296 |
+ linux_use_bundled_binutils=0 |
297 |
+ linux_use_bundled_gold=0" \ |
298 |
+ "${PYTHON}" configure \ |
299 |
+ --prefix="${EPREFIX}"/usr \ |
300 |
+ --dest-cpu=${myarch} \ |
301 |
+ --without-dtrace \ |
302 |
+ "${myconf[@]}" || die |
303 |
+} |
304 |
+ |
305 |
+src_compile() { |
306 |
+ emake -C out mksnapshot |
307 |
+ pax-mark m "out/${BUILDTYPE}/mksnapshot" |
308 |
+ emake -C out |
309 |
+} |
310 |
+ |
311 |
+src_install() { |
312 |
+ local LIBDIR="${ED}/usr/$(get_libdir)" |
313 |
+ emake install DESTDIR="${D}" |
314 |
+ pax-mark -m "${ED}"usr/bin/node |
315 |
+ |
316 |
+ # set up a symlink structure that node-gyp expects.. |
317 |
+ dodir /usr/include/node/deps/{v8,uv} |
318 |
+ dosym . /usr/include/node/src |
319 |
+ for var in deps/{uv,v8}/include; do |
320 |
+ dosym ../.. /usr/include/node/${var} |
321 |
+ done |
322 |
+ |
323 |
+ if use doc; then |
324 |
+ # Patch docs to make them offline readable |
325 |
+ for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do |
326 |
+ sed -i '/fonts.googleapis.com/ d' $i; |
327 |
+ done |
328 |
+ # Install docs! |
329 |
+ dohtml -r "${S}"/doc/* |
330 |
+ fi |
331 |
+ |
332 |
+ if use npm; then |
333 |
+ dodir /etc/npm |
334 |
+ |
335 |
+ # Install bash completion for `npm` |
336 |
+ # We need to temporarily replace default config path since |
337 |
+ # npm otherwise tries to write outside of the sandbox |
338 |
+ local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" |
339 |
+ sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die |
340 |
+ local tmp_npm_completion_file="$(emktemp)" |
341 |
+ "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" |
342 |
+ newbashcomp "${tmp_npm_completion_file}" npm |
343 |
+ sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die |
344 |
+ |
345 |
+ # Move man pages |
346 |
+ doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* |
347 |
+ |
348 |
+ # Clean up |
349 |
+ rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die |
350 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die |
351 |
+ |
352 |
+ local find_exp="-or -name" |
353 |
+ local find_name=() |
354 |
+ for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ |
355 |
+ ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ |
356 |
+ "*.md" "*.markdown" "*.bat" "*.cmd"; do |
357 |
+ find_name+=( ${find_exp} "${match}" ) |
358 |
+ done |
359 |
+ |
360 |
+ # Remove various development and/or inappropriate files and |
361 |
+ # useless docs of dependend packages. |
362 |
+ find "${LIBDIR}"/node_modules \ |
363 |
+ \( -type d -name examples \) -or \( -type f \( \ |
364 |
+ -iname "LICEN?E*" \ |
365 |
+ "${find_name[@]}" \ |
366 |
+ \) \) -exec rm -rf "{}" \; |
367 |
+ fi |
368 |
+} |
369 |
+ |
370 |
+src_test() { |
371 |
+ out/${BUILDTYPE}/cctest || die |
372 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
373 |
+} |
374 |
+ |
375 |
+pkg_postinst() { |
376 |
+ einfo "The global npm config lives in /etc/npm. This deviates slightly" |
377 |
+ einfo "from upstream which otherwise would have it live in /usr/etc/." |
378 |
+ einfo "" |
379 |
+ einfo "Protip: When using node-gyp to install native modules, you can" |
380 |
+ einfo "avoid having to download extras by doing the following:" |
381 |
+ einfo "$ node-gyp --nodedir /usr/include/node <command>" |
382 |
+} |