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