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, 02 Jun 2020 21:30:37
Message-Id: 1591133416.e65f5af5552a2226f8a1e50f956aa921c5ecde96.jer@gentoo
1 commit: e65f5af5552a2226f8a1e50f956aa921c5ecde96
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 2 21:29:36 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 2 21:30:16 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e65f5af5
7
8 net-libs/nodejs: Version 14.4.0
9
10 Package-Manager: Portage-2.3.100, Repoman-2.3.22
11 Bug: https://bugs.gentoo.org/show_bug.cgi?id=726836
12 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
13
14 net-libs/nodejs/Manifest | 1 +
15 net-libs/nodejs/nodejs-14.4.0.ebuild | 200 +++++++++++++++++++++++++++++++++++
16 2 files changed, 201 insertions(+)
17
18 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
19 index 12eae07b4e2..8d981ed4a3d 100644
20 --- a/net-libs/nodejs/Manifest
21 +++ b/net-libs/nodejs/Manifest
22 @@ -6,4 +6,5 @@ DIST node-v12.16.3.tar.xz 23682432 BLAKE2B 91b97c0de9c76f33d080f3f12a42a15140be6
23 DIST node-v12.17.0.tar.xz 23702040 BLAKE2B 4b35c6f7a3c16a7b737bc5b71f075fe6c66c9c4a5cd3ee240a0c1af9cfd4e10c61520d0489169a74354734083b7f7c68b97eefaa6f40e3320ec5b0126d36169f SHA512 0fc8483c6ae8994ff4f4b2465f1b8b1d3c620c90222fb270fe3d317d967294cc9e6bdcc50277fbe0ab28cb3ce9e73ec122c19adf8a686ecc95de3268b82ca4f7
24 DIST node-v14.2.0.tar.xz 32884616 BLAKE2B 7bcb07cb7623c5e08c20267c320cdf23ad110f124c5ad1f2447ef8b76ab8dc44ed50dab7c5651424d9d3a36f7eeecdf3292b07c02cb2e22c3fbe4ed633c4b842 SHA512 47e5ec0b7a207082d43419a7e0a6ea9242ec43b4d7c2217eb66d0b45e2f4d5cb561b3f6fe35fdc41a8be95c182dc122ba262f696ebd12833596d71b372ec85d2
25 DIST node-v14.3.0.tar.xz 32985344 BLAKE2B 32ee357e109484422c3b22423ab9a593cd5d4611073c820f90c196dae4df2860573cdd06170879f675b738b01885eb2fe0f25c2328841838bf9367324cc981a7 SHA512 3afcc430bad57150baa8d1c0e5ef0f64691ef6549a052be654a86313fe28f31e7fdfeea4d2b3993798a7141bc6d7b1642747d1bc2636139e2f2fd79441580148
26 +DIST node-v14.4.0.tar.xz 33005312 BLAKE2B bc1462d897e24a6b842e6f8146971866c73b54ff5383d76cfc5728a73e2c135d28ced068744174b3fb5af4a6ec05ef1f115ea51c2d65517cbe18e1d733460d04 SHA512 f1a7c788a8a149b942ec2b90a4314baaa5355c381029eda45002728ce7209925c016323b0ec1e0dfe2359fddb24f494df125805d0d266b738a333dcddb3f59c3
27 DIST node-v8.12.0.tar.xz 18310452 BLAKE2B 79634fc57cd76a97e72bab4be37da91d5eff4d13cdaa2b48e83f013885fa3590ba4a28378baf036ed26b7304bf234753d1d4014f72571496f5bb6cd5b221e5f0 SHA512 665d2dba287d78bcd723d7b4d00a6897fb996f4aa69a541e010a3dfeb2614257892117fcce7123966b1ecaddc9269a6667e0e262df693baea1f476c96de55c42
28
29 diff --git a/net-libs/nodejs/nodejs-14.4.0.ebuild b/net-libs/nodejs/nodejs-14.4.0.ebuild
30 new file mode 100644
31 index 00000000000..1d198e35d08
32 --- /dev/null
33 +++ b/net-libs/nodejs/nodejs-14.4.0.ebuild
34 @@ -0,0 +1,200 @@
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 + >=dev-libs/libuv-1.37.0:=
61 + >=net-dns/c-ares-1.16.0
62 + >=net-libs/nghttp2-1.41.0
63 + sys-libs/zlib
64 + icu? ( >=dev-libs/icu-65:= )
65 + system-ssl? ( >=dev-libs/openssl-1.1.1:0= )
66 +"
67 +BDEPEND="
68 + ${PYTHON_DEPS}
69 + systemtap? ( dev-util/systemtap )
70 + test? ( net-misc/curl )
71 + pax_kernel? ( sys-apps/elfix )
72 +"
73 +DEPEND="
74 + ${RDEPEND}
75 +"
76 +PATCHES=(
77 + "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
78 +)
79 +RESTRICT="test"
80 +S="${WORKDIR}/node-v${PV}"
81 +
82 +pkg_pretend() {
83 + (use x86 && ! use cpu_flags_x86_sse2) && \
84 + die "Your CPU doesn't support the required SSE2 instruction."
85 +
86 + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \
87 + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
88 +}
89 +
90 +src_prepare() {
91 + tc-export CC CXX PKG_CONFIG
92 + export V=1
93 + export BUILDTYPE=Release
94 +
95 + # fix compilation on Darwin
96 + # https://code.google.com/p/gyp/issues/detail?id=260
97 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
98 +
99 + # less verbose install output (stating the same as portage, basically)
100 + sed -i -e "/print/d" tools/install.py || die
101 +
102 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
103 + local LIBDIR=$(get_libdir)
104 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
105 + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
106 +
107 + # Avoid writing a depfile, not useful
108 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
109 +
110 + sed -i -e "/'-O3'/d" common.gypi node.gypi || die
111 +
112 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
113 + # seem sandbox related either (invoking it from a sandbox works fine).
114 + # The issue is that no stdin handle is openened when asked for one.
115 + # It doesn't really belong upstream , so it'll just be removed until someone
116 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
117 + rm test/parallel/test-stdout-close-unref.js || die
118 +
119 + # debug builds. change install path, remove optimisations and override buildtype
120 + if use debug; then
121 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
122 + BUILDTYPE=Debug
123 + fi
124 +
125 + # We need to disable mprotect on two files when it builds Bug 694100.
126 + use pax_kernel && PATCHES+=( "${FILESDIR}"/${PN}-13.8.0-paxmarking.patch )
127 +
128 + default
129 +}
130 +
131 +src_configure() {
132 + xdg_environment_reset
133 +
134 + local myconf=(
135 + --shared-cares --shared-libuv --shared-nghttp2 --shared-zlib
136 + )
137 + use debug && myconf+=( --debug )
138 + use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none )
139 + use inspector || myconf+=( --without-inspector )
140 + use npm || myconf+=( --without-npm )
141 + use snapshot || myconf+=( --without-node-snapshot )
142 + if use ssl; then
143 + use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store )
144 + else
145 + myconf+=( --without-ssl )
146 + fi
147 +
148 + local myarch=""
149 + case ${ABI} in
150 + amd64) myarch="x64";;
151 + arm) myarch="arm";;
152 + arm64) myarch="arm64";;
153 + ppc64) myarch="ppc64";;
154 + x32) myarch="x32";;
155 + x86) myarch="ia32";;
156 + *) myarch="${ABI}";;
157 + esac
158 +
159 + GYP_DEFINES="linux_use_gold_flags=0
160 + linux_use_bundled_binutils=0
161 + linux_use_bundled_gold=0" \
162 + "${EPYTHON}" configure.py \
163 + --prefix="${EPREFIX}"/usr \
164 + --dest-cpu=${myarch} \
165 + $(use_with systemtap dtrace) \
166 + "${myconf[@]}" || die
167 +}
168 +
169 +src_compile() {
170 + emake -C out
171 +}
172 +
173 +src_install() {
174 + local LIBDIR="${ED}/usr/$(get_libdir)"
175 + default
176 +
177 + pax-mark -m "${ED}"/usr/bin/node
178 +
179 + # set up a symlink structure that node-gyp expects..
180 + dodir /usr/include/node/deps/{v8,uv}
181 + dosym . /usr/include/node/src
182 + for var in deps/{uv,v8}/include; do
183 + dosym ../.. /usr/include/node/${var}
184 + done
185 +
186 + if use doc; then
187 + docinto html
188 + dodoc -r "${S}"/doc/*
189 + fi
190 +
191 + if use npm; then
192 + dodir /etc/npm
193 +
194 + # Install bash completion for `npm`
195 + # We need to temporarily replace default config path since
196 + # npm otherwise tries to write outside of the sandbox
197 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
198 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
199 + local tmp_npm_completion_file="$(emktemp)"
200 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
201 + newbashcomp "${tmp_npm_completion_file}" npm
202 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
203 +
204 + # Move man pages
205 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
206 +
207 + # Clean up
208 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
209 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
210 +
211 + local find_exp="-or -name"
212 + local find_name=()
213 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
214 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
215 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
216 + find_name+=( ${find_exp} "${match}" )
217 + done
218 +
219 + # Remove various development and/or inappropriate files and
220 + # useless docs of dependend packages.
221 + find "${LIBDIR}"/node_modules \
222 + \( -type d -name examples \) -or \( -type f \( \
223 + -iname "LICEN?E*" \
224 + "${find_name[@]}" \
225 + \) \) -exec rm -rf "{}" \;
226 + fi
227 +
228 + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
229 +}
230 +
231 +src_test() {
232 + out/${BUILDTYPE}/cctest || die
233 + "${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
234 +}