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