Gentoo Archives: gentoo-commits

From: Stefan Strogin <steils@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/libressl:master commit in: net-libs/nodejs/
Date: Tue, 27 Aug 2019 17:14:46
Message-Id: 1566925803.dbf153509a16a1813d21668fbeb27b25974ead73.steils@gentoo
1 commit: dbf153509a16a1813d21668fbeb27b25974ead73
2 Author: Dennis Gaebler <dennis.gaebler <AT> uni-ulm <DOT> de>
3 AuthorDate: Wed Aug 21 19:54:40 2019 +0000
4 Commit: Stefan Strogin <steils <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 27 17:10:03 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=dbf15350
7
8 net-libs/nodejs: bump to 12.9.0
9
10 Reported-by: Dennis Gaebler <dennis.gaebler <AT> uni-ulm.de>
11 Closes: https://github.com/gentoo/libressl/pull/302
12 Signed-off-by: Stefan Strogin <steils <AT> gentoo.org>
13
14 net-libs/nodejs/Manifest | 1 +
15 net-libs/nodejs/nodejs-12.9.0.ebuild | 210 +++++++++++++++++++++++++++++++++++
16 2 files changed, 211 insertions(+)
17
18 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
19 index 44cd29a..9b6b4ac 100644
20 --- a/net-libs/nodejs/Manifest
21 +++ b/net-libs/nodejs/Manifest
22 @@ -1,6 +1,7 @@
23 DIST node-v10.15.3.tar.xz 20262632 BLAKE2B d65d4e274fa829be5cda1970b0ebe7081e8476334cb825e5727324c3202bc015f4ba39589608284d0f8c0b722079c06d1587de5299a3c81ccb7b0eacbdaccf84 SHA512 cf741f733af7a7e1fbd37b0f98110078494b4771dbdfccacfda95a5ea4cda6cdcea4f8d31dddcf27477213614e4ab6cf7d1a1f900cb92936333730737ac4f9e8
24 DIST node-v11.14.0.tar.xz 22106812 BLAKE2B 3a8dd9feb5916f235bf69d0610e32c1861e64f427b6de5ec27b3634268f273826f271cf5ea821042420d3b3f348124be2ce2fda13d0addea092db1338c9f95f7 SHA512 4e8033ea0f326fe5a8372c81771cd58242881ac7db905f697ce79ef9cb3ba2dfe2b94fb24a36775761c72ac531096c5e18a8574f933d76c1b652b18419b25446
25 DIST node-v12.8.1.tar.xz 22641228 BLAKE2B 8eba5a3f99a30c2a91d737da91ec963b4dc505f167afb73e7161292bb97ae15b87b14577629c07131048dd9a1e311468185967910ac6bee489ee354e7a3f23a2 SHA512 eddaa9a53de802b3f0e2ffb121feae914fc3aed15271d1568332dc63db328f4bbf9c0700dbd7b5e2ffc6462f2bffe53dd4c65615bd289d1c8badaeb4f5fc580c
26 +DIST node-v12.9.0.tar.xz 22724192 BLAKE2B 6d71db0013650372ca10ff66bc34593b91d93169f90351bedd1044fab248047d3dbc6cb40e2026fd9dd460e4f6f95a4b24d234899e6ea3665489745100550ef8 SHA512 d6de30d0e38719dd2997e5312a81d86757d46de01f3214b04c3ee28a643c945fdc27d2179d06ceb7bc12cdafcefd1edee5da2618463ee214bee8e57bdacd0a8b
27 DIST node-v6.11.5.tar.xz 15699404 BLAKE2B ba2df91bf5ef38cedb60b42919cf56f16807e619a81876fc92a5741e49da7ec91c4239d00f549c5e80d0bb8282bb9b396dd984507916cd18d61b403a3a7cef94 SHA512 62490725ef7957294c1bddf21ef0626c7472876791210168116501255ecee58457e9de9b044e10033706243299bbfd1495efeca169596fbf26f5eeba6d8fa4c9
28 DIST node-v8.12.0.tar.xz 18310452 BLAKE2B 79634fc57cd76a97e72bab4be37da91d5eff4d13cdaa2b48e83f013885fa3590ba4a28378baf036ed26b7304bf234753d1d4014f72571496f5bb6cd5b221e5f0 SHA512 665d2dba287d78bcd723d7b4d00a6897fb996f4aa69a541e010a3dfeb2614257892117fcce7123966b1ecaddc9269a6667e0e262df693baea1f476c96de55c42
29 DIST node-v8.16.1.tar.xz 18519480 BLAKE2B a721ea5118e6e97ce36245367d33fb2eab8a9b4fba72f59f1a65dfc79de394a235a579fa789e8676d2897a928444db11e7792e7fe49c59bf17ac4cc1cac63941 SHA512 7d2d7c063934227e5204b2912de45ed1667d5c35573322192393bdac623491559ccd9fa8fbf05828bd2bb8e3aeb03d82804775cccb1139b48298758defe92be3
30
31 diff --git a/net-libs/nodejs/nodejs-12.9.0.ebuild b/net-libs/nodejs/nodejs-12.9.0.ebuild
32 new file mode 100644
33 index 0000000..f92f9d0
34 --- /dev/null
35 +++ b/net-libs/nodejs/nodejs-12.9.0.ebuild
36 @@ -0,0 +1,210 @@
37 +# Copyright 1999-2019 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=7
41 +PYTHON_COMPAT=( python2_7 )
42 +PYTHON_REQ_USE="threads"
43 +inherit bash-completion-r1 flag-o-matic pax-utils python-any-r1 toolchain-funcs
44 +
45 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
46 +HOMEPAGE="https://nodejs.org/"
47 +SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
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="bundled-ssl cpu_flags_x86_sse2 debug doc icu inspector libressl +npm +snapshot +ssl systemtap test"
53 +REQUIRED_USE="
54 + bundled-ssl? ( ssl )
55 + inspector? ( icu ssl )
56 + libressl? ( bundled-ssl )
57 + npm? ( ssl )
58 +"
59 +
60 +RDEPEND="
61 + >=dev-libs/libuv-1.31.0:=
62 + >=net-dns/c-ares-1.15.0
63 + >=net-libs/http-parser-2.8.0:=
64 + >=net-libs/nghttp2-1.39.2
65 + sys-libs/zlib
66 + icu? ( >=dev-libs/icu-64.2:= )
67 + ssl? (
68 + !bundled-ssl? ( >=dev-libs/openssl-1.1.1:0= )
69 + )
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}-99999999-llhttp.patch
80 +)
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 + # make sure we use python2.* while using gyp
101 + sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
102 +
103 + # less verbose install output (stating the same as portage, basically)
104 + sed -i -e "/print/d" tools/install.py || die
105 +
106 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
107 + local LIBDIR=$(get_libdir)
108 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
109 + sed -i -e "s/'lib'/'${LIBDIR}'/" deps/npm/lib/npm.js || die
110 +
111 + # Avoid writing a depfile, not useful
112 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
113 +
114 + sed -i -e "/'-O3'/d" common.gypi node.gypi || die
115 +
116 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
117 + # seem sandbox related either (invoking it from a sandbox works fine).
118 + # The issue is that no stdin handle is openened when asked for one.
119 + # It doesn't really belong upstream , so it'll just be removed until someone
120 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
121 + rm test/parallel/test-stdout-close-unref.js || die
122 +
123 + # debug builds. change install path, remove optimisations and override buildtype
124 + if use debug; then
125 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
126 + BUILDTYPE=Debug
127 + fi
128 +
129 + default
130 +}
131 +
132 +src_configure() {
133 + local myconf=(
134 + --shared-cares --shared-http-parser --shared-libuv --shared-nghttp2
135 + --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+=( --with-snapshot )
142 + use ssl && ( use bundled-ssl || myconf+=( --shared-openssl --openssl-use-def-ca-store ) ) || myconf+=( --without-ssl )
143 +
144 + local myarch=""
145 + case ${ABI} in
146 + amd64) myarch="x64";;
147 + arm) myarch="arm";;
148 + arm64) myarch="arm64";;
149 + ppc64) myarch="ppc64";;
150 + x32) myarch="x32";;
151 + x86) myarch="ia32";;
152 + *) myarch="${ABI}";;
153 + esac
154 +
155 + GYP_DEFINES="linux_use_gold_flags=0
156 + linux_use_bundled_binutils=0
157 + linux_use_bundled_gold=0" \
158 + "${PYTHON}" configure \
159 + --prefix="${EPREFIX}"/usr \
160 + --dest-cpu=${myarch} \
161 + $(use_with systemtap dtrace) \
162 + "${myconf[@]}" || die
163 +}
164 +
165 +src_compile() {
166 + emake -C out mksnapshot
167 + pax-mark m "out/${BUILDTYPE}/mksnapshot"
168 + emake -C out
169 +}
170 +
171 +src_install() {
172 + local LIBDIR="${ED}/usr/$(get_libdir)"
173 + default
174 +
175 + pax-mark -m "${ED}"/usr/bin/node
176 +
177 + # set up a symlink structure that node-gyp expects..
178 + dodir /usr/include/node/deps/{v8,uv}
179 + dosym . /usr/include/node/src
180 + for var in deps/{uv,v8}/include; do
181 + dosym ../.. /usr/include/node/${var}
182 + done
183 +
184 + if use doc; then
185 + # Patch docs to make them offline readable
186 + for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do
187 + sed -i '/fonts.googleapis.com/ d' $i;
188 + done
189 + # Install docs
190 + docinto html
191 + dodoc -r "${S}"/doc/*
192 + fi
193 +
194 + if use npm; then
195 + dodir /etc/npm
196 +
197 + # Install bash completion for `npm`
198 + # We need to temporarily replace default config path since
199 + # npm otherwise tries to write outside of the sandbox
200 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
201 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
202 + local tmp_npm_completion_file="$(emktemp)"
203 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
204 + newbashcomp "${tmp_npm_completion_file}" npm
205 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
206 +
207 + # Move man pages
208 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
209 +
210 + # Clean up
211 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
212 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
213 +
214 + local find_exp="-or -name"
215 + local find_name=()
216 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
217 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
218 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
219 + find_name+=( ${find_exp} "${match}" )
220 + done
221 +
222 + # Remove various development and/or inappropriate files and
223 + # useless docs of dependend packages.
224 + find "${LIBDIR}"/node_modules \
225 + \( -type d -name examples \) -or \( -type f \( \
226 + -iname "LICEN?E*" \
227 + "${find_name[@]}" \
228 + \) \) -exec rm -rf "{}" \;
229 + fi
230 +
231 + mv "${ED}"/usr/share/doc/node "${ED}"/usr/share/doc/${PF} || die
232 +}
233 +
234 +src_test() {
235 + out/${BUILDTYPE}/cctest || die
236 + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
237 +}
238 +
239 +pkg_postinst() {
240 + elog "The global npm config lives in /etc/npm. This deviates slightly"
241 + elog "from upstream which otherwise would have it live in /usr/etc/."
242 + elog ""
243 + elog "Protip: When using node-gyp to install native modules, you can"
244 + elog "avoid having to download extras by doing the following:"
245 + elog "$ node-gyp --nodedir /usr/include/node <command>"
246 +}