Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: profiles/, net-libs/nodejs/
Date: Fri, 15 Feb 2019 10:59:07
Message-Id: 1550228339.75d21d5a534c45bae232670ca0e14f385fcf2bc8.jer@gentoo
1 commit: 75d21d5a534c45bae232670ca0e14f385fcf2bc8
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 15 10:58:23 2019 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 15 10:58:59 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75d21d5a
7
8 net-libs/nodejs: Version 11.10.0
9
10 Package-Manager: Portage-2.3.60, Repoman-2.3.12
11 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
12
13 net-libs/nodejs/Manifest | 1 +
14 net-libs/nodejs/nodejs-11.10.0.ebuild | 210 ++++++++++++++++++++++++++++++++++
15 profiles/package.mask | 1 +
16 3 files changed, 212 insertions(+)
17
18 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
19 index 7bc4ffd19f1..0f8572c283d 100644
20 --- a/net-libs/nodejs/Manifest
21 +++ b/net-libs/nodejs/Manifest
22 @@ -1,6 +1,7 @@
23 DIST node-v0.12.18.tar.gz 19842591 BLAKE2B f94f4de6e2875267be194580c645087a262b90da99f10d651a22838c041da07056df81204bb04ce8da083a080062509dcca4d1e3ac2250d651ead8a4cc025028 SHA512 6866608a43eb213f3b715ea0fcc28983fd959ab679c567a1b464f62acd936506f2bce88ea48a60209d8ef8d98259f4b47cd3434893eb4ff82a132775edb37b7b
24 DIST node-v10.15.0.tar.xz 20217588 BLAKE2B ef7f626bd3b13b11a1cbf21f5c6a2ce08567dddc2fb525c5f10e02f81750a648245c2eb88535d8aac1b055a13d12f9ead72d55c4ccf68062940da09d582344c3 SHA512 6c10ae4070cd8b89d4d31ee2137453fa582cef85c6f002c78d5029ceedddf5caeee8e28a4e75dfc632c3af3c8e2acec403ab17a927ba51fa31175d58b45cbf49
25 DIST node-v10.15.1.tar.xz 20231024 BLAKE2B 82fec4cf3902cc3b8eba595c969e18ffd2fb468e58eec026308aef2c3dde3c9b96c96997b2710e224c77c373ac72e5cc8dd4e68d937914e014d3f457c7d6afa4 SHA512 823a4703b388275aa86e7ede5c626a918764d6e83bdd9a0cb249ec1f960f3a3020306078d8a4113311303e4c3380d4090c928041ef64189a3cdf67153c7cac95
26 +DIST node-v11.10.0.tar.xz 22073588 BLAKE2B d2a58655c7a9a5b5f78abeaeee80747df83408c1ef325aca06b5636fda5a7cde7eb787f70960abfa1bfa9397a3a45d266d72e91359bb9035103e3ebbe88813a8 SHA512 f6701f235b2f95c4c1ba240d0540646cb6268ba795b385126abe915095e8620c90047c192215f8460e903711b0851680faa19d7ea39213d5396f4d56f728500d
27 DIST node-v11.7.0.tar.xz 21218124 BLAKE2B a7e69dc8d6ee2f42ea78ec9c4d623b56bfbc2e130fc6b7d33038ce79f03d7b92e78545fa26bb2dbd58c1c25677f0b224077822264fd9cec49e71f18517098563 SHA512 eec2d5e67d94314f1a09f3a1c3407d6b12e9decbdff99d41eb487c4ddc1929fc5661be0b6fbb180961ecb6094311630b19faa0af031d82ff8de7ae213ee35ab7
28 DIST node-v11.8.0.tar.xz 21253080 BLAKE2B 808df024b7dba628f03b7c6c2fe8c486bb036f02f80aa2184de0a8393afad17dcd19d98fd63f1ffc5f9c1dc4fb078f32d15217322d1608510f291eef456df35f SHA512 7c33984014c2b95bde59affee88bc77caa2788dbdd7db87150acd58c56304932bf4b030994c91fc655f0f32202b8d1ed370c3d19d09569af50ffce91414d62ac
29 DIST node-v11.9.0.tar.xz 21703796 BLAKE2B 9097a93b749b7a3dee38507ae37ece985872391f86f75a7aefb7820c361e98e708e4629fe2c5c8d76de9e9fac8c9b8d8811b490b63ce31ba57777abf47cc2fe3 SHA512 beb20a9042c990ae8978b5794db21d3461ed41b985ad6a5f163ea9563ed3277953926f83a81f49d7b7ae040bad95d7777ff758a03dd299a0de1014e008767da2
30
31 diff --git a/net-libs/nodejs/nodejs-11.10.0.ebuild b/net-libs/nodejs/nodejs-11.10.0.ebuild
32 new file mode 100644
33 index 00000000000..c4b2df6f8bd
34 --- /dev/null
35 +++ b/net-libs/nodejs/nodejs-11.10.0.ebuild
36 @@ -0,0 +1,210 @@
37 +# Copyright 1999-2019 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=6
41 +
42 +PYTHON_COMPAT=( python2_7 )
43 +PYTHON_REQ_USE="threads"
44 +
45 +inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs
46 +
47 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
48 +HOMEPAGE="https://nodejs.org/"
49 +SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
50 +
51 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos"
54 +IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test"
55 +REQUIRED_USE="
56 + ${PYTHON_REQUIRED_USE}
57 + inspector? ( icu ssl )
58 + npm? ( ssl )
59 +"
60 +
61 +RDEPEND="
62 + >=dev-libs/libuv-1.26.0:=
63 + >=net-dns/c-ares-1.15.0
64 + >=net-libs/http-parser-2.9.0:=
65 + >=net-libs/nghttp2-1.34.0
66 + sys-libs/zlib
67 + icu? ( >=dev-libs/icu-63.1:= )
68 + ssl? ( =dev-libs/openssl-1.1.1*:0= )
69 +"
70 +DEPEND="
71 + ${RDEPEND}
72 + ${PYTHON_DEPS}
73 + systemtap? ( dev-util/systemtap )
74 + test? ( net-misc/curl )
75 +"
76 +PATCHES=(
77 + "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
78 + "${FILESDIR}"/${PN}-11.4.0-stdarg_h.patch
79 + "${FILESDIR}"/${PN}-99999999-llhttp.patch
80 +)
81 +S="${WORKDIR}/node-v${PV}"
82 +
83 +pkg_pretend() {
84 + (use x86 && ! use cpu_flags_x86_sse2) && \
85 + die "Your CPU doesn't support the required SSE2 instruction."
86 +
87 + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \
88 + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
89 +}
90 +
91 +src_prepare() {
92 + tc-export CC CXX PKG_CONFIG
93 + export V=1
94 + export BUILDTYPE=Release
95 +
96 + # fix compilation on Darwin
97 + # https://code.google.com/p/gyp/issues/detail?id=260
98 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
99 +
100 + # make sure we use python2.* while using gyp
101 + sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
102 + sed -i -e "s/|| 'python2'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
103 +
104 + # less verbose install output (stating the same as portage, basically)
105 + sed -i -e "/print/d" tools/install.py || die
106 +
107 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
108 + local LIBDIR=$(get_libdir)
109 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
110 + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
111 +
112 + # Avoid writing a depfile, not useful
113 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
114 +
115 + sed -i -e "/'-O3'/d" common.gypi deps/v8/gypfiles/toolchain.gypi || die
116 +
117 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
118 + # seem sandbox related either (invoking it from a sandbox works fine).
119 + # The issue is that no stdin handle is openened when asked for one.
120 + # It doesn't really belong upstream , so it'll just be removed until someone
121 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
122 + rm test/parallel/test-stdout-close-unref.js || die
123 +
124 + # debug builds. change install path, remove optimisations and override buildtype
125 + if use debug; then
126 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
127 + BUILDTYPE=Debug
128 + fi
129 +
130 + default
131 +}
132 +
133 +src_configure() {
134 + local myconf=(
135 + --shared-cares --shared-http-parser --shared-libuv --shared-nghttp2
136 + --shared-zlib
137 + )
138 + use debug && myconf+=( --debug )
139 + use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none )
140 + use inspector || myconf+=( --without-inspector )
141 + use npm || myconf+=( --without-npm )
142 + use snapshot && myconf+=( --with-snapshot )
143 + use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl )
144 +
145 + local myarch=""
146 + case ${ABI} in
147 + amd64) myarch="x64";;
148 + arm) myarch="arm";;
149 + arm64) myarch="arm64";;
150 + ppc64) myarch="ppc64";;
151 + x32) myarch="x32";;
152 + x86) myarch="ia32";;
153 + *) myarch="${ABI}";;
154 + esac
155 +
156 + GYP_DEFINES="linux_use_gold_flags=0
157 + linux_use_bundled_binutils=0
158 + linux_use_bundled_gold=0" \
159 + "${PYTHON}" configure \
160 + --prefix="${EPREFIX}"/usr \
161 + --dest-cpu=${myarch} \
162 + $(use_with systemtap dtrace) \
163 + "${myconf[@]}" || die
164 +}
165 +
166 +src_compile() {
167 + emake -C out mksnapshot
168 + pax-mark m "out/${BUILDTYPE}/mksnapshot"
169 + emake -C out
170 +}
171 +
172 +src_install() {
173 + local LIBDIR="${ED}/usr/$(get_libdir)"
174 + emake install DESTDIR="${D}"
175 + pax-mark -m "${ED}"usr/bin/node
176 +
177 + # set up a symlink structure that node-gyp expects..
178 + dodir /usr/include/node/deps/{v8,uv}
179 + dosym . /usr/include/node/src
180 + for var in deps/{uv,v8}/include; do
181 + dosym ../.. /usr/include/node/${var}
182 + done
183 +
184 + if use doc; then
185 + # Patch docs to make them offline readable
186 + for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do
187 + sed -i '/fonts.googleapis.com/ d' $i;
188 + done
189 + # Install docs
190 + docinto html
191 + dodoc -r "${S}"/doc/*
192 + fi
193 +
194 + if use npm; then
195 + dodir /etc/npm
196 +
197 + # Install bash completion for `npm`
198 + # We need to temporarily replace default config path since
199 + # npm otherwise tries to write outside of the sandbox
200 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
201 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
202 + local tmp_npm_completion_file="$(emktemp)"
203 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
204 + newbashcomp "${tmp_npm_completion_file}" npm
205 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
206 +
207 + # Move man pages
208 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
209 +
210 + # Clean up
211 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
212 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
213 +
214 + local find_exp="-or -name"
215 + local find_name=()
216 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
217 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
218 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
219 + find_name+=( ${find_exp} "${match}" )
220 + done
221 +
222 + # Remove various development and/or inappropriate files and
223 + # useless docs of dependend packages.
224 + find "${LIBDIR}"/node_modules \
225 + \( -type d -name examples \) -or \( -type f \( \
226 + -iname "LICEN?E*" \
227 + "${find_name[@]}" \
228 + \) \) -exec rm -rf "{}" \;
229 + fi
230 +
231 + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
232 +}
233 +
234 +src_test() {
235 + out/${BUILDTYPE}/cctest || die
236 + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
237 +}
238 +
239 +pkg_postinst() {
240 + elog "The global npm config lives in /etc/npm. This deviates slightly"
241 + elog "from upstream which otherwise would have it live in /usr/etc/."
242 + elog ""
243 + elog "Protip: When using node-gyp to install native modules, you can"
244 + elog "avoid having to download extras by doing the following:"
245 + elog "$ node-gyp --nodedir /usr/include/node <command>"
246 +}
247
248 diff --git a/profiles/package.mask b/profiles/package.mask
249 index ad64cfbc1f1..9423222fff4 100644
250 --- a/profiles/package.mask
251 +++ b/profiles/package.mask
252 @@ -103,6 +103,7 @@ mail-filter/dovecot-antispam
253 # Depends on =dev-libs/openssl-1.1.1*
254 # bug #670574
255 =net-libs/nodejs-11.9*
256 +=net-libs/nodejs-11.10*
257
258 # Andreas Sturmlechner <asturm@g.o> (30 Jan 2019)
259 # Dead upstream, breaks every other poppler release due to private