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