1 |
commit: 1da2c485238475b5ceb0def977dbe53025246069 |
2 |
Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Feb 28 18:46:43 2019 +0000 |
4 |
Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Feb 28 18:49:28 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1da2c485 |
7 |
|
8 |
net-libs/nodejs: Versions 6.17.0 8.15.1 10.15.2 11.10.1 |
9 |
|
10 |
Package-Manager: Portage-2.3.62, Repoman-2.3.12 |
11 |
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org> |
12 |
|
13 |
net-libs/nodejs/Manifest | 4 + |
14 |
net-libs/nodejs/nodejs-10.15.2.ebuild | 205 +++++++++++++++++++++++++++++++++ |
15 |
net-libs/nodejs/nodejs-11.10.1.ebuild | 210 ++++++++++++++++++++++++++++++++++ |
16 |
net-libs/nodejs/nodejs-6.17.0.ebuild | 200 ++++++++++++++++++++++++++++++++ |
17 |
net-libs/nodejs/nodejs-8.15.1.ebuild | 207 +++++++++++++++++++++++++++++++++ |
18 |
5 files changed, 826 insertions(+) |
19 |
|
20 |
diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest |
21 |
index 0f8572c283d..ac946708514 100644 |
22 |
--- a/net-libs/nodejs/Manifest |
23 |
+++ b/net-libs/nodejs/Manifest |
24 |
@@ -1,12 +1,16 @@ |
25 |
DIST node-v0.12.18.tar.gz 19842591 BLAKE2B f94f4de6e2875267be194580c645087a262b90da99f10d651a22838c041da07056df81204bb04ce8da083a080062509dcca4d1e3ac2250d651ead8a4cc025028 SHA512 6866608a43eb213f3b715ea0fcc28983fd959ab679c567a1b464f62acd936506f2bce88ea48a60209d8ef8d98259f4b47cd3434893eb4ff82a132775edb37b7b |
26 |
DIST node-v10.15.0.tar.xz 20217588 BLAKE2B ef7f626bd3b13b11a1cbf21f5c6a2ce08567dddc2fb525c5f10e02f81750a648245c2eb88535d8aac1b055a13d12f9ead72d55c4ccf68062940da09d582344c3 SHA512 6c10ae4070cd8b89d4d31ee2137453fa582cef85c6f002c78d5029ceedddf5caeee8e28a4e75dfc632c3af3c8e2acec403ab17a927ba51fa31175d58b45cbf49 |
27 |
DIST node-v10.15.1.tar.xz 20231024 BLAKE2B 82fec4cf3902cc3b8eba595c969e18ffd2fb468e58eec026308aef2c3dde3c9b96c96997b2710e224c77c373ac72e5cc8dd4e68d937914e014d3f457c7d6afa4 SHA512 823a4703b388275aa86e7ede5c626a918764d6e83bdd9a0cb249ec1f960f3a3020306078d8a4113311303e4c3380d4090c928041ef64189a3cdf67153c7cac95 |
28 |
+DIST node-v10.15.2.tar.xz 20232972 BLAKE2B 3ffaa0890ddec6b9d00a0b3f32fc62e55a665ea6faba6265df71be601f88a1c948011f908851f1cbb198974ca36f8626fa9a2b4b8827f0155e57ff48f3e25c10 SHA512 2d4ef4758d3a73a160b95249c7dce32307287ef84511f56c3077f18c0d87a53bb73b44dd86131a402c4e86686e5e7cb5aeedb2b075b8ab261fc43d5abbe70ce6 |
29 |
DIST node-v11.10.0.tar.xz 22073588 BLAKE2B d2a58655c7a9a5b5f78abeaeee80747df83408c1ef325aca06b5636fda5a7cde7eb787f70960abfa1bfa9397a3a45d266d72e91359bb9035103e3ebbe88813a8 SHA512 f6701f235b2f95c4c1ba240d0540646cb6268ba795b385126abe915095e8620c90047c192215f8460e903711b0851680faa19d7ea39213d5396f4d56f728500d |
30 |
+DIST node-v11.10.1.tar.xz 22074212 BLAKE2B de4c224063050901a3898bb9d2a26dba8027b3722528c402d461f2ca892a80e230e16131e9c8b22d6fefbd44b79a6d78aef631934c80ed53f8601fd2d3405150 SHA512 8da793946d18c8368f12e786bc4fdcff0ac61237c95f896a49895d6433edcd42005d50237095fd2b1c69b51d56900d122528783338dbb97e5fcee9dcc9a5812c |
31 |
DIST node-v11.7.0.tar.xz 21218124 BLAKE2B a7e69dc8d6ee2f42ea78ec9c4d623b56bfbc2e130fc6b7d33038ce79f03d7b92e78545fa26bb2dbd58c1c25677f0b224077822264fd9cec49e71f18517098563 SHA512 eec2d5e67d94314f1a09f3a1c3407d6b12e9decbdff99d41eb487c4ddc1929fc5661be0b6fbb180961ecb6094311630b19faa0af031d82ff8de7ae213ee35ab7 |
32 |
DIST node-v11.8.0.tar.xz 21253080 BLAKE2B 808df024b7dba628f03b7c6c2fe8c486bb036f02f80aa2184de0a8393afad17dcd19d98fd63f1ffc5f9c1dc4fb078f32d15217322d1608510f291eef456df35f SHA512 7c33984014c2b95bde59affee88bc77caa2788dbdd7db87150acd58c56304932bf4b030994c91fc655f0f32202b8d1ed370c3d19d09569af50ffce91414d62ac |
33 |
DIST node-v11.9.0.tar.xz 21703796 BLAKE2B 9097a93b749b7a3dee38507ae37ece985872391f86f75a7aefb7820c361e98e708e4629fe2c5c8d76de9e9fac8c9b8d8811b490b63ce31ba57777abf47cc2fe3 SHA512 beb20a9042c990ae8978b5794db21d3461ed41b985ad6a5f163ea9563ed3277953926f83a81f49d7b7ae040bad95d7777ff758a03dd299a0de1014e008767da2 |
34 |
DIST node-v4.9.1.tar.xz 13250164 BLAKE2B 7a689b99bb4bf507f7f21dd2c096a5766d023a8174c0f468cab37365af1920b8700da04157e1a406917790524255ef32c243a74662fd50ef7d3567d189dac9cf SHA512 690c9fdf608e5194069a10955bdd94ec87cb1c308f13bc4d2cae92fa01436ace10fadf58f2e51d477dde6c570b23edc1c71fafea79bfc9cab2903eb2fa5f87aa |
35 |
DIST node-v6.14.4.tar.xz 15842824 BLAKE2B fc56364be64fe5824e2bb50d861ebf8f58f9895f2c9c108b8df3315b127ffb2755eac85c28165ac9779adab4611ce8f5ea1a5745f43ebaa1389e82b8215c6396 SHA512 1ead0c097ec125230dd631f19a5c3ec06a1371f9ca3b392b5ad08fcc227dd0142f33ad52f96890c2c17448a4951a635b9099dfff00d7d8b3ffb59b07904d1bfa |
36 |
DIST node-v6.16.0.tar.xz 15854256 BLAKE2B 0c70ce154639cbae12e0dfd6e7d5705999badb5872d71f388a3bb89f2830ddb096761aed47bdc6e310f2088fa79070d8a3427361206d74f686d86b27f929a4b4 SHA512 e9a222af328c8afb47b4b9c0f39ca5c1e45c5590b2064b3a8994b25f63acd041fba591d390e5a617db08d1212de15c438c66000ddcbc65cd071681311fa3591d |
37 |
+DIST node-v6.17.0.tar.xz 15853760 BLAKE2B f1872b2ed43c447beff2b3278e49f9f10bbef58bba2640f6ecd889facfa4c5e5ae142f3b30721faae615df42c0870d7c09147930a259fa81c161b29559e2a340 SHA512 8ae9bfa0336a7d0d9f4a372330de1f877354a3d68bdd6977285787f81999012e42faf4ccef5981fe565ea9e2f18c5490b857bab29359fdf906b5a9fb14628858 |
38 |
DIST node-v8.12.0.tar.xz 18310452 BLAKE2B 79634fc57cd76a97e72bab4be37da91d5eff4d13cdaa2b48e83f013885fa3590ba4a28378baf036ed26b7304bf234753d1d4014f72571496f5bb6cd5b221e5f0 SHA512 665d2dba287d78bcd723d7b4d00a6897fb996f4aa69a541e010a3dfeb2614257892117fcce7123966b1ecaddc9269a6667e0e262df693baea1f476c96de55c42 |
39 |
DIST node-v8.15.0.tar.xz 18499412 BLAKE2B bba68517358cea14e9ba7c0c14b3f30caa00e358ff79d0602a1a71c9dd80334800ea2fd12086c5bee47cc23b9debe2cb0e36650f6be02e20615047a971297c54 SHA512 9a3d54ee9e22919ab425532ea64336b1dee0ae3ce4afd4eaacc109a2c2d34c98ea8188acd436c55a5dbba30fb4f95f8fcc9000ea60a81224d09b90d2f493cefd |
40 |
+DIST node-v8.15.1.tar.xz 18501532 BLAKE2B e6da98902d665997b2e85472424e00f817353dcfc118b1d309f1305099b145eb0eae33429554ab5d563366182b34b24ac78f8b78794f8d21318ebcd137622131 SHA512 23fb4e2580116a69a58514c2dc1f42098c7d594ea9d0cd6e7090f37e12e1805ca6546df66ee68fcb61b803e287ce34422f55129412f6bdcdaa97f515d9581e19 |
41 |
|
42 |
diff --git a/net-libs/nodejs/nodejs-10.15.2.ebuild b/net-libs/nodejs/nodejs-10.15.2.ebuild |
43 |
new file mode 100644 |
44 |
index 00000000000..959fdfa0bf2 |
45 |
--- /dev/null |
46 |
+++ b/net-libs/nodejs/nodejs-10.15.2.ebuild |
47 |
@@ -0,0 +1,205 @@ |
48 |
+# Copyright 1999-2019 Gentoo Authors |
49 |
+# Distributed under the terms of the GNU General Public License v2 |
50 |
+ |
51 |
+EAPI=6 |
52 |
+ |
53 |
+PYTHON_COMPAT=( python2_7 ) |
54 |
+PYTHON_REQ_USE="threads" |
55 |
+ |
56 |
+inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs |
57 |
+ |
58 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
59 |
+HOMEPAGE="https://nodejs.org/" |
60 |
+SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" |
61 |
+ |
62 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
63 |
+SLOT="0" |
64 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos" |
65 |
+IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test" |
66 |
+REQUIRED_USE=" |
67 |
+ ${PYTHON_REQUIRED_USE} |
68 |
+ inspector? ( icu ssl ) |
69 |
+ npm? ( ssl ) |
70 |
+" |
71 |
+ |
72 |
+RDEPEND=" |
73 |
+ >=dev-libs/libuv-1.23.2:= |
74 |
+ >=net-dns/c-ares-1.15.0 |
75 |
+ >=net-libs/http-parser-2.9.0:= |
76 |
+ >=net-libs/nghttp2-1.34.0 |
77 |
+ sys-libs/zlib |
78 |
+ icu? ( >=dev-libs/icu-62.1:= ) |
79 |
+ ssl? ( =dev-libs/openssl-1.1.0*:0= ) |
80 |
+" |
81 |
+DEPEND=" |
82 |
+ ${RDEPEND} |
83 |
+ ${PYTHON_DEPS} |
84 |
+ systemtap? ( dev-util/systemtap ) |
85 |
+ test? ( net-misc/curl ) |
86 |
+" |
87 |
+PATCHES=( |
88 |
+ "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch |
89 |
+) |
90 |
+S="${WORKDIR}/node-v${PV}" |
91 |
+ |
92 |
+pkg_pretend() { |
93 |
+ (use x86 && ! use cpu_flags_x86_sse2) && \ |
94 |
+ die "Your CPU doesn't support the required SSE2 instruction." |
95 |
+ |
96 |
+ ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ |
97 |
+ die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." |
98 |
+} |
99 |
+ |
100 |
+src_prepare() { |
101 |
+ tc-export CC CXX PKG_CONFIG |
102 |
+ export V=1 |
103 |
+ export BUILDTYPE=Release |
104 |
+ |
105 |
+ # fix compilation on Darwin |
106 |
+ # https://code.google.com/p/gyp/issues/detail?id=260 |
107 |
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die |
108 |
+ |
109 |
+ # make sure we use python2.* while using gyp |
110 |
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die |
111 |
+ sed -i -e "s/|| 'python2'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die |
112 |
+ |
113 |
+ # less verbose install output (stating the same as portage, basically) |
114 |
+ sed -i -e "/print/d" tools/install.py || die |
115 |
+ |
116 |
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 |
117 |
+ local LIBDIR=$(get_libdir) |
118 |
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die |
119 |
+ sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die |
120 |
+ |
121 |
+ # Avoid writing a depfile, not useful |
122 |
+ sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die |
123 |
+ |
124 |
+ sed -i -e "/'-O3'/d" common.gypi deps/v8/gypfiles/toolchain.gypi || die |
125 |
+ |
126 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
127 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
128 |
+ # The issue is that no stdin handle is openened when asked for one. |
129 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
130 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
131 |
+ rm test/parallel/test-stdout-close-unref.js || die |
132 |
+ |
133 |
+ # debug builds. change install path, remove optimisations and override buildtype |
134 |
+ if use debug; then |
135 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
136 |
+ BUILDTYPE=Debug |
137 |
+ fi |
138 |
+ |
139 |
+ default |
140 |
+} |
141 |
+ |
142 |
+src_configure() { |
143 |
+ local myconf=( --shared-cares --shared-http-parser --shared-libuv --shared-nghttp2 --shared-zlib ) |
144 |
+ use debug && myconf+=( --debug ) |
145 |
+ use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none ) |
146 |
+ use inspector || myconf+=( --without-inspector ) |
147 |
+ use npm || myconf+=( --without-npm ) |
148 |
+ use snapshot && myconf+=( --with-snapshot ) |
149 |
+ use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl ) |
150 |
+ |
151 |
+ local myarch="" |
152 |
+ case ${ABI} in |
153 |
+ amd64) myarch="x64";; |
154 |
+ arm) myarch="arm";; |
155 |
+ arm64) myarch="arm64";; |
156 |
+ ppc64) myarch="ppc64";; |
157 |
+ x32) myarch="x32";; |
158 |
+ x86) myarch="ia32";; |
159 |
+ *) myarch="${ABI}";; |
160 |
+ esac |
161 |
+ |
162 |
+ GYP_DEFINES="linux_use_gold_flags=0 |
163 |
+ linux_use_bundled_binutils=0 |
164 |
+ linux_use_bundled_gold=0" \ |
165 |
+ "${PYTHON}" configure \ |
166 |
+ --prefix="${EPREFIX}"/usr \ |
167 |
+ --dest-cpu=${myarch} \ |
168 |
+ $(use_with systemtap dtrace) \ |
169 |
+ "${myconf[@]}" || die |
170 |
+} |
171 |
+ |
172 |
+src_compile() { |
173 |
+ emake -C out mksnapshot |
174 |
+ pax-mark m "out/${BUILDTYPE}/mksnapshot" |
175 |
+ emake -C out |
176 |
+} |
177 |
+ |
178 |
+src_install() { |
179 |
+ local LIBDIR="${ED}/usr/$(get_libdir)" |
180 |
+ emake install DESTDIR="${D}" |
181 |
+ pax-mark -m "${ED}"usr/bin/node |
182 |
+ |
183 |
+ # set up a symlink structure that node-gyp expects.. |
184 |
+ dodir /usr/include/node/deps/{v8,uv} |
185 |
+ dosym . /usr/include/node/src |
186 |
+ for var in deps/{uv,v8}/include; do |
187 |
+ dosym ../.. /usr/include/node/${var} |
188 |
+ done |
189 |
+ |
190 |
+ if use doc; then |
191 |
+ # Patch docs to make them offline readable |
192 |
+ for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do |
193 |
+ sed -i '/fonts.googleapis.com/ d' $i; |
194 |
+ done |
195 |
+ # Install docs |
196 |
+ docinto html |
197 |
+ dodoc -r "${S}"/doc/* |
198 |
+ fi |
199 |
+ |
200 |
+ if use npm; then |
201 |
+ dodir /etc/npm |
202 |
+ |
203 |
+ # Install bash completion for `npm` |
204 |
+ # We need to temporarily replace default config path since |
205 |
+ # npm otherwise tries to write outside of the sandbox |
206 |
+ local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" |
207 |
+ sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die |
208 |
+ local tmp_npm_completion_file="$(emktemp)" |
209 |
+ "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" |
210 |
+ newbashcomp "${tmp_npm_completion_file}" npm |
211 |
+ sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die |
212 |
+ |
213 |
+ # Move man pages |
214 |
+ doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* |
215 |
+ |
216 |
+ # Clean up |
217 |
+ rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die |
218 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die |
219 |
+ |
220 |
+ local find_exp="-or -name" |
221 |
+ local find_name=() |
222 |
+ for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ |
223 |
+ ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ |
224 |
+ "*.md" "*.markdown" "*.bat" "*.cmd"; do |
225 |
+ find_name+=( ${find_exp} "${match}" ) |
226 |
+ done |
227 |
+ |
228 |
+ # Remove various development and/or inappropriate files and |
229 |
+ # useless docs of dependend packages. |
230 |
+ find "${LIBDIR}"/node_modules \ |
231 |
+ \( -type d -name examples \) -or \( -type f \( \ |
232 |
+ -iname "LICEN?E*" \ |
233 |
+ "${find_name[@]}" \ |
234 |
+ \) \) -exec rm -rf "{}" \; |
235 |
+ fi |
236 |
+ |
237 |
+ mv "${D}"/usr/share/doc/node "${D}"/usr/share/doc/${PF} || die |
238 |
+} |
239 |
+ |
240 |
+src_test() { |
241 |
+ out/${BUILDTYPE}/cctest || die |
242 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
243 |
+} |
244 |
+ |
245 |
+pkg_postinst() { |
246 |
+ einfo "The global npm config lives in /etc/npm. This deviates slightly" |
247 |
+ einfo "from upstream which otherwise would have it live in /usr/etc/." |
248 |
+ einfo "" |
249 |
+ einfo "Protip: When using node-gyp to install native modules, you can" |
250 |
+ einfo "avoid having to download extras by doing the following:" |
251 |
+ einfo "$ node-gyp --nodedir /usr/include/node <command>" |
252 |
+} |
253 |
|
254 |
diff --git a/net-libs/nodejs/nodejs-11.10.1.ebuild b/net-libs/nodejs/nodejs-11.10.1.ebuild |
255 |
new file mode 100644 |
256 |
index 00000000000..c4b2df6f8bd |
257 |
--- /dev/null |
258 |
+++ b/net-libs/nodejs/nodejs-11.10.1.ebuild |
259 |
@@ -0,0 +1,210 @@ |
260 |
+# Copyright 1999-2019 Gentoo Authors |
261 |
+# Distributed under the terms of the GNU General Public License v2 |
262 |
+ |
263 |
+EAPI=6 |
264 |
+ |
265 |
+PYTHON_COMPAT=( python2_7 ) |
266 |
+PYTHON_REQ_USE="threads" |
267 |
+ |
268 |
+inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs |
269 |
+ |
270 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
271 |
+HOMEPAGE="https://nodejs.org/" |
272 |
+SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" |
273 |
+ |
274 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
275 |
+SLOT="0" |
276 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos" |
277 |
+IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test" |
278 |
+REQUIRED_USE=" |
279 |
+ ${PYTHON_REQUIRED_USE} |
280 |
+ inspector? ( icu ssl ) |
281 |
+ npm? ( ssl ) |
282 |
+" |
283 |
+ |
284 |
+RDEPEND=" |
285 |
+ >=dev-libs/libuv-1.26.0:= |
286 |
+ >=net-dns/c-ares-1.15.0 |
287 |
+ >=net-libs/http-parser-2.9.0:= |
288 |
+ >=net-libs/nghttp2-1.34.0 |
289 |
+ sys-libs/zlib |
290 |
+ icu? ( >=dev-libs/icu-63.1:= ) |
291 |
+ ssl? ( =dev-libs/openssl-1.1.1*:0= ) |
292 |
+" |
293 |
+DEPEND=" |
294 |
+ ${RDEPEND} |
295 |
+ ${PYTHON_DEPS} |
296 |
+ systemtap? ( dev-util/systemtap ) |
297 |
+ test? ( net-misc/curl ) |
298 |
+" |
299 |
+PATCHES=( |
300 |
+ "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch |
301 |
+ "${FILESDIR}"/${PN}-11.4.0-stdarg_h.patch |
302 |
+ "${FILESDIR}"/${PN}-99999999-llhttp.patch |
303 |
+) |
304 |
+S="${WORKDIR}/node-v${PV}" |
305 |
+ |
306 |
+pkg_pretend() { |
307 |
+ (use x86 && ! use cpu_flags_x86_sse2) && \ |
308 |
+ die "Your CPU doesn't support the required SSE2 instruction." |
309 |
+ |
310 |
+ ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ |
311 |
+ die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." |
312 |
+} |
313 |
+ |
314 |
+src_prepare() { |
315 |
+ tc-export CC CXX PKG_CONFIG |
316 |
+ export V=1 |
317 |
+ export BUILDTYPE=Release |
318 |
+ |
319 |
+ # fix compilation on Darwin |
320 |
+ # https://code.google.com/p/gyp/issues/detail?id=260 |
321 |
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die |
322 |
+ |
323 |
+ # make sure we use python2.* while using gyp |
324 |
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die |
325 |
+ sed -i -e "s/|| 'python2'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die |
326 |
+ |
327 |
+ # less verbose install output (stating the same as portage, basically) |
328 |
+ sed -i -e "/print/d" tools/install.py || die |
329 |
+ |
330 |
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 |
331 |
+ local LIBDIR=$(get_libdir) |
332 |
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die |
333 |
+ sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die |
334 |
+ |
335 |
+ # Avoid writing a depfile, not useful |
336 |
+ sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die |
337 |
+ |
338 |
+ sed -i -e "/'-O3'/d" common.gypi deps/v8/gypfiles/toolchain.gypi || die |
339 |
+ |
340 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
341 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
342 |
+ # The issue is that no stdin handle is openened when asked for one. |
343 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
344 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
345 |
+ rm test/parallel/test-stdout-close-unref.js || die |
346 |
+ |
347 |
+ # debug builds. change install path, remove optimisations and override buildtype |
348 |
+ if use debug; then |
349 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
350 |
+ BUILDTYPE=Debug |
351 |
+ fi |
352 |
+ |
353 |
+ default |
354 |
+} |
355 |
+ |
356 |
+src_configure() { |
357 |
+ local myconf=( |
358 |
+ --shared-cares --shared-http-parser --shared-libuv --shared-nghttp2 |
359 |
+ --shared-zlib |
360 |
+ ) |
361 |
+ use debug && myconf+=( --debug ) |
362 |
+ use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none ) |
363 |
+ use inspector || myconf+=( --without-inspector ) |
364 |
+ use npm || myconf+=( --without-npm ) |
365 |
+ use snapshot && myconf+=( --with-snapshot ) |
366 |
+ use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl ) |
367 |
+ |
368 |
+ local myarch="" |
369 |
+ case ${ABI} in |
370 |
+ amd64) myarch="x64";; |
371 |
+ arm) myarch="arm";; |
372 |
+ arm64) myarch="arm64";; |
373 |
+ ppc64) myarch="ppc64";; |
374 |
+ x32) myarch="x32";; |
375 |
+ x86) myarch="ia32";; |
376 |
+ *) myarch="${ABI}";; |
377 |
+ esac |
378 |
+ |
379 |
+ GYP_DEFINES="linux_use_gold_flags=0 |
380 |
+ linux_use_bundled_binutils=0 |
381 |
+ linux_use_bundled_gold=0" \ |
382 |
+ "${PYTHON}" configure \ |
383 |
+ --prefix="${EPREFIX}"/usr \ |
384 |
+ --dest-cpu=${myarch} \ |
385 |
+ $(use_with systemtap dtrace) \ |
386 |
+ "${myconf[@]}" || die |
387 |
+} |
388 |
+ |
389 |
+src_compile() { |
390 |
+ emake -C out mksnapshot |
391 |
+ pax-mark m "out/${BUILDTYPE}/mksnapshot" |
392 |
+ emake -C out |
393 |
+} |
394 |
+ |
395 |
+src_install() { |
396 |
+ local LIBDIR="${ED}/usr/$(get_libdir)" |
397 |
+ emake install DESTDIR="${D}" |
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 |
+ # Patch docs to make them offline readable |
409 |
+ for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do |
410 |
+ sed -i '/fonts.googleapis.com/ d' $i; |
411 |
+ done |
412 |
+ # Install docs |
413 |
+ docinto html |
414 |
+ dodoc -r "${S}"/doc/* |
415 |
+ fi |
416 |
+ |
417 |
+ if use npm; then |
418 |
+ dodir /etc/npm |
419 |
+ |
420 |
+ # Install bash completion for `npm` |
421 |
+ # We need to temporarily replace default config path since |
422 |
+ # npm otherwise tries to write outside of the sandbox |
423 |
+ local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" |
424 |
+ sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die |
425 |
+ local tmp_npm_completion_file="$(emktemp)" |
426 |
+ "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" |
427 |
+ newbashcomp "${tmp_npm_completion_file}" npm |
428 |
+ sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die |
429 |
+ |
430 |
+ # Move man pages |
431 |
+ doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* |
432 |
+ |
433 |
+ # Clean up |
434 |
+ rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die |
435 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die |
436 |
+ |
437 |
+ local find_exp="-or -name" |
438 |
+ local find_name=() |
439 |
+ for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ |
440 |
+ ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ |
441 |
+ "*.md" "*.markdown" "*.bat" "*.cmd"; do |
442 |
+ find_name+=( ${find_exp} "${match}" ) |
443 |
+ done |
444 |
+ |
445 |
+ # Remove various development and/or inappropriate files and |
446 |
+ # useless docs of dependend packages. |
447 |
+ find "${LIBDIR}"/node_modules \ |
448 |
+ \( -type d -name examples \) -or \( -type f \( \ |
449 |
+ -iname "LICEN?E*" \ |
450 |
+ "${find_name[@]}" \ |
451 |
+ \) \) -exec rm -rf "{}" \; |
452 |
+ fi |
453 |
+ |
454 |
+ mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die |
455 |
+} |
456 |
+ |
457 |
+src_test() { |
458 |
+ out/${BUILDTYPE}/cctest || die |
459 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
460 |
+} |
461 |
+ |
462 |
+pkg_postinst() { |
463 |
+ elog "The global npm config lives in /etc/npm. This deviates slightly" |
464 |
+ elog "from upstream which otherwise would have it live in /usr/etc/." |
465 |
+ elog "" |
466 |
+ elog "Protip: When using node-gyp to install native modules, you can" |
467 |
+ elog "avoid having to download extras by doing the following:" |
468 |
+ elog "$ node-gyp --nodedir /usr/include/node <command>" |
469 |
+} |
470 |
|
471 |
diff --git a/net-libs/nodejs/nodejs-6.17.0.ebuild b/net-libs/nodejs/nodejs-6.17.0.ebuild |
472 |
new file mode 100644 |
473 |
index 00000000000..8db127221fd |
474 |
--- /dev/null |
475 |
+++ b/net-libs/nodejs/nodejs-6.17.0.ebuild |
476 |
@@ -0,0 +1,200 @@ |
477 |
+# Copyright 1999-2019 Gentoo Authors |
478 |
+# Distributed under the terms of the GNU General Public License v2 |
479 |
+ |
480 |
+EAPI=6 |
481 |
+ |
482 |
+PYTHON_COMPAT=( python2_7 ) |
483 |
+PYTHON_REQ_USE="threads" |
484 |
+ |
485 |
+inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs |
486 |
+ |
487 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
488 |
+HOMEPAGE="https://nodejs.org/" |
489 |
+SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" |
490 |
+ |
491 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
492 |
+SLOT="0" |
493 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" |
494 |
+IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl test" |
495 |
+REQUIRED_USE=" |
496 |
+ ${PYTHON_REQUIRED_USE} |
497 |
+ inspector? ( icu ssl ) |
498 |
+" |
499 |
+ |
500 |
+RDEPEND=" |
501 |
+ >=dev-libs/libuv-1.16.1:= |
502 |
+ >=net-libs/http-parser-2.9.0:= |
503 |
+ sys-libs/zlib |
504 |
+ icu? ( >=dev-libs/icu-58.2:= ) |
505 |
+ ssl? ( >=dev-libs/openssl-1.0.2n:0=[-bindist] ) |
506 |
+" |
507 |
+DEPEND=" |
508 |
+ ${RDEPEND} |
509 |
+ ${PYTHON_DEPS} |
510 |
+ test? ( net-misc/curl ) |
511 |
+" |
512 |
+PATCHES=( |
513 |
+ "${FILESDIR}"/gentoo-global-npm-config.patch |
514 |
+) |
515 |
+S="${WORKDIR}/node-v${PV}" |
516 |
+ |
517 |
+pkg_pretend() { |
518 |
+ (use x86 && ! use cpu_flags_x86_sse2) && \ |
519 |
+ die "Your CPU doesn't support the required SSE2 instruction." |
520 |
+ |
521 |
+ ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ |
522 |
+ die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." |
523 |
+} |
524 |
+ |
525 |
+src_prepare() { |
526 |
+ tc-export CC CXX PKG_CONFIG |
527 |
+ export V=1 |
528 |
+ export BUILDTYPE=Release |
529 |
+ |
530 |
+ # fix compilation on Darwin |
531 |
+ # https://code.google.com/p/gyp/issues/detail?id=260 |
532 |
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die |
533 |
+ |
534 |
+ # make sure we use python2.* while using gyp |
535 |
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die |
536 |
+ sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die |
537 |
+ |
538 |
+ # less verbose install output (stating the same as portage, basically) |
539 |
+ sed -i -e "/print/d" tools/install.py || die |
540 |
+ |
541 |
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 |
542 |
+ local LIBDIR=$(get_libdir) |
543 |
+ sed -i \ |
544 |
+ -e "s|lib/|${LIBDIR}/|g" \ |
545 |
+ -e 's|share/doc/node/|share/doc/'"${PF}"'/|g' \ |
546 |
+ tools/install.py || die |
547 |
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die |
548 |
+ sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die |
549 |
+ |
550 |
+ # Avoid writing a depfile, not useful |
551 |
+ sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die |
552 |
+ |
553 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
554 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
555 |
+ # The issue is that no stdin handle is openened when asked for one. |
556 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
557 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
558 |
+ rm test/parallel/test-stdout-close-unref.js || die |
559 |
+ |
560 |
+ # debug builds. change install path, remove optimisations and override buildtype |
561 |
+ if use debug; then |
562 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
563 |
+ BUILDTYPE=Debug |
564 |
+ fi |
565 |
+ |
566 |
+ default |
567 |
+} |
568 |
+ |
569 |
+src_configure() { |
570 |
+ local myarch="" |
571 |
+ local myconf=( --shared-libuv --shared-http-parser --shared-zlib ) |
572 |
+ use debug && myconf+=( --debug ) |
573 |
+ use icu && myconf+=( --with-intl=system-icu ) |
574 |
+ use inspector || myconf+=( --without-inspector ) |
575 |
+ use npm || myconf+=( --without-npm ) |
576 |
+ use snapshot && myconf+=( --with-snapshot ) |
577 |
+ use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl ) |
578 |
+ |
579 |
+ case ${ABI} in |
580 |
+ amd64) myarch="x64";; |
581 |
+ arm) myarch="arm";; |
582 |
+ arm64) myarch="arm64";; |
583 |
+ ppc64) myarch="ppc64";; |
584 |
+ x32) myarch="x32";; |
585 |
+ x86) myarch="ia32";; |
586 |
+ *) myarch="${ABI}";; |
587 |
+ esac |
588 |
+ |
589 |
+ GYP_DEFINES="linux_use_gold_flags=0 |
590 |
+ linux_use_bundled_binutils=0 |
591 |
+ linux_use_bundled_gold=0" \ |
592 |
+ "${PYTHON}" configure \ |
593 |
+ --prefix="${EPREFIX}"/usr \ |
594 |
+ --dest-cpu=${myarch} \ |
595 |
+ --without-dtrace \ |
596 |
+ "${myconf[@]}" || die |
597 |
+} |
598 |
+ |
599 |
+src_compile() { |
600 |
+ emake -C out mksnapshot |
601 |
+ pax-mark m "out/${BUILDTYPE}/mksnapshot" |
602 |
+ emake -C out |
603 |
+} |
604 |
+ |
605 |
+src_install() { |
606 |
+ local LIBDIR="${ED}/usr/$(get_libdir)" |
607 |
+ emake install DESTDIR="${D}" |
608 |
+ pax-mark -m "${ED}"usr/bin/node |
609 |
+ |
610 |
+ # set up a symlink structure that node-gyp expects.. |
611 |
+ dodir /usr/include/node/deps/{v8,uv} |
612 |
+ dosym . /usr/include/node/src |
613 |
+ for var in deps/{uv,v8}/include; do |
614 |
+ dosym ../.. /usr/include/node/${var} |
615 |
+ done |
616 |
+ |
617 |
+ if use doc; then |
618 |
+ # Patch docs to make them offline readable |
619 |
+ for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do |
620 |
+ sed -i '/fonts.googleapis.com/ d' $i; |
621 |
+ done |
622 |
+ # Install docs! |
623 |
+ dohtml -r "${S}"/doc/* |
624 |
+ fi |
625 |
+ |
626 |
+ if use npm; then |
627 |
+ dodir /etc/npm |
628 |
+ |
629 |
+ # Install bash completion for `npm` |
630 |
+ # We need to temporarily replace default config path since |
631 |
+ # npm otherwise tries to write outside of the sandbox |
632 |
+ local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" |
633 |
+ sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die |
634 |
+ local tmp_npm_completion_file="$(emktemp)" |
635 |
+ "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" |
636 |
+ newbashcomp "${tmp_npm_completion_file}" npm |
637 |
+ sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die |
638 |
+ |
639 |
+ # Move man pages |
640 |
+ doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* |
641 |
+ |
642 |
+ # Clean up |
643 |
+ rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die |
644 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die |
645 |
+ |
646 |
+ local find_exp="-or -name" |
647 |
+ local find_name=() |
648 |
+ for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ |
649 |
+ ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ |
650 |
+ "*.md" "*.markdown" "*.bat" "*.cmd"; do |
651 |
+ find_name+=( ${find_exp} "${match}" ) |
652 |
+ done |
653 |
+ |
654 |
+ # Remove various development and/or inappropriate files and |
655 |
+ # useless docs of dependend packages. |
656 |
+ find "${LIBDIR}"/node_modules \ |
657 |
+ \( -type d -name examples \) -or \( -type f \( \ |
658 |
+ -iname "LICEN?E*" \ |
659 |
+ "${find_name[@]}" \ |
660 |
+ \) \) -exec rm -rf "{}" \; |
661 |
+ fi |
662 |
+} |
663 |
+ |
664 |
+src_test() { |
665 |
+ out/${BUILDTYPE}/cctest || die |
666 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
667 |
+} |
668 |
+ |
669 |
+pkg_postinst() { |
670 |
+ einfo "The global npm config lives in /etc/npm. This deviates slightly" |
671 |
+ einfo "from upstream which otherwise would have it live in /usr/etc/." |
672 |
+ einfo "" |
673 |
+ einfo "Protip: When using node-gyp to install native modules, you can" |
674 |
+ einfo "avoid having to download extras by doing the following:" |
675 |
+ einfo "$ node-gyp --nodedir /usr/include/node <command>" |
676 |
+} |
677 |
|
678 |
diff --git a/net-libs/nodejs/nodejs-8.15.1.ebuild b/net-libs/nodejs/nodejs-8.15.1.ebuild |
679 |
new file mode 100644 |
680 |
index 00000000000..059aa2d524e |
681 |
--- /dev/null |
682 |
+++ b/net-libs/nodejs/nodejs-8.15.1.ebuild |
683 |
@@ -0,0 +1,207 @@ |
684 |
+# Copyright 1999-2019 Gentoo Authors |
685 |
+# Distributed under the terms of the GNU General Public License v2 |
686 |
+ |
687 |
+EAPI=6 |
688 |
+RESTRICT="test" |
689 |
+ |
690 |
+PYTHON_COMPAT=( python2_7 ) |
691 |
+PYTHON_REQ_USE="threads" |
692 |
+ |
693 |
+inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs |
694 |
+ |
695 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
696 |
+HOMEPAGE="https://nodejs.org/" |
697 |
+SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" |
698 |
+ |
699 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
700 |
+SLOT="0" |
701 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos" |
702 |
+IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test" |
703 |
+REQUIRED_USE=" |
704 |
+ ${PYTHON_REQUIRED_USE} |
705 |
+ inspector? ( icu ssl ) |
706 |
+ npm? ( ssl ) |
707 |
+" |
708 |
+ |
709 |
+RDEPEND=" |
710 |
+ >=dev-libs/libuv-1.23.2:= |
711 |
+ >=net-dns/c-ares-1.10.1 |
712 |
+ >=net-libs/http-parser-2.9.0:= |
713 |
+ >=net-libs/nghttp2-1.33.0 |
714 |
+ sys-libs/zlib |
715 |
+ icu? ( >=dev-libs/icu-60.1:= ) |
716 |
+ ssl? ( =dev-libs/openssl-1.0.2*:0=[-bindist] ) |
717 |
+" |
718 |
+DEPEND=" |
719 |
+ ${RDEPEND} |
720 |
+ ${PYTHON_DEPS} |
721 |
+ systemtap? ( dev-util/systemtap ) |
722 |
+ test? ( net-misc/curl ) |
723 |
+" |
724 |
+PATCHES=( |
725 |
+ "${FILESDIR}"/nodejs-10.3.0-global-npm-config.patch |
726 |
+) |
727 |
+S="${WORKDIR}/node-v${PV}" |
728 |
+ |
729 |
+pkg_pretend() { |
730 |
+ (use x86 && ! use cpu_flags_x86_sse2) && \ |
731 |
+ die "Your CPU doesn't support the required SSE2 instruction." |
732 |
+ |
733 |
+ ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ |
734 |
+ die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." |
735 |
+} |
736 |
+ |
737 |
+src_prepare() { |
738 |
+ tc-export CC CXX PKG_CONFIG |
739 |
+ export V=1 |
740 |
+ export BUILDTYPE=Release |
741 |
+ |
742 |
+ # fix compilation on Darwin |
743 |
+ # https://code.google.com/p/gyp/issues/detail?id=260 |
744 |
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die |
745 |
+ |
746 |
+ # make sure we use python2.* while using gyp |
747 |
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die |
748 |
+ sed -i -e "s/|| 'python2'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die |
749 |
+ |
750 |
+ # less verbose install output (stating the same as portage, basically) |
751 |
+ sed -i -e "/print/d" tools/install.py || die |
752 |
+ |
753 |
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 |
754 |
+ local LIBDIR=$(get_libdir) |
755 |
+ sed -i \ |
756 |
+ -e "s|lib/|${LIBDIR}/|g" \ |
757 |
+ -e 's|share/doc/node/|share/doc/'"${PF}"'/|g' \ |
758 |
+ tools/install.py || die |
759 |
+ |
760 |
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js deps/npm/lib/npm.js || die |
761 |
+ |
762 |
+ # Avoid writing a depfile, not useful |
763 |
+ sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die |
764 |
+ |
765 |
+ sed -i -e "/'-O3'/d" common.gypi deps/v8/gypfiles/toolchain.gypi || die |
766 |
+ |
767 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
768 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
769 |
+ # The issue is that no stdin handle is openened when asked for one. |
770 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
771 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
772 |
+ rm test/parallel/test-stdout-close-unref.js || die |
773 |
+ |
774 |
+ # debug builds. change install path, remove optimisations and override buildtype |
775 |
+ if use debug; then |
776 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
777 |
+ BUILDTYPE=Debug |
778 |
+ fi |
779 |
+ |
780 |
+ default |
781 |
+} |
782 |
+ |
783 |
+src_configure() { |
784 |
+ local myconf=( --shared-cares --shared-http-parser --shared-libuv --shared-nghttp2 --shared-zlib ) |
785 |
+ use debug && myconf+=( --debug ) |
786 |
+ use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none ) |
787 |
+ use inspector || myconf+=( --without-inspector ) |
788 |
+ use npm || myconf+=( --without-npm ) |
789 |
+ use snapshot && myconf+=( --with-snapshot ) |
790 |
+ use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl ) |
791 |
+ |
792 |
+ local myarch="" |
793 |
+ case ${ABI} in |
794 |
+ amd64) myarch="x64";; |
795 |
+ arm) myarch="arm";; |
796 |
+ arm64) myarch="arm64";; |
797 |
+ ppc64) myarch="ppc64";; |
798 |
+ x32) myarch="x32";; |
799 |
+ x86) myarch="ia32";; |
800 |
+ *) myarch="${ABI}";; |
801 |
+ esac |
802 |
+ |
803 |
+ GYP_DEFINES="linux_use_gold_flags=0 |
804 |
+ linux_use_bundled_binutils=0 |
805 |
+ linux_use_bundled_gold=0" \ |
806 |
+ "${PYTHON}" configure \ |
807 |
+ --prefix="${EPREFIX}"/usr \ |
808 |
+ --dest-cpu=${myarch} \ |
809 |
+ $(use_with systemtap dtrace) \ |
810 |
+ "${myconf[@]}" || die |
811 |
+} |
812 |
+ |
813 |
+src_compile() { |
814 |
+ emake -C out mksnapshot |
815 |
+ pax-mark m "out/${BUILDTYPE}/mksnapshot" |
816 |
+ emake -C out |
817 |
+} |
818 |
+ |
819 |
+src_test() { |
820 |
+ out/${BUILDTYPE}/cctest || die |
821 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
822 |
+} |
823 |
+ |
824 |
+src_install() { |
825 |
+ local LIBDIR="${ED}/usr/$(get_libdir)" |
826 |
+ emake install DESTDIR="${D}" |
827 |
+ pax-mark -m "${ED}"usr/bin/node |
828 |
+ |
829 |
+ # set up a symlink structure that node-gyp expects.. |
830 |
+ dodir /usr/include/node/deps/{v8,uv} |
831 |
+ dosym . /usr/include/node/src |
832 |
+ for var in deps/{uv,v8}/include; do |
833 |
+ dosym ../.. /usr/include/node/${var} |
834 |
+ done |
835 |
+ |
836 |
+ if use doc; then |
837 |
+ # Patch docs to make them offline readable |
838 |
+ for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do |
839 |
+ sed -i '/fonts.googleapis.com/ d' $i; |
840 |
+ done |
841 |
+ # Install docs |
842 |
+ dodoc -r "${S}"/doc/* |
843 |
+ fi |
844 |
+ |
845 |
+ if use npm; then |
846 |
+ dodir /etc/npm |
847 |
+ |
848 |
+ # Install bash completion for `npm` |
849 |
+ # We need to temporarily replace default config path since |
850 |
+ # npm otherwise tries to write outside of the sandbox |
851 |
+ local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" |
852 |
+ sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die |
853 |
+ local tmp_npm_completion_file="$(emktemp)" |
854 |
+ "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" |
855 |
+ newbashcomp "${tmp_npm_completion_file}" npm |
856 |
+ sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die |
857 |
+ |
858 |
+ # Move man pages |
859 |
+ doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* |
860 |
+ |
861 |
+ # Clean up |
862 |
+ rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die |
863 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die |
864 |
+ |
865 |
+ local find_exp="-or -name" |
866 |
+ local find_name=() |
867 |
+ for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ |
868 |
+ ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ |
869 |
+ "*.md" "*.markdown" "*.bat" "*.cmd"; do |
870 |
+ find_name+=( ${find_exp} "${match}" ) |
871 |
+ done |
872 |
+ |
873 |
+ # Remove various development and/or inappropriate files and |
874 |
+ # useless docs of dependend packages. |
875 |
+ find "${LIBDIR}"/node_modules \ |
876 |
+ \( -type d -name examples \) -or \( -type f \( \ |
877 |
+ -iname "LICEN?E*" \ |
878 |
+ "${find_name[@]}" \ |
879 |
+ \) \) -exec rm -rf "{}" \; |
880 |
+ fi |
881 |
+} |
882 |
+ |
883 |
+pkg_postinst() { |
884 |
+ einfo "The global npm config lives in /etc/npm. This deviates slightly" |
885 |
+ einfo "from upstream which otherwise would have it live in /usr/etc/." |
886 |
+ einfo "" |
887 |
+ einfo "Protip: When using node-gyp to install native modules, you can" |
888 |
+ einfo "avoid having to download extras by doing the following:" |
889 |
+ einfo "$ node-gyp --nodedir /usr/include/node <command>" |
890 |
+} |