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: Wed, 07 Oct 2020 22:16:26
Message-Id: 1602108980.2b665e982b6c3246b79e36619b4fe53facc0ac41.jer@gentoo
1 commit: 2b665e982b6c3246b79e36619b4fe53facc0ac41
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 7 21:51:31 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 7 22:16:20 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b665e98
7
8 net-libs/nodejs: Version 14.13.1
9
10 Package-Manager: Portage-3.0.8, Repoman-3.0.1
11 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
12
13 net-libs/nodejs/Manifest | 1 +
14 net-libs/nodejs/nodejs-14.13.1.ebuild | 205 ++++++++++++++++++++++++++++++++++
15 2 files changed, 206 insertions(+)
16
17 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
18 index 7ec197bfcad..bc7d2c8bf8e 100644
19 --- a/net-libs/nodejs/Manifest
20 +++ b/net-libs/nodejs/Manifest
21 @@ -3,5 +3,6 @@ DIST node-v12.19.0.tar.xz 23819884 BLAKE2B 5affa4ef9bd4c88218cf8845341f8f7d357a8
22 DIST node-v14.11.0.tar.xz 33379456 BLAKE2B 99e2eba4ba2e54209836fa1e3b63e42caf854d7f3bc99f5836300b0795ef8c785b78bd7c6b99148604f0bb1b34a5169c72e8be0f8d4f62412e7d352fce15ca18 SHA512 5014ebaeb109b0ecaca8f795a4e1a626c03b1132f9b8bac8826b734633c14e9f99b4f079c185a1f43f6938a1e543e5838f520159c3e08ca454398039fd26ef11
23 DIST node-v14.12.0.tar.xz 33390472 BLAKE2B 930b196ada16d21e2d2b43d030d936391e039cc985ee517b6b420277baa071ecef8c8cef7bd2f24b5e167465e9d4acc6b0da36ae4e7332fe179c47724e05ff50 SHA512 168141a3e3f20be98a0e800a8e8f70e1ff330ff087cc08c31d6ae185882615723166f445d6310a23e1bb5a023e671a74834b40e1b83f2b789f65c787c18762e2
24 DIST node-v14.13.0.tar.xz 33418156 BLAKE2B 8a986a467b77485fbe2bc9d580c48ae72536d6d62c826319b787d2937c86358787ae452676b69df608adb9d9754f4cd068b729614989a4f2a93973380c4929d1 SHA512 7a75bff501520afbe15d6ceea4b4507717111c87cf03de47047af790df2e2e9d71da9501c7256d5dd9f58616c3d04db2e74401dfbcbd72abbd0c81778a588893
25 +DIST node-v14.13.1.tar.xz 33428732 BLAKE2B f3a7349ea4a13b47a66272b74fb7273d6071c35d7d047b147da13d5fd97a912a0770047ceed4d298f0999b9cab57aee81aaac44a6ffec59df1ee1d2ec9156e7b SHA512 a0ad1e6e4be887d56388d0cbe30d72e87fefdaa71be8fe8c96e3dce470821730741b7beff23c67277ab02991aa9813e9fb708b6b708a2cf108c5442a59d527a0
26 DIST node-v14.2.0.tar.xz 32884616 BLAKE2B 7bcb07cb7623c5e08c20267c320cdf23ad110f124c5ad1f2447ef8b76ab8dc44ed50dab7c5651424d9d3a36f7eeecdf3292b07c02cb2e22c3fbe4ed633c4b842 SHA512 47e5ec0b7a207082d43419a7e0a6ea9242ec43b4d7c2217eb66d0b45e2f4d5cb561b3f6fe35fdc41a8be95c182dc122ba262f696ebd12833596d71b372ec85d2
27 DIST node-v14.4.0.tar.xz 33005312 BLAKE2B bc1462d897e24a6b842e6f8146971866c73b54ff5383d76cfc5728a73e2c135d28ced068744174b3fb5af4a6ec05ef1f115ea51c2d65517cbe18e1d733460d04 SHA512 f1a7c788a8a149b942ec2b90a4314baaa5355c381029eda45002728ce7209925c016323b0ec1e0dfe2359fddb24f494df125805d0d266b738a333dcddb3f59c3
28
29 diff --git a/net-libs/nodejs/nodejs-14.13.1.ebuild b/net-libs/nodejs/nodejs-14.13.1.ebuild
30 new file mode 100644
31 index 00000000000..1b229989974
32 --- /dev/null
33 +++ b/net-libs/nodejs/nodejs-14.13.1.ebuild
34 @@ -0,0 +1,205 @@
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=( python3_{6,7,8} )
40 +PYTHON_REQ_USE="threads(+)"
41 +inherit bash-completion-r1 eutils 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 +system-ssl systemtap test"
53 +REQUIRED_USE="
54 + inspector? ( icu ssl )
55 + npm? ( ssl )
56 + system-ssl? ( ssl )
57 +"
58 +
59 +RDEPEND="
60 + >=app-arch/brotli-1.0.9
61 + >=dev-libs/libuv-1.40.0:=
62 + >=net-dns/c-ares-1.16.1
63 + >=net-libs/nghttp2-1.41.0
64 + sys-libs/zlib
65 + icu? ( >=dev-libs/icu-67:= )
66 + system-ssl? ( >=dev-libs/openssl-1.1.1:0= )
67 +"
68 +BDEPEND="
69 + ${PYTHON_DEPS}
70 + systemtap? ( dev-util/systemtap )
71 + test? ( net-misc/curl )
72 + pax_kernel? ( sys-apps/elfix )
73 +"
74 +DEPEND="
75 + ${RDEPEND}
76 +"
77 +PATCHES=(
78 + "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
79 +)
80 +RESTRICT="test"
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 AR 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 + # less verbose install output (stating the same as portage, basically)
101 + sed -i -e "/print/d" tools/install.py || die
102 +
103 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
104 + local LIBDIR=$(get_libdir)
105 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
106 + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
107 +
108 + # Avoid writing a depfile, not useful
109 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
110 +
111 + sed -i -e "/'-O3'/d" common.gypi node.gypi || die
112 +
113 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
114 + # seem sandbox related either (invoking it from a sandbox works fine).
115 + # The issue is that no stdin handle is openened when asked for one.
116 + # It doesn't really belong upstream , so it'll just be removed until someone
117 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
118 + rm test/parallel/test-stdout-close-unref.js || die
119 +
120 + # debug builds. change install path, remove optimisations and override buildtype
121 + if use debug; then
122 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
123 + BUILDTYPE=Debug
124 + fi
125 +
126 + # We need to disable mprotect on two files when it builds Bug 694100.
127 + use pax_kernel && PATCHES+=( "${FILESDIR}"/${PN}-13.8.0-paxmarking.patch )
128 +
129 + default
130 +}
131 +
132 +src_configure() {
133 + xdg_environment_reset
134 +
135 + local myconf=(
136 + --shared-brotli
137 + --shared-cares
138 + --shared-libuv
139 + --shared-nghttp2
140 + --shared-zlib
141 + )
142 + use debug && myconf+=( --debug )
143 + use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none )
144 + use inspector || myconf+=( --without-inspector )
145 + use npm || myconf+=( --without-npm )
146 + use snapshot || myconf+=( --without-node-snapshot )
147 + if use ssl; then
148 + use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store )
149 + else
150 + myconf+=( --without-ssl )
151 + fi
152 +
153 + local myarch=""
154 + case ${ABI} in
155 + amd64) myarch="x64";;
156 + arm) myarch="arm";;
157 + arm64) myarch="arm64";;
158 + ppc64) myarch="ppc64";;
159 + x32) myarch="x32";;
160 + x86) myarch="ia32";;
161 + *) myarch="${ABI}";;
162 + esac
163 +
164 + GYP_DEFINES="linux_use_gold_flags=0
165 + linux_use_bundled_binutils=0
166 + linux_use_bundled_gold=0" \
167 + "${EPYTHON}" configure.py \
168 + --prefix="${EPREFIX}"/usr \
169 + --dest-cpu=${myarch} \
170 + $(use_with systemtap dtrace) \
171 + "${myconf[@]}" || die
172 +}
173 +
174 +src_compile() {
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 + "${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
239 +}