1 |
commit: ff805d60ed2c74c8e5783c3bfc03cb1b407d9c9a |
2 |
Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 26 20:00:18 2020 +0000 |
4 |
Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 26 20:00:50 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff805d60 |
7 |
|
8 |
net-libs/nodejs: Version 12.17.0 |
9 |
|
10 |
Package-Manager: Portage-2.3.100, Repoman-2.3.22 |
11 |
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org> |
12 |
|
13 |
net-libs/nodejs/Manifest | 1 + |
14 |
net-libs/nodejs/nodejs-12.17.0.ebuild | 213 ++++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 214 insertions(+) |
16 |
|
17 |
diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest |
18 |
index 8ae6f4e4c01..12eae07b4e2 100644 |
19 |
--- a/net-libs/nodejs/Manifest |
20 |
+++ b/net-libs/nodejs/Manifest |
21 |
@@ -3,6 +3,7 @@ DIST node-v10.20.1.tar.xz 21947588 BLAKE2B 6078e29a125fc1020de7b62c97174d82273af |
22 |
DIST node-v12.16.1.tar.xz 23481768 BLAKE2B 29371b952c14907778c064269108f1da5e3818c32773e73090c61edcd07190c418189db6a505987ca71f99bb868880e297de5d2181b9a880774eaaf515985f26 SHA512 fe1e9fabb6fe52e3bc4275b33e6c5e4a761550b04964c0ae7dbef7172f5d415207bb2985751d068e357ce45a0ba414b07c0abd1531ef839b9463e98eeae8f9a4 |
23 |
DIST node-v12.16.2.tar.xz 23654020 BLAKE2B aa4bb764a8731e32ce07d03d96d573632bbf9af79b127c2acec48fcf335c01ea0ea99532670a46befac42e2e1ce5a4dbd2e4cf0d068bac05749d87af59bb80fa SHA512 81688468bc6e20d83f7f58f0c15f9291a801eb2acc8ba7279e65d81f3eb4ea95e3b6cee0d09738c0d0fa35226ae3d52f2bad5da63a20a3edc9129197d42d000d |
24 |
DIST node-v12.16.3.tar.xz 23682432 BLAKE2B 91b97c0de9c76f33d080f3f12a42a15140be6e3f4d42022a55305dc2afc04de6a2b8364b9fc5df0dd71c9ec249eb9e4da8ff23f53be43a1f306d2a6fbc6d6bce SHA512 e5d2d1960972f19ef5acc667efb702d534eb436212dea9e0bfd817328c927b55734406f232b32bba366f05c2691e5085e3a6f8c1e2d959398745e60719e731b3 |
25 |
+DIST node-v12.17.0.tar.xz 23702040 BLAKE2B 4b35c6f7a3c16a7b737bc5b71f075fe6c66c9c4a5cd3ee240a0c1af9cfd4e10c61520d0489169a74354734083b7f7c68b97eefaa6f40e3320ec5b0126d36169f SHA512 0fc8483c6ae8994ff4f4b2465f1b8b1d3c620c90222fb270fe3d317d967294cc9e6bdcc50277fbe0ab28cb3ce9e73ec122c19adf8a686ecc95de3268b82ca4f7 |
26 |
DIST node-v14.2.0.tar.xz 32884616 BLAKE2B 7bcb07cb7623c5e08c20267c320cdf23ad110f124c5ad1f2447ef8b76ab8dc44ed50dab7c5651424d9d3a36f7eeecdf3292b07c02cb2e22c3fbe4ed633c4b842 SHA512 47e5ec0b7a207082d43419a7e0a6ea9242ec43b4d7c2217eb66d0b45e2f4d5cb561b3f6fe35fdc41a8be95c182dc122ba262f696ebd12833596d71b372ec85d2 |
27 |
DIST node-v14.3.0.tar.xz 32985344 BLAKE2B 32ee357e109484422c3b22423ab9a593cd5d4611073c820f90c196dae4df2860573cdd06170879f675b738b01885eb2fe0f25c2328841838bf9367324cc981a7 SHA512 3afcc430bad57150baa8d1c0e5ef0f64691ef6549a052be654a86313fe28f31e7fdfeea4d2b3993798a7141bc6d7b1642747d1bc2636139e2f2fd79441580148 |
28 |
DIST node-v8.12.0.tar.xz 18310452 BLAKE2B 79634fc57cd76a97e72bab4be37da91d5eff4d13cdaa2b48e83f013885fa3590ba4a28378baf036ed26b7304bf234753d1d4014f72571496f5bb6cd5b221e5f0 SHA512 665d2dba287d78bcd723d7b4d00a6897fb996f4aa69a541e010a3dfeb2614257892117fcce7123966b1ecaddc9269a6667e0e262df693baea1f476c96de55c42 |
29 |
|
30 |
diff --git a/net-libs/nodejs/nodejs-12.17.0.ebuild b/net-libs/nodejs/nodejs-12.17.0.ebuild |
31 |
new file mode 100644 |
32 |
index 00000000000..8b860166ed5 |
33 |
--- /dev/null |
34 |
+++ b/net-libs/nodejs/nodejs-12.17.0.ebuild |
35 |
@@ -0,0 +1,213 @@ |
36 |
+# Copyright 1999-2020 Gentoo Authors |
37 |
+# Distributed under the terms of the GNU General Public License v2 |
38 |
+ |
39 |
+EAPI=7 |
40 |
+PYTHON_COMPAT=( python3_{6,7} ) |
41 |
+PYTHON_REQ_USE="threads(+)" |
42 |
+inherit bash-completion-r1 eutils flag-o-matic pax-utils python-any-r1 toolchain-funcs xdg-utils |
43 |
+ |
44 |
+DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" |
45 |
+HOMEPAGE="https://nodejs.org/" |
46 |
+SRC_URI=" |
47 |
+ https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz |
48 |
+" |
49 |
+ |
50 |
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" |
51 |
+SLOT="0" |
52 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos" |
53 |
+IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl +system-ssl systemtap test" |
54 |
+REQUIRED_USE=" |
55 |
+ inspector? ( icu ssl ) |
56 |
+ npm? ( ssl ) |
57 |
+ system-ssl? ( ssl ) |
58 |
+" |
59 |
+ |
60 |
+RDEPEND=" |
61 |
+ >=dev-libs/libuv-1.37.0:= |
62 |
+ >=net-dns/c-ares-1.16.0 |
63 |
+ >=net-libs/http-parser-2.9.3:= |
64 |
+ >=net-libs/nghttp2-1.40.0 |
65 |
+ sys-libs/zlib |
66 |
+ icu? ( >=dev-libs/icu-64.2:= ) |
67 |
+ system-ssl? ( >=dev-libs/openssl-1.1.1:0= ) |
68 |
+" |
69 |
+BDEPEND=" |
70 |
+ ${PYTHON_DEPS} |
71 |
+ systemtap? ( dev-util/systemtap ) |
72 |
+ test? ( net-misc/curl ) |
73 |
+" |
74 |
+DEPEND=" |
75 |
+ ${RDEPEND} |
76 |
+" |
77 |
+PATCHES=( |
78 |
+ "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch |
79 |
+ "${FILESDIR}"/${PN}-99999999-llhttp.patch |
80 |
+) |
81 |
+RESTRICT="test" |
82 |
+S="${WORKDIR}/node-v${PV}" |
83 |
+ |
84 |
+pkg_pretend() { |
85 |
+ (use x86 && ! use cpu_flags_x86_sse2) && \ |
86 |
+ die "Your CPU doesn't support the required SSE2 instruction." |
87 |
+ |
88 |
+ ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ |
89 |
+ die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." |
90 |
+} |
91 |
+ |
92 |
+src_prepare() { |
93 |
+ tc-export CC CXX PKG_CONFIG |
94 |
+ export V=1 |
95 |
+ export BUILDTYPE=Release |
96 |
+ |
97 |
+ # fix compilation on Darwin |
98 |
+ # https://code.google.com/p/gyp/issues/detail?id=260 |
99 |
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die |
100 |
+ |
101 |
+ # less verbose install output (stating the same as portage, basically) |
102 |
+ sed -i -e "/print/d" tools/install.py || die |
103 |
+ |
104 |
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504 |
105 |
+ local LIBDIR=$(get_libdir) |
106 |
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die |
107 |
+ sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die |
108 |
+ |
109 |
+ # Avoid writing a depfile, not useful |
110 |
+ sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die |
111 |
+ |
112 |
+ sed -i -e "/'-O3'/d" common.gypi node.gypi || die |
113 |
+ |
114 |
+ # Avoid a test that I've only been able to reproduce from emerge. It doesnt |
115 |
+ # seem sandbox related either (invoking it from a sandbox works fine). |
116 |
+ # The issue is that no stdin handle is openened when asked for one. |
117 |
+ # It doesn't really belong upstream , so it'll just be removed until someone |
118 |
+ # with more gentoo-knowledge than me (jbergstroem) figures it out. |
119 |
+ rm test/parallel/test-stdout-close-unref.js || die |
120 |
+ |
121 |
+ # debug builds. change install path, remove optimisations and override buildtype |
122 |
+ if use debug; then |
123 |
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die |
124 |
+ BUILDTYPE=Debug |
125 |
+ fi |
126 |
+ |
127 |
+ default |
128 |
+} |
129 |
+ |
130 |
+src_configure() { |
131 |
+ xdg_environment_reset |
132 |
+ |
133 |
+ local myconf=( |
134 |
+ --shared-cares |
135 |
+ --shared-http-parser |
136 |
+ --shared-libuv |
137 |
+ --shared-nghttp2 |
138 |
+ --shared-zlib |
139 |
+ ) |
140 |
+ use debug && myconf+=( --debug ) |
141 |
+ use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none ) |
142 |
+ use inspector || myconf+=( --without-inspector ) |
143 |
+ use npm || myconf+=( --without-npm ) |
144 |
+ use snapshot || myconf+=( --without-node-snapshot ) |
145 |
+ if use ssl; then |
146 |
+ use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store ) |
147 |
+ else |
148 |
+ myconf+=( --without-ssl ) |
149 |
+ fi |
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 |
+ "${EPYTHON}" configure.py \ |
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 |
+ default |
181 |
+ |
182 |
+ pax-mark -m "${ED}"/usr/bin/node |
183 |
+ |
184 |
+ # set up a symlink structure that node-gyp expects.. |
185 |
+ dodir /usr/include/node/deps/{v8,uv} |
186 |
+ dosym . /usr/include/node/src |
187 |
+ for var in deps/{uv,v8}/include; do |
188 |
+ dosym ../.. /usr/include/node/${var} |
189 |
+ done |
190 |
+ |
191 |
+ if use doc; then |
192 |
+ docinto html |
193 |
+ dodoc -r "${S}"/doc/* |
194 |
+ fi |
195 |
+ |
196 |
+ if use npm; then |
197 |
+ dodir /etc/npm |
198 |
+ |
199 |
+ # Install bash completion for `npm` |
200 |
+ # We need to temporarily replace default config path since |
201 |
+ # npm otherwise tries to write outside of the sandbox |
202 |
+ local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" |
203 |
+ sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die |
204 |
+ local tmp_npm_completion_file="$(emktemp)" |
205 |
+ "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" |
206 |
+ newbashcomp "${tmp_npm_completion_file}" npm |
207 |
+ sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die |
208 |
+ |
209 |
+ # Move man pages |
210 |
+ doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* |
211 |
+ |
212 |
+ # Clean up |
213 |
+ rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die |
214 |
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die |
215 |
+ |
216 |
+ local find_exp="-or -name" |
217 |
+ local find_name=() |
218 |
+ for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ |
219 |
+ ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ |
220 |
+ "*.md" "*.markdown" "*.bat" "*.cmd"; do |
221 |
+ find_name+=( ${find_exp} "${match}" ) |
222 |
+ done |
223 |
+ |
224 |
+ # Remove various development and/or inappropriate files and |
225 |
+ # useless docs of dependend packages. |
226 |
+ find "${LIBDIR}"/node_modules \ |
227 |
+ \( -type d -name examples \) -or \( -type f \( \ |
228 |
+ -iname "LICEN?E*" \ |
229 |
+ "${find_name[@]}" \ |
230 |
+ \) \) -exec rm -rf "{}" \; |
231 |
+ fi |
232 |
+ |
233 |
+ mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die |
234 |
+} |
235 |
+ |
236 |
+src_test() { |
237 |
+ out/${BUILDTYPE}/cctest || die |
238 |
+ "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die |
239 |
+} |
240 |
+ |
241 |
+pkg_postinst() { |
242 |
+ elog "The global npm config lives in /etc/npm. This deviates slightly" |
243 |
+ elog "from upstream which otherwise would have it live in /usr/etc/." |
244 |
+ elog "" |
245 |
+ elog "Protip: When using node-gyp to install native modules, you can" |
246 |
+ elog "avoid having to download extras by doing the following:" |
247 |
+ elog "$ node-gyp --nodedir /usr/include/node <command>" |
248 |
+} |