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