Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/nodejs/
Date: Tue, 07 Sep 2021 03:31:49
Message-Id: 1630985497.a28b6de9f023f0a04c353b7bf6d1edfbd4bfb5b5.williamh@gentoo
1 commit: a28b6de9f023f0a04c353b7bf6d1edfbd4bfb5b5
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 7 03:29:52 2021 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 7 03:31:37 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a28b6de9
7
8 net-libs/nodejs: 14.17.6 bump and stable on amdt64
9
10 Bug: https://bugs.gentoo.org/811273
11 Package-Manager: Portage-3.0.20, Repoman-3.0.3
12 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
13
14 net-libs/nodejs/Manifest | 1 +
15 net-libs/nodejs/nodejs-14.17.6.ebuild | 243 ++++++++++++++++++++++++++++++++++
16 2 files changed, 244 insertions(+)
17
18 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
19 index a1ec5dfaa77..b7bbfb804d7 100644
20 --- a/net-libs/nodejs/Manifest
21 +++ b/net-libs/nodejs/Manifest
22 @@ -4,4 +4,5 @@ DIST node-v12.22.5.tar.xz 23654908 BLAKE2B ca4f304e31f091ae656142035851d6e4427d8
23 DIST node-v14.16.1.tar.xz 33297064 BLAKE2B 0927434c63cd248e90a4002b50c7a0fd68a5527a4cd7424b451840ddf0c403ba452979b195e598cc3b323e24233248a74a1274519ce8cd3a2f4e71dc7a8f3dcb SHA512 d4f5fbab69592ae555613b2186090b85a458d2211b6035989aee2617bfd0f6768ca767ec45ce12756a9c452d00af7237edee3b1ae526049e9fcd01f8f67680c0
24 DIST node-v14.17.3.tar.xz 33585080 BLAKE2B 37267c9da2d773dbbe95f7378f5b0c2b0dc397b17850be325f9fec637c6745dede4ca4136ba4bf109d72d8982ee985f1e077cc706165f1be2e3dc3053edfe229 SHA512 c6096715299f155b96df873976da91e854da7e99cde635cdb65d5c962abc5283dac86b8ddce4f5a9f7498f9793ff08943645b5e5b0b23395dfe035f7295218bb
25 DIST node-v14.17.5.tar.xz 33585724 BLAKE2B cf79397caad8c81e4096f344f9fdb88d8ecea44b97fe208256dfd4afb750ecdf52142a2dc0430285b9d5117bdd43fa5ce42b4418926eec4d2c7f0a5f5d1a1539 SHA512 9d62c8946d05862d96a13a71b241a097b9f592a9e5f7362c81d8f3c74e7c5546a308b4c74bef34a66cafeef5d1a87d9d3e5ae8bb87d470c1ecf5abb8de0dedb5
26 +DIST node-v14.17.6.tar.xz 33606464 BLAKE2B c2c449e5eaf8214d7ed4bfab8db0208034cee1d08ef0e1fca478c30fc5cf95be037eb141080dbcfbe4fc58ef734457747dcbd0fe585a0536f9c0bec495435f25 SHA512 581c5698112426042fbf54fa793e56a30cae0c54ce8f23af6ac20d73c69a4f1166c5410f357c5a7b0409a773f99e3b9291e4afffd53b3c0e00569725dc4c47d3
27 DIST node-v16.6.2.tar.xz 33713996 BLAKE2B a4974da7004779179bd3bb0f99bb703f789a89c3ffcf194e83ed4ad07b005cc4ff23dd16f69ed1fee5f2d142e9cd813acb9687021a8cf1a64475093928b4e107 SHA512 978fd8204f7512a42256b0b50d674280c418595970a1327f3197fcde1f8787816c243611c24cada8c979352d77452393481600b96e66c72c294bcd04cf33f45f
28
29 diff --git a/net-libs/nodejs/nodejs-14.17.6.ebuild b/net-libs/nodejs/nodejs-14.17.6.ebuild
30 new file mode 100644
31 index 00000000000..db0eeada210
32 --- /dev/null
33 +++ b/net-libs/nodejs/nodejs-14.17.6.ebuild
34 @@ -0,0 +1,243 @@
35 +# Copyright 1999-2021 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +PYTHON_COMPAT=( python3_{8..10} )
41 +PYTHON_REQ_USE="threads(+)"
42 +
43 +inherit bash-completion-r1 flag-o-matic pax-utils python-any-r1 toolchain-funcs xdg-utils
44 +
45 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
46 +HOMEPAGE="https://nodejs.org/"
47 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
48 +
49 +if [[ ${PV} == *9999 ]]; then
50 + inherit git-r3
51 + EGIT_REPO_URI="https://github.com/nodejs/node"
52 + SLOT="0"
53 +else
54 + SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
55 + SLOT="0/$(ver_cut 1)"
56 + KEYWORDS="amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x64-macos"
57 + S="${WORKDIR}/node-v${PV}"
58 +fi
59 +
60 +IUSE="cpu_flags_x86_sse2 debug doc +icu inspector lto +npm pax-kernel +snapshot +ssl +system-icu +system-ssl systemtap test"
61 +REQUIRED_USE="inspector? ( icu ssl )
62 + npm? ( ssl )
63 + system-icu? ( icu )
64 + system-ssl? ( ssl )"
65 +
66 +RESTRICT="!test? ( test )"
67 +
68 +RDEPEND=">=app-arch/brotli-1.0.9:=
69 + >=dev-libs/libuv-1.40.0:=
70 + >=net-dns/c-ares-1.17.2:=
71 + >=net-libs/nghttp2-1.41.0:=
72 + sys-libs/zlib
73 + system-icu? ( >=dev-libs/icu-67:= )
74 + system-ssl? (
75 + >=dev-libs/openssl-1.1.1:0=
76 + <dev-libs/openssl-3.0.0_beta1:0=
77 + )"
78 +BDEPEND="${PYTHON_DEPS}
79 + sys-apps/coreutils
80 + virtual/pkgconfig
81 + systemtap? ( dev-util/systemtap )
82 + test? ( net-misc/curl )
83 + pax-kernel? ( sys-apps/elfix )"
84 +DEPEND="${RDEPEND}"
85 +
86 +PATCHES=(
87 + "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
88 + "${FILESDIR}"/${PN}-12.22.1-jinja_collections_abc.patch
89 + "${FILESDIR}"/${PN}-12.22.1-uvwasi_shared_libuv.patch
90 + "${FILESDIR}"/${PN}-12.22.5-shared_c-ares_nameser_h.patch
91 + "${FILESDIR}"/${PN}-14.15.0-fix_ppc64_crashes.patch
92 +)
93 +
94 +pkg_pretend() {
95 + (use x86 && ! use cpu_flags_x86_sse2) && \
96 + die "Your CPU doesn't support the required SSE2 instruction."
97 +
98 + if [[ ${MERGE_TYPE} != "binary" ]]; then
99 + if use lto; then
100 + if tc-is-gcc; then
101 + if [[ $(gcc-major-version) -ge 11 ]]; then
102 + # Bug #787158
103 + die "LTO builds of ${PN} using gcc-11+ currently fail tests and produce runtime errors. Either switch to gcc-10 or unset USE=lto for this ebuild"
104 + fi
105 + else
106 + # configure.py will abort on this later if we do not
107 + die "${PN} only supports LTO for gcc"
108 + fi
109 + fi
110 + fi
111 +}
112 +
113 +src_prepare() {
114 + tc-export AR 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 + # less verbose install output (stating the same as portage, basically)
123 + sed -i -e "/print/d" tools/install.py || die
124 +
125 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
126 + local LIBDIR=$(get_libdir)
127 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
128 + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
129 +
130 + # Avoid writing a depfile, not useful
131 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
132 +
133 + sed -i -e "/'-O3'/d" common.gypi node.gypi || die
134 +
135 + # debug builds. change install path, remove optimisations and override buildtype
136 + if use debug; then
137 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
138 + BUILDTYPE=Debug
139 + fi
140 +
141 + # We need to disable mprotect on two files when it builds Bug 694100.
142 + use pax-kernel && PATCHES+=( "${FILESDIR}"/${PN}-13.8.0-paxmarking.patch )
143 +
144 + # All this test does is check if the npm CLI produces warnings of any sort,
145 + # failing if it does. Overkill, much? Especially given one possible warning
146 + # is that there is a newer version of npm available upstream (yes, it does
147 + # use the network if available), thus making it a real possibility for this
148 + # test to begin failing one day even though it was fine before.
149 + rm -f test/parallel/test-release-npm.js
150 +
151 + default
152 +}
153 +
154 +src_configure() {
155 + xdg_environment_reset
156 +
157 + # LTO compiler flags are handled by configure.py itself
158 + filter-flags '-flto*'
159 +
160 + local myconf=(
161 + --shared-brotli
162 + --shared-cares
163 + --shared-libuv
164 + --shared-nghttp2
165 + --shared-zlib
166 + )
167 + use debug && myconf+=( --debug )
168 + use lto && myconf+=( --enable-lto )
169 + if use system-icu; then
170 + myconf+=( --with-intl=system-icu )
171 + elif use icu; then
172 + myconf+=( --with-intl=full-icu )
173 + else
174 + myconf+=( --with-intl=none )
175 + fi
176 + use inspector || myconf+=( --without-inspector )
177 + use npm || myconf+=( --without-npm )
178 + use snapshot || myconf+=( --without-node-snapshot )
179 + if use ssl; then
180 + use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store )
181 + else
182 + myconf+=( --without-ssl )
183 + fi
184 +
185 + local myarch=""
186 + case ${ABI} in
187 + amd64) myarch="x64";;
188 + arm) myarch="arm";;
189 + arm64) myarch="arm64";;
190 + ppc64) myarch="ppc64";;
191 + x32) myarch="x32";;
192 + x86) myarch="ia32";;
193 + *) myarch="${ABI}";;
194 + esac
195 +
196 + GYP_DEFINES="linux_use_gold_flags=0
197 + linux_use_bundled_binutils=0
198 + linux_use_bundled_gold=0" \
199 + "${EPYTHON}" configure.py \
200 + --prefix="${EPREFIX}"/usr \
201 + --dest-cpu=${myarch} \
202 + $(use_with systemtap dtrace) \
203 + "${myconf[@]}" || die
204 +}
205 +
206 +src_compile() {
207 + emake -C out
208 +}
209 +
210 +src_install() {
211 + local LIBDIR="${ED}/usr/$(get_libdir)"
212 + default
213 +
214 + pax-mark -m "${ED}"/usr/bin/node
215 +
216 + # set up a symlink structure that node-gyp expects..
217 + dodir /usr/include/node/deps/{v8,uv}
218 + dosym . /usr/include/node/src
219 + for var in deps/{uv,v8}/include; do
220 + dosym ../.. /usr/include/node/${var}
221 + done
222 +
223 + if use doc; then
224 + docinto html
225 + dodoc -r "${S}"/doc/*
226 + fi
227 +
228 + if use npm; then
229 + dodir /etc/npm
230 +
231 + # Install bash completion for `npm`
232 + # We need to temporarily replace default config path since
233 + # npm otherwise tries to write outside of the sandbox
234 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
235 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
236 + local tmp_npm_completion_file="$(TMPDIR="${T}" mktemp -t npm.XXXXXXXXXX)"
237 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
238 + newbashcomp "${tmp_npm_completion_file}" npm
239 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
240 +
241 + # Move man pages
242 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
243 +
244 + # Clean up
245 + rm -f "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile}
246 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man}
247 +
248 + local find_exp="-or -name"
249 + local find_name=()
250 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
251 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
252 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
253 + find_name+=( ${find_exp} "${match}" )
254 + done
255 +
256 + # Remove various development and/or inappropriate files and
257 + # useless docs of dependend packages.
258 + find "${LIBDIR}"/node_modules \
259 + \( -type d -name examples \) -or \( -type f \( \
260 + -iname "LICEN?E*" \
261 + "${find_name[@]}" \
262 + \) \) -exec rm -rf "{}" \;
263 + fi
264 +
265 + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
266 +}
267 +
268 +src_test() {
269 + if has usersandbox ${FEATURES}; then
270 + rm -f "${S}"/test/parallel/test-fs-mkdir.js
271 + ewarn "You are emerging ${PN} with 'usersandbox' enabled. Excluding tests known to fail in this mode." \
272 + "For full test coverage, emerge =${CATEGORY}/${PF} with 'FEATURES=-usersandbox'."
273 + fi
274 +
275 + out/${BUILDTYPE}/cctest || die
276 + "${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} --flaky-tests=dontcare -J message parallel sequential || die
277 +}