Gentoo Archives: gentoo-commits

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