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, 10 Mar 2020 08:23:07
Message-Id: 1583828550.f8aaf90accd6ba5a24e35862d6063b6e4d7f7f42.jer@gentoo
1 commit: f8aaf90accd6ba5a24e35862d6063b6e4d7f7f42
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Thu Mar 5 07:50:23 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 10 08:22:30 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f8aaf90a
7
8 net-libs/nodejs: Version 13.10.1
9
10 Package-Manager: Portage-2.3.92, Repoman-2.3.20
11 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
12
13 net-libs/nodejs/Manifest | 1 +
14 net-libs/nodejs/nodejs-13.10.1.ebuild | 209 ++++++++++++++++++++++++++++++++++
15 2 files changed, 210 insertions(+)
16
17 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
18 index b508171a8fb..9bc30c56b60 100644
19 --- a/net-libs/nodejs/Manifest
20 +++ b/net-libs/nodejs/Manifest
21 @@ -3,6 +3,7 @@ DIST node-v10.19.0.tar.xz 21906168 BLAKE2B 395504ef3befa47d8b967114e019e6a76c799
22 DIST node-v12.14.0.tar.xz 23244684 BLAKE2B 0e25cbba5e256b139efd45908236f008834afdf01f57a8e84c7e55ba950e56b786cd52eba9a02986eb0e1d38cbf6df38e1cd719d7dcd8085e8c71767adf8155e SHA512 12e887709a54be911c5a81ab7b7be995247b47ebbd2954ca942f9ed8a784ae1a8e4bdb2613e5bb671196f9101d8861cd29e10650a3f0c414db4d096df94b309b
23 DIST node-v12.16.0.tar.xz 23487084 BLAKE2B 067668ca5af6c35082c3075b4baca256ce656ccf0ac68782a4885bbd2e0ef13108bd72b8b9831ef32f075e4be99fc52b1ce35920cd0db6f10a562a84912cdbd0 SHA512 e0aa45498ffd670052853bae1edfda1a34b291c48232f8a0a58ac329215fb3d0250211ec6dc06fa50fc654e7080028eaf3cc00a3722971a5969054c4cf277f4e
24 DIST node-v12.16.1.tar.xz 23481768 BLAKE2B 29371b952c14907778c064269108f1da5e3818c32773e73090c61edcd07190c418189db6a505987ca71f99bb868880e297de5d2181b9a880774eaaf515985f26 SHA512 fe1e9fabb6fe52e3bc4275b33e6c5e4a761550b04964c0ae7dbef7172f5d415207bb2985751d068e357ce45a0ba414b07c0abd1531ef839b9463e98eeae8f9a4
25 +DIST node-v13.10.1.tar.xz 32812128 BLAKE2B 2dc0e1de269a898f57e9fb91d5b3161d43baa89c8617faffa9998b3244354619a5b78e39500bf02b90fbc2587b8477fbd86850141ec7665690040d6920c50fef SHA512 30b7b58c87021be3e0b909bae476c6191eb72722ed00e51716d7eb0793aeb29c05b088c195ffd69a40dd42423ceba20350f6379c11d276eb3398abfc4cdf340c
26 DIST node-v13.8.0.tar.xz 32745596 BLAKE2B 14bf82e8cecde1a4125c7c00c4c9e613c1dbc5bb0241b20f4d30cb8d172612d5a8c362ac786ae516baf9553d5a9c3053414b269fb040cebb664f09096a57985c SHA512 b50d79f029bc04caf193f137b7b3d03f1e1ec9252712015cab2efdeef92bc3176cf7eb36e835cda6221950792e516f9c1894cd2c480e082106e07a11aa1d0761
27 DIST node-v13.9.0.tar.xz 32778780 BLAKE2B fb5a0ff82cc1fd255bcc96b50232d6a9e2e3cdab9f5080c6d112b0a5b2dbb952a70d648ccda1b242a7c9e5742683bd320924047bccd1402978d8bbcfa8d1bb68 SHA512 f52184b694bf0dc7755c1c0f05eac400d7e9971e66165a43c7784dfeb935e63de176d3ee937fb09ccb1fc9ac78aec30b6b17e8a477f1b3f10291b1b6d595207c
28 DIST node-v8.12.0.tar.xz 18310452 BLAKE2B 79634fc57cd76a97e72bab4be37da91d5eff4d13cdaa2b48e83f013885fa3590ba4a28378baf036ed26b7304bf234753d1d4014f72571496f5bb6cd5b221e5f0 SHA512 665d2dba287d78bcd723d7b4d00a6897fb996f4aa69a541e010a3dfeb2614257892117fcce7123966b1ecaddc9269a6667e0e262df693baea1f476c96de55c42
29
30 diff --git a/net-libs/nodejs/nodejs-13.10.1.ebuild b/net-libs/nodejs/nodejs-13.10.1.ebuild
31 new file mode 100644
32 index 00000000000..00513e8978c
33 --- /dev/null
34 +++ b/net-libs/nodejs/nodejs-13.10.1.ebuild
35 @@ -0,0 +1,209 @@
36 +# Copyright 1999-2020 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=7
40 +PYTHON_COMPAT=( python3_{6,7} )
41 +PYTHON_REQ_USE="threads(+)"
42 +inherit bash-completion-r1 eutils flag-o-matic pax-utils python-any-r1 toolchain-funcs xdg-utils
43 +
44 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
45 +HOMEPAGE="https://nodejs.org/"
46 +SRC_URI="
47 + https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz
48 +"
49 +
50 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
51 +SLOT="0"
52 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos"
53 +IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm pax_kernel +snapshot +ssl +system-ssl systemtap test"
54 +REQUIRED_USE="
55 + inspector? ( icu ssl )
56 + npm? ( ssl )
57 + system-ssl? ( ssl )
58 +"
59 +
60 +RDEPEND="
61 + >=dev-libs/libuv-1.34.2:=
62 + >=net-dns/c-ares-1.15.0
63 + >=net-libs/nghttp2-1.40.0
64 + sys-libs/zlib
65 + icu? ( >=dev-libs/icu-64.2:= )
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 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-cares --shared-libuv --shared-nghttp2 --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+=( --without-node-snapshot )
143 + if use ssl; then
144 + use system-ssl && myconf+=( --shared-openssl --openssl-use-def-ca-store )
145 + else
146 + myconf+=( --without-ssl )
147 + fi
148 +
149 + local myarch=""
150 + case ${ABI} in
151 + amd64) myarch="x64";;
152 + arm) myarch="arm";;
153 + arm64) myarch="arm64";;
154 + ppc64) myarch="ppc64";;
155 + x32) myarch="x32";;
156 + x86) myarch="ia32";;
157 + *) myarch="${ABI}";;
158 + esac
159 +
160 + GYP_DEFINES="linux_use_gold_flags=0
161 + linux_use_bundled_binutils=0
162 + linux_use_bundled_gold=0" \
163 + "${EPYTHON}" configure.py \
164 + --prefix="${EPREFIX}"/usr \
165 + --dest-cpu=${myarch} \
166 + $(use_with systemtap dtrace) \
167 + "${myconf[@]}" || die
168 +}
169 +
170 +src_compile() {
171 + emake -C out
172 +}
173 +
174 +src_install() {
175 + local LIBDIR="${ED}/usr/$(get_libdir)"
176 + default
177 +
178 + pax-mark -m "${ED}"/usr/bin/node
179 +
180 + # set up a symlink structure that node-gyp expects..
181 + dodir /usr/include/node/deps/{v8,uv}
182 + dosym . /usr/include/node/src
183 + for var in deps/{uv,v8}/include; do
184 + dosym ../.. /usr/include/node/${var}
185 + done
186 +
187 + if use doc; then
188 + docinto html
189 + dodoc -r "${S}"/doc/*
190 + fi
191 +
192 + if use npm; then
193 + dodir /etc/npm
194 +
195 + # Install bash completion for `npm`
196 + # We need to temporarily replace default config path since
197 + # npm otherwise tries to write outside of the sandbox
198 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
199 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
200 + local tmp_npm_completion_file="$(emktemp)"
201 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
202 + newbashcomp "${tmp_npm_completion_file}" npm
203 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
204 +
205 + # Move man pages
206 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
207 +
208 + # Clean up
209 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
210 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
211 +
212 + local find_exp="-or -name"
213 + local find_name=()
214 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
215 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
216 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
217 + find_name+=( ${find_exp} "${match}" )
218 + done
219 +
220 + # Remove various development and/or inappropriate files and
221 + # useless docs of dependend packages.
222 + find "${LIBDIR}"/node_modules \
223 + \( -type d -name examples \) -or \( -type f \( \
224 + -iname "LICEN?E*" \
225 + "${find_name[@]}" \
226 + \) \) -exec rm -rf "{}" \;
227 + fi
228 +
229 + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
230 +}
231 +
232 +src_test() {
233 + out/${BUILDTYPE}/cctest || die
234 + "${EPYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
235 +}
236 +
237 +pkg_postinst() {
238 + elog "The global npm config lives in /etc/npm. This deviates slightly"
239 + elog "from upstream which otherwise would have it live in /usr/etc/."
240 + elog ""
241 + elog "Protip: When using node-gyp to install native modules, you can"
242 + elog "avoid having to download extras by doing the following:"
243 + elog "$ node-gyp --nodedir /usr/include/node <command>"
244 +}