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