1 |
commit: a094588479125876d7495566c67debfc27707431 |
2 |
Author: Patrick Lauer <patrick <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 28 18:01:23 2016 +0000 |
4 |
Commit: Patrick Lauer <patrick <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 28 18:01:36 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a0945884 |
7 |
|
8 |
net-libs/nodejs: Bump |
9 |
|
10 |
Package-Manager: Portage-2.3.3, Repoman-2.3.1 |
11 |
|
12 |
net-libs/nodejs/Manifest | 2 + |
13 |
net-libs/nodejs/nodejs-6.9.2.ebuild | 193 +++++++++++++++++++++++++++++++++++ |
14 |
net-libs/nodejs/nodejs-7.3.0.ebuild | 194 ++++++++++++++++++++++++++++++++++++ |
15 |
3 files changed, 389 insertions(+) |
16 |
|
17 |
diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest |
18 |
index c396371..71e5e97 100644 |
19 |
--- a/net-libs/nodejs/Manifest |
20 |
+++ b/net-libs/nodejs/Manifest |
21 |
@@ -4,5 +4,7 @@ DIST node-v4.6.0.tar.xz 13295184 SHA256 42910dbd34e49bfc40580e06753947c30d311014 |
22 |
DIST node-v4.6.1.tar.xz 13295568 SHA256 fe2a85df8758001878abb5bbaf17a6b6cdc12b3e465b1d3bace83b37fdf0345a SHA512 4eb2acbe13ee2373922420e3238be63d2108dacba640438bddbdea12ec2de9c655f33db611e4c0654b66bf4fdb844a7b6554a823aac73171b17599096856abdb WHIRLPOOL a6d21cce7ab8c430528682f78a6e6492f753c87949b7b1bdc15dc02911559cd89deb45329c2ba32da57b776dd4feaabec8a3e7a59a78094cfb079261b6475c76 |
23 |
DIST node-v6.9.0.tar.xz 15615224 SHA256 656342ed8a84c95a36af902f309aeeca7103b16d61c02925bd37bd47d2194915 SHA512 c8dc6899e8ec9d97d37b72a0ff6483069c494b05020ff6cf101c2b8b2774ed2673138fc260dc90b7317123d77daf89d0ba3321deda47457fa892456054f93337 WHIRLPOOL e65031667b619e0449924272359db01fd846dc68238e45a2bc4890d6f539b32dc173bab282c858412f2d34b73cdf68371a5677d081f9b56fb19791a9354ad740 |
24 |
DIST node-v6.9.1.tar.xz 15617228 SHA256 0bdd8d1305777cc8cd206129ea494d6c6ce56001868dd80147aff531d6df0729 SHA512 3f1c724dfc9f76f101064be6ef222482f3b7e53d8d6c026b3d166dfbdd104f05055cf04a3205679793fa12f946548fc06e3272527655b28002d0bf0e7eccdf1b WHIRLPOOL dd1607b4c193f7ef05f7d0571f31c72133464e2ebd023278cf055d7156daa6e194e5170948f32cae8027f1ef5c6eaef6a89bf7271ed386d45c787b30e57880fb |
25 |
+DIST node-v6.9.2.tar.xz 15628240 SHA256 f41b320b37ce23a34dbc597040e71535ea4f6baa2342bc526bb45f5f9aa9c9fb SHA512 d433661af57e9367296dc3ca8a4cd9662344ec868655f94aaf20685a589eabfb762ce5e84556da08460d6862d67eebb12505623a58daf299f2983a54d5a84d5f WHIRLPOOL 76ebb495d8bb4837e8f8efaa47ff0f1dcddba5a4d6b8165bf2e12de40736b0d8e7f42e92d2cb04e14c2aad9841d79fcbb3de87968b73dd26681f388be08e214f |
26 |
DIST node-v7.0.0.tar.xz 16296516 SHA256 e16c3c76c2d6756bbfd711189cbdaf5676049b443e6817007bb537f243ca899a SHA512 775b3a786ca6975b1913f048ea9a969e674d6d8ca58094557fe21e7c821e10f8d4bd8d484ca3617b553587449020ecf1d3d8c8d912c46725bab7f7561c2fbdda WHIRLPOOL e9068c49181151ebcf1dd75f5ecb8ee87b89abc7695cb9158bbfa701de9344bc5c2b59b5363d5be4a65bb4df1c37b8f6285b6c584f43ad3f933628a7e175ff1f |
27 |
DIST node-v7.2.0.tar.xz 16407484 SHA256 486d4db7ef659521ad2fafefca877638da07bef61e2aee090207ff52149294fb SHA512 482067965ac97f296a66317b6b10950087f9f61cf1bd3ee5275da6ca804aa2669cd1f82dc619ece576996403b27b295380b53c308ce5defe91c7b75a6bd3e91e WHIRLPOOL 37cebc3350b97390640a38c8701667cf66411fe2abdc41e77b089f2415f88434426e7da5a8192543ed63fa6dcd5ea768dfc2b33fbcf16431b36e4decbd4b793c |
28 |
+DIST node-v7.3.0.tar.xz 16434356 SHA256 dde8f6c800ac8049016d86b91ba5aeb6ddb35cb747cd74756dc05cf9fbe16b81 SHA512 97961c68d097d71ff5030e04526935921af498acba7e9081cd8699c624d4df9b9ce9992c29fe224387a26a53727dcc2181b63841e75e69808295b259bd6da1f1 WHIRLPOOL 7ec8be0b169e3361896296cfe08b9fda8a0e467c479f6305ec255fc26ad1b346bd05b7397f0a18910d5d4999016db3d406914db4b9e19e5f85dfa5a52ac7f245 |
29 |
|
30 |
diff --git a/net-libs/nodejs/nodejs-6.9.2.ebuild b/net-libs/nodejs/nodejs-6.9.2.ebuild |
31 |
new file mode 100644 |
32 |
index 00000000..4e76890 |
33 |
--- /dev/null |
34 |
+++ b/net-libs/nodejs/nodejs-6.9.2.ebuild |
35 |
@@ -0,0 +1,193 @@ |
36 |
+# Copyright 1999-2016 Gentoo Foundation |
37 |
+# Distributed under the terms of the GNU General Public License v2 |
38 |
+# $Id$ |
39 |
+ |
40 |
+EAPI=6 |
41 |
+ |
42 |
+PYTHON_COMPAT=( python2_7 ) |
43 |
+PYTHON_REQ_USE="threads" |
44 |
+ |
45 |
+inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs |
46 |
+ |
47 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
48 |
+HOMEPAGE="https://nodejs.org/" |
49 |
+SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" |
50 |
+ |
51 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
52 |
+SLOT="0" |
53 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x64-macos" |
54 |
+IUSE="cpu_flags_x86_sse2 debug doc icu +npm +snapshot +ssl test" |
55 |
+ |
56 |
+RDEPEND="icu? ( >=dev-libs/icu-56:= ) |
57 |
+ npm? ( ${PYTHON_DEPS} ) |
58 |
+ >=net-libs/http-parser-2.6.2:= |
59 |
+ >=dev-libs/libuv-1.9.0:= |
60 |
+ >=dev-libs/openssl-1.0.2g:0=[-bindist] |
61 |
+ sys-libs/zlib" |
62 |
+DEPEND="${RDEPEND} |
63 |
+ ${PYTHON_DEPS} |
64 |
+ test? ( net-misc/curl )" |
65 |
+ |
66 |
+S="${WORKDIR}/node-v${PV}" |
67 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
68 |
+ |
69 |
+PATCHES=( |
70 |
+ "${FILESDIR}"/gentoo-global-npm-config.patch |
71 |
+) |
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 |
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 writing a depfile, not useful |
104 |
+ sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die |
105 |
+ |
106 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
107 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
108 |
+ # The issue is that no stdin handle is openened when asked for one. |
109 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
110 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
111 |
+ rm test/parallel/test-stdout-close-unref.js || die |
112 |
+ |
113 |
+ # debug builds. change install path, remove optimisations and override buildtype |
114 |
+ if use debug; then |
115 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
116 |
+ BUILDTYPE=Debug |
117 |
+ fi |
118 |
+ |
119 |
+ default |
120 |
+} |
121 |
+ |
122 |
+src_configure() { |
123 |
+ local myarch="" |
124 |
+ local myconf=( --shared-openssl --shared-libuv --shared-http-parser --shared-zlib ) |
125 |
+ use npm || myconf+=( --without-npm ) |
126 |
+ use icu && myconf+=( --with-intl=system-icu ) |
127 |
+ use snapshot && myconf+=( --with-snapshot ) |
128 |
+ use ssl || myconf+=( --without-ssl ) |
129 |
+ use debug && myconf+=( --debug ) |
130 |
+ |
131 |
+ case ${ABI} in |
132 |
+ amd64) myarch="x64";; |
133 |
+ arm) myarch="arm";; |
134 |
+ arm64) myarch="arm64";; |
135 |
+ ppc64) myarch="ppc64";; |
136 |
+ x32) myarch="x32";; |
137 |
+ x86) myarch="ia32";; |
138 |
+ *) myarch="${ABI}";; |
139 |
+ esac |
140 |
+ |
141 |
+ GYP_DEFINES="linux_use_gold_flags=0 |
142 |
+ linux_use_bundled_binutils=0 |
143 |
+ linux_use_bundled_gold=0" \ |
144 |
+ "${PYTHON}" configure \ |
145 |
+ --prefix="${EPREFIX}"/usr \ |
146 |
+ --dest-cpu=${myarch} \ |
147 |
+ --without-dtrace \ |
148 |
+ "${myconf[@]}" || die |
149 |
+} |
150 |
+ |
151 |
+src_compile() { |
152 |
+ emake -C out mksnapshot |
153 |
+ pax-mark m "out/${BUILDTYPE}/mksnapshot" |
154 |
+ emake -C out |
155 |
+} |
156 |
+ |
157 |
+src_install() { |
158 |
+ local LIBDIR="${ED}/usr/$(get_libdir)" |
159 |
+ emake install DESTDIR="${D}" |
160 |
+ pax-mark -m "${ED}"usr/bin/node |
161 |
+ |
162 |
+ # set up a symlink structure that node-gyp 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 |
+ if use doc; then |
170 |
+ # Patch docs to make them offline readable |
171 |
+ for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do |
172 |
+ sed -i '/fonts.googleapis.com/ d' $i; |
173 |
+ done |
174 |
+ # Install docs! |
175 |
+ dohtml -r "${S}"/doc/* |
176 |
+ fi |
177 |
+ |
178 |
+ if use npm; then |
179 |
+ dodir /etc/npm |
180 |
+ |
181 |
+ # Install bash completion for `npm` |
182 |
+ # We need to temporarily replace default config path since |
183 |
+ # npm otherwise tries to write outside of the sandbox |
184 |
+ local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" |
185 |
+ sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die |
186 |
+ local tmp_npm_completion_file="$(emktemp)" |
187 |
+ "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" |
188 |
+ newbashcomp "${tmp_npm_completion_file}" npm |
189 |
+ sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die |
190 |
+ |
191 |
+ # Move man pages |
192 |
+ doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* |
193 |
+ |
194 |
+ # Clean up |
195 |
+ rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die |
196 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die |
197 |
+ |
198 |
+ local find_exp="-or -name" |
199 |
+ local find_name=() |
200 |
+ for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ |
201 |
+ ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ |
202 |
+ "*.md" "*.markdown" "*.bat" "*.cmd"; do |
203 |
+ find_name+=( ${find_exp} "${match}" ) |
204 |
+ done |
205 |
+ |
206 |
+ # Remove various development and/or inappropriate files and |
207 |
+ # useless docs of dependend packages. |
208 |
+ find "${LIBDIR}"/node_modules \ |
209 |
+ \( -type d -name examples \) -or \( -type f \( \ |
210 |
+ -iname "LICEN?E*" \ |
211 |
+ "${find_name[@]}" \ |
212 |
+ \) \) -exec rm -rf "{}" \; |
213 |
+ fi |
214 |
+} |
215 |
+ |
216 |
+src_test() { |
217 |
+ out/${BUILDTYPE}/cctest || die |
218 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
219 |
+} |
220 |
+ |
221 |
+pkg_postinst() { |
222 |
+ einfo "The global npm config lives in /etc/npm. This deviates slightly" |
223 |
+ einfo "from upstream which otherwise would have it live in /usr/etc/." |
224 |
+ einfo "" |
225 |
+ einfo "Protip: When using node-gyp to install native modules, you can" |
226 |
+ einfo "avoid having to download extras by doing the following:" |
227 |
+ einfo "$ node-gyp --nodedir /usr/include/node <command>" |
228 |
+} |
229 |
|
230 |
diff --git a/net-libs/nodejs/nodejs-7.3.0.ebuild b/net-libs/nodejs/nodejs-7.3.0.ebuild |
231 |
new file mode 100644 |
232 |
index 00000000..7567d33 |
233 |
--- /dev/null |
234 |
+++ b/net-libs/nodejs/nodejs-7.3.0.ebuild |
235 |
@@ -0,0 +1,194 @@ |
236 |
+# Copyright 1999-2016 Gentoo Foundation |
237 |
+# Distributed under the terms of the GNU General Public License v2 |
238 |
+# $Id$ |
239 |
+ |
240 |
+EAPI=6 |
241 |
+ |
242 |
+PYTHON_COMPAT=( python2_7 ) |
243 |
+PYTHON_REQ_USE="threads" |
244 |
+ |
245 |
+inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs |
246 |
+ |
247 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
248 |
+HOMEPAGE="https://nodejs.org/" |
249 |
+SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" |
250 |
+ |
251 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
252 |
+SLOT="0" |
253 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x64-macos" |
254 |
+IUSE="cpu_flags_x86_sse2 debug doc icu +npm +snapshot +ssl systemtap test" |
255 |
+ |
256 |
+RDEPEND="icu? ( >=dev-libs/icu-56:= ) |
257 |
+ npm? ( ${PYTHON_DEPS} ) |
258 |
+ >=net-libs/http-parser-2.6.2:= |
259 |
+ >=dev-libs/libuv-1.9.0:= |
260 |
+ >=dev-libs/openssl-1.0.2g:0=[-bindist] |
261 |
+ sys-libs/zlib" |
262 |
+DEPEND="${RDEPEND} |
263 |
+ ${PYTHON_DEPS} |
264 |
+ systemtap? ( dev-util/systemtap ) |
265 |
+ test? ( net-misc/curl )" |
266 |
+ |
267 |
+S="${WORKDIR}/node-v${PV}" |
268 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
269 |
+ |
270 |
+PATCHES=( |
271 |
+ "${FILESDIR}"/gentoo-global-npm-config.patch |
272 |
+) |
273 |
+ |
274 |
+pkg_pretend() { |
275 |
+ (use x86 && ! use cpu_flags_x86_sse2) && \ |
276 |
+ die "Your CPU doesn't support the required SSE2 instruction." |
277 |
+ |
278 |
+ ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ |
279 |
+ die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." |
280 |
+} |
281 |
+ |
282 |
+src_prepare() { |
283 |
+ tc-export CC CXX PKG_CONFIG |
284 |
+ export V=1 |
285 |
+ export BUILDTYPE=Release |
286 |
+ |
287 |
+ # fix compilation on Darwin |
288 |
+ # https://code.google.com/p/gyp/issues/detail?id=260 |
289 |
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die |
290 |
+ |
291 |
+ # make sure we use python2.* while using gyp |
292 |
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die |
293 |
+ sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die |
294 |
+ |
295 |
+ # less verbose install output (stating the same as portage, basically) |
296 |
+ sed -i -e "/print/d" tools/install.py || die |
297 |
+ |
298 |
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 |
299 |
+ local LIBDIR=$(get_libdir) |
300 |
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die |
301 |
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die |
302 |
+ sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die |
303 |
+ |
304 |
+ # Avoid writing a depfile, not useful |
305 |
+ sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die |
306 |
+ |
307 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
308 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
309 |
+ # The issue is that no stdin handle is openened when asked for one. |
310 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
311 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
312 |
+ rm test/parallel/test-stdout-close-unref.js || die |
313 |
+ |
314 |
+ # debug builds. change install path, remove optimisations and override buildtype |
315 |
+ if use debug; then |
316 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
317 |
+ BUILDTYPE=Debug |
318 |
+ fi |
319 |
+ |
320 |
+ default |
321 |
+} |
322 |
+ |
323 |
+src_configure() { |
324 |
+ local myarch="" |
325 |
+ local myconf=( --shared-openssl --shared-libuv --shared-http-parser --shared-zlib ) |
326 |
+ use npm || myconf+=( --without-npm ) |
327 |
+ use icu && myconf+=( --with-intl=system-icu ) |
328 |
+ use snapshot && myconf+=( --with-snapshot ) |
329 |
+ use ssl || myconf+=( --without-ssl ) |
330 |
+ use debug && myconf+=( --debug ) |
331 |
+ |
332 |
+ case ${ABI} in |
333 |
+ amd64) myarch="x64";; |
334 |
+ arm) myarch="arm";; |
335 |
+ arm64) myarch="arm64";; |
336 |
+ ppc64) myarch="ppc64";; |
337 |
+ x32) myarch="x32";; |
338 |
+ x86) myarch="ia32";; |
339 |
+ *) myarch="${ABI}";; |
340 |
+ esac |
341 |
+ |
342 |
+ GYP_DEFINES="linux_use_gold_flags=0 |
343 |
+ linux_use_bundled_binutils=0 |
344 |
+ linux_use_bundled_gold=0" \ |
345 |
+ "${PYTHON}" configure \ |
346 |
+ --prefix="${EPREFIX}"/usr \ |
347 |
+ --dest-cpu=${myarch} \ |
348 |
+ $(use_with systemtap dtrace) \ |
349 |
+ "${myconf[@]}" || die |
350 |
+} |
351 |
+ |
352 |
+src_compile() { |
353 |
+ emake -C out mksnapshot |
354 |
+ pax-mark m "out/${BUILDTYPE}/mksnapshot" |
355 |
+ emake -C out |
356 |
+} |
357 |
+ |
358 |
+src_install() { |
359 |
+ local LIBDIR="${ED}/usr/$(get_libdir)" |
360 |
+ emake install DESTDIR="${D}" |
361 |
+ pax-mark -m "${ED}"usr/bin/node |
362 |
+ |
363 |
+ # set up a symlink structure that node-gyp expects.. |
364 |
+ dodir /usr/include/node/deps/{v8,uv} |
365 |
+ dosym . /usr/include/node/src |
366 |
+ for var in deps/{uv,v8}/include; do |
367 |
+ dosym ../.. /usr/include/node/${var} |
368 |
+ done |
369 |
+ |
370 |
+ if use doc; then |
371 |
+ # Patch docs to make them offline readable |
372 |
+ for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do |
373 |
+ sed -i '/fonts.googleapis.com/ d' $i; |
374 |
+ done |
375 |
+ # Install docs! |
376 |
+ dohtml -r "${S}"/doc/* |
377 |
+ fi |
378 |
+ |
379 |
+ if use npm; then |
380 |
+ dodir /etc/npm |
381 |
+ |
382 |
+ # Install bash completion for `npm` |
383 |
+ # We need to temporarily replace default config path since |
384 |
+ # npm otherwise tries to write outside of the sandbox |
385 |
+ local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" |
386 |
+ sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die |
387 |
+ local tmp_npm_completion_file="$(emktemp)" |
388 |
+ "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" |
389 |
+ newbashcomp "${tmp_npm_completion_file}" npm |
390 |
+ sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die |
391 |
+ |
392 |
+ # Move man pages |
393 |
+ doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* |
394 |
+ |
395 |
+ # Clean up |
396 |
+ rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die |
397 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die |
398 |
+ |
399 |
+ local find_exp="-or -name" |
400 |
+ local find_name=() |
401 |
+ for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ |
402 |
+ ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ |
403 |
+ "*.md" "*.markdown" "*.bat" "*.cmd"; do |
404 |
+ find_name+=( ${find_exp} "${match}" ) |
405 |
+ done |
406 |
+ |
407 |
+ # Remove various development and/or inappropriate files and |
408 |
+ # useless docs of dependend packages. |
409 |
+ find "${LIBDIR}"/node_modules \ |
410 |
+ \( -type d -name examples \) -or \( -type f \( \ |
411 |
+ -iname "LICEN?E*" \ |
412 |
+ "${find_name[@]}" \ |
413 |
+ \) \) -exec rm -rf "{}" \; |
414 |
+ fi |
415 |
+} |
416 |
+ |
417 |
+src_test() { |
418 |
+ out/${BUILDTYPE}/cctest || die |
419 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
420 |
+} |
421 |
+ |
422 |
+pkg_postinst() { |
423 |
+ einfo "The global npm config lives in /etc/npm. This deviates slightly" |
424 |
+ einfo "from upstream which otherwise would have it live in /usr/etc/." |
425 |
+ einfo "" |
426 |
+ einfo "Protip: When using node-gyp to install native modules, you can" |
427 |
+ einfo "avoid having to download extras by doing the following:" |
428 |
+ einfo "$ node-gyp --nodedir /usr/include/node <command>" |
429 |
+} |