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