1 |
commit: f404e31c77e75199b8d88ef0177b852401e96b7f |
2 |
Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed May 30 05:27:53 2018 +0000 |
4 |
Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed May 30 07:45:54 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f404e31c |
7 |
|
8 |
net-libs/nodejs: Version 10.3.0. |
9 |
|
10 |
Package-Manager: Portage-2.3.40, Repoman-2.3.9 |
11 |
|
12 |
net-libs/nodejs/Manifest | 1 + |
13 |
.../files/nodejs-10.3.0-global-npm-config.patch | 20 +++ |
14 |
net-libs/nodejs/nodejs-10.3.0.ebuild | 200 +++++++++++++++++++++ |
15 |
3 files changed, 221 insertions(+) |
16 |
|
17 |
diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest |
18 |
index ea2355eeefd..a112d93e591 100644 |
19 |
--- a/net-libs/nodejs/Manifest |
20 |
+++ b/net-libs/nodejs/Manifest |
21 |
@@ -1,6 +1,7 @@ |
22 |
DIST node-v0.12.18.tar.gz 19842591 BLAKE2B f94f4de6e2875267be194580c645087a262b90da99f10d651a22838c041da07056df81204bb04ce8da083a080062509dcca4d1e3ac2250d651ead8a4cc025028 SHA512 6866608a43eb213f3b715ea0fcc28983fd959ab679c567a1b464f62acd936506f2bce88ea48a60209d8ef8d98259f4b47cd3434893eb4ff82a132775edb37b7b |
23 |
DIST node-v10.0.0.tar.xz 19248896 BLAKE2B 3ab8313e44d57a2f04442d23311a4d824a9d0b89c7d3ee06042f843ce0bde39e59c1ef2eb0d77cde4c46d649b074cf08d1109c91b0914c23b048c75f29e79727 SHA512 9d686da290f84c5fdab39cce08161787661b4df1e3e37bd242e5f5f3ff8285b6bca3ada16e155fcf0fbb9ec8ca8736dc7d02788cee2d66f6fab87c1a29048f4e |
24 |
DIST node-v10.1.0.tar.xz 19363748 BLAKE2B 931349d204764472706f44473b2ea0e1399dad84d0595cecfc2cbd71670df25f05c2c2ac77e4c18852f523d5b0cf853ca83739fc96a46e1f5e76ae51cab006c9 SHA512 f98da47849de8a50d9986d0176c39914f3993e579a3d482153cb0fceb64d7c79443fd230a80946361008e4fac58b7b99292c906961fb57ef14ccecfd1da07156 |
25 |
+DIST node-v10.3.0.tar.xz 19464004 BLAKE2B 3bd88c231402728874c9c2916225d995a64e79e311d45869910192b6c46d450e12c4b20c9045bead85de24d3e46eb65793a9a886df87545836c0875c88a98cd1 SHA512 c52c798f16b69c0266014e9f53d5243d49e71af9fb411400d526a054995f0d2d2a150d31842160af0feffbd240e36dd97b870eb8c1fbacd3a7b18a143746df7e |
26 |
DIST node-v4.8.7.tar.xz 13370828 BLAKE2B b1ee93a586b66f8582783b1be50667547afe4bf48038ebc0b8148db55542cbc0520ac84ef88e4a7f453cabc245f484c32dbc238c1932bbc708791ceeb5c9d2ab SHA512 25837a31023747723b146c45984a5b2096b61c0aa43cbf45fc8ff50b4bd5079bd0bc9f1dfd3fb076817448dc5537eb93ffb2f345280b7756ba93b67ad757c696 |
27 |
DIST node-v4.9.1.tar.xz 13250164 BLAKE2B 7a689b99bb4bf507f7f21dd2c096a5766d023a8174c0f468cab37365af1920b8700da04157e1a406917790524255ef32c243a74662fd50ef7d3567d189dac9cf SHA512 690c9fdf608e5194069a10955bdd94ec87cb1c308f13bc4d2cae92fa01436ace10fadf58f2e51d477dde6c570b23edc1c71fafea79bfc9cab2903eb2fa5f87aa |
28 |
DIST node-v6.11.5.tar.xz 15699404 BLAKE2B ba2df91bf5ef38cedb60b42919cf56f16807e619a81876fc92a5741e49da7ec91c4239d00f549c5e80d0bb8282bb9b396dd984507916cd18d61b403a3a7cef94 SHA512 62490725ef7957294c1bddf21ef0626c7472876791210168116501255ecee58457e9de9b044e10033706243299bbfd1495efeca169596fbf26f5eeba6d8fa4c9 |
29 |
|
30 |
diff --git a/net-libs/nodejs/files/nodejs-10.3.0-global-npm-config.patch b/net-libs/nodejs/files/nodejs-10.3.0-global-npm-config.patch |
31 |
new file mode 100644 |
32 |
index 00000000000..e2bbbbe97a3 |
33 |
--- /dev/null |
34 |
+++ b/net-libs/nodejs/files/nodejs-10.3.0-global-npm-config.patch |
35 |
@@ -0,0 +1,20 @@ |
36 |
+--- a/deps/npm/lib/config/core.js |
37 |
++++ b/deps/npm/lib/config/core.js |
38 |
+@@ -153,11 +153,13 @@ |
39 |
+ // Eg, `npm config get globalconfig --prefix ~/local` should |
40 |
+ // return `~/local/etc/npmrc` |
41 |
+ // annoying humans and their expectations! |
42 |
+- if (conf.get('prefix')) { |
43 |
+- var etc = path.resolve(conf.get('prefix'), 'etc') |
44 |
+- defaults.globalconfig = path.resolve(etc, 'npmrc') |
45 |
+- defaults.globalignorefile = path.resolve(etc, 'npmignore') |
46 |
++ // gentoo deviates wrt global config; store in /etc/npm |
47 |
++ var globalconfig = path.resolve('/etc', 'npm') |
48 |
++ mkdirp(globalconfig, function () { |
49 |
++ defaults.globalconfig = path.resolve(globalconfig, 'npmrc') |
50 |
++ defaults.globalignorefile = path.resolve(globalconfig, 'npmignore') |
51 |
+ } |
52 |
++ }) |
53 |
+ |
54 |
+ conf.addFile(conf.get('globalconfig'), 'global') |
55 |
+ |
56 |
|
57 |
diff --git a/net-libs/nodejs/nodejs-10.3.0.ebuild b/net-libs/nodejs/nodejs-10.3.0.ebuild |
58 |
new file mode 100644 |
59 |
index 00000000000..45f560f36a3 |
60 |
--- /dev/null |
61 |
+++ b/net-libs/nodejs/nodejs-10.3.0.ebuild |
62 |
@@ -0,0 +1,200 @@ |
63 |
+# Copyright 1999-2018 Gentoo Foundation |
64 |
+# Distributed under the terms of the GNU General Public License v2 |
65 |
+ |
66 |
+EAPI=6 |
67 |
+ |
68 |
+PYTHON_COMPAT=( python2_7 ) |
69 |
+PYTHON_REQ_USE="threads" |
70 |
+ |
71 |
+inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs |
72 |
+ |
73 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
74 |
+HOMEPAGE="https://nodejs.org/" |
75 |
+SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" |
76 |
+ |
77 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
78 |
+SLOT="0" |
79 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos" |
80 |
+IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test" |
81 |
+REQUIRED_USE=" |
82 |
+ ${PYTHON_REQUIRED_USE} |
83 |
+ inspector? ( icu ssl ) |
84 |
+" |
85 |
+ |
86 |
+RDEPEND=" |
87 |
+ >=dev-libs/libuv-1.20.3:= |
88 |
+ >=net-libs/http-parser-2.8.0:= |
89 |
+ >=net-libs/nghttp2-1.29.0 |
90 |
+ sys-libs/zlib |
91 |
+ icu? ( >=dev-libs/icu-61.1:= ) |
92 |
+ ssl? ( >=dev-libs/openssl-1.1.0:0=[-bindist] ) |
93 |
+" |
94 |
+DEPEND=" |
95 |
+ ${RDEPEND} |
96 |
+ ${PYTHON_DEPS} |
97 |
+ systemtap? ( dev-util/systemtap ) |
98 |
+ test? ( net-misc/curl ) |
99 |
+" |
100 |
+S="${WORKDIR}/node-v${PV}" |
101 |
+PATCHES=( |
102 |
+ "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch |
103 |
+) |
104 |
+ |
105 |
+pkg_pretend() { |
106 |
+ (use x86 && ! use cpu_flags_x86_sse2) && \ |
107 |
+ die "Your CPU doesn't support the required SSE2 instruction." |
108 |
+ |
109 |
+ ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ |
110 |
+ die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." |
111 |
+} |
112 |
+ |
113 |
+src_prepare() { |
114 |
+ tc-export CC CXX PKG_CONFIG |
115 |
+ export V=1 |
116 |
+ export BUILDTYPE=Release |
117 |
+ |
118 |
+ # fix compilation on Darwin |
119 |
+ # https://code.google.com/p/gyp/issues/detail?id=260 |
120 |
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die |
121 |
+ |
122 |
+ # make sure we use python2.* while using gyp |
123 |
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die |
124 |
+ sed -i -e "s/|| 'python2'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die |
125 |
+ |
126 |
+ # less verbose install output (stating the same as portage, basically) |
127 |
+ sed -i -e "/print/d" tools/install.py || die |
128 |
+ |
129 |
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 |
130 |
+ local LIBDIR=$(get_libdir) |
131 |
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die |
132 |
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js deps/npm/lib/npm.js || die |
133 |
+ |
134 |
+ # Avoid writing a depfile, not useful |
135 |
+ sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die |
136 |
+ |
137 |
+ sed -i -e "/'-O3'/d" common.gypi deps/v8/gypfiles/toolchain.gypi || die |
138 |
+ |
139 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
140 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
141 |
+ # The issue is that no stdin handle is openened when asked for one. |
142 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
143 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
144 |
+ rm test/parallel/test-stdout-close-unref.js || die |
145 |
+ |
146 |
+ # debug builds. change install path, remove optimisations and override buildtype |
147 |
+ if use debug; then |
148 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
149 |
+ BUILDTYPE=Debug |
150 |
+ fi |
151 |
+ |
152 |
+ default |
153 |
+} |
154 |
+ |
155 |
+src_configure() { |
156 |
+ local myconf=( --shared-http-parser --shared-libuv --shared-nghttp2 --shared-zlib ) |
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 && myconf+=( --shared-openssl ) || 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 |
+ "${PYTHON}" configure \ |
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 mksnapshot |
187 |
+ pax-mark m "out/${BUILDTYPE}/mksnapshot" |
188 |
+ emake -C out |
189 |
+} |
190 |
+ |
191 |
+src_install() { |
192 |
+ local LIBDIR="${ED}/usr/$(get_libdir)" |
193 |
+ emake install DESTDIR="${D}" |
194 |
+ pax-mark -m "${ED}"usr/bin/node |
195 |
+ |
196 |
+ # set up a symlink structure that node-gyp expects.. |
197 |
+ dodir /usr/include/node/deps/{v8,uv} |
198 |
+ dosym . /usr/include/node/src |
199 |
+ for var in deps/{uv,v8}/include; do |
200 |
+ dosym ../.. /usr/include/node/${var} |
201 |
+ done |
202 |
+ |
203 |
+ if use doc; then |
204 |
+ # Patch docs to make them offline readable |
205 |
+ for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do |
206 |
+ sed -i '/fonts.googleapis.com/ d' $i; |
207 |
+ done |
208 |
+ # Install docs! |
209 |
+ dohtml -r "${S}"/doc/* |
210 |
+ fi |
211 |
+ |
212 |
+ if use npm; then |
213 |
+ dodir /etc/npm |
214 |
+ |
215 |
+ # Install bash completion for `npm` |
216 |
+ # We need to temporarily replace default config path since |
217 |
+ # npm otherwise tries to write outside of the sandbox |
218 |
+ local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" |
219 |
+ sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die |
220 |
+ local tmp_npm_completion_file="$(emktemp)" |
221 |
+ "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" |
222 |
+ newbashcomp "${tmp_npm_completion_file}" npm |
223 |
+ sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die |
224 |
+ |
225 |
+ # Move man pages |
226 |
+ doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* |
227 |
+ |
228 |
+ # Clean up |
229 |
+ rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die |
230 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die |
231 |
+ |
232 |
+ local find_exp="-or -name" |
233 |
+ local find_name=() |
234 |
+ for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ |
235 |
+ ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ |
236 |
+ "*.md" "*.markdown" "*.bat" "*.cmd"; do |
237 |
+ find_name+=( ${find_exp} "${match}" ) |
238 |
+ done |
239 |
+ |
240 |
+ # Remove various development and/or inappropriate files and |
241 |
+ # useless docs of dependend packages. |
242 |
+ find "${LIBDIR}"/node_modules \ |
243 |
+ \( -type d -name examples \) -or \( -type f \( \ |
244 |
+ -iname "LICEN?E*" \ |
245 |
+ "${find_name[@]}" \ |
246 |
+ \) \) -exec rm -rf "{}" \; |
247 |
+ fi |
248 |
+} |
249 |
+ |
250 |
+src_test() { |
251 |
+ out/${BUILDTYPE}/cctest || die |
252 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
253 |
+} |
254 |
+ |
255 |
+pkg_postinst() { |
256 |
+ einfo "The global npm config lives in /etc/npm. This deviates slightly" |
257 |
+ einfo "from upstream which otherwise would have it live in /usr/etc/." |
258 |
+ einfo "" |
259 |
+ einfo "Protip: When using node-gyp to install native modules, you can" |
260 |
+ einfo "avoid having to download extras by doing the following:" |
261 |
+ einfo "$ node-gyp --nodedir /usr/include/node <command>" |
262 |
+} |