Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/nodejs/
Date: Sun, 18 Nov 2018 01:18:22
Message-Id: 1542503873.ace30693ef47ed6217f4222c874aad5da789ec00.whissi@gentoo
1 commit: ace30693ef47ed6217f4222c874aad5da789ec00
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 18 00:17:22 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 18 01:17:53 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ace30693
7
8 net-libs/nodejs: bump to v11.2.0
9
10 Package-Manager: Portage-2.3.51, Repoman-2.3.12
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 net-libs/nodejs/Manifest | 1 +
14 net-libs/nodejs/nodejs-11.2.0.ebuild | 204 +++++++++++++++++++++++++++++++++++
15 2 files changed, 205 insertions(+)
16
17 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
18 index cd7a195a9bc..0a17b5861bd 100644
19 --- a/net-libs/nodejs/Manifest
20 +++ b/net-libs/nodejs/Manifest
21 @@ -6,6 +6,7 @@ DIST node-v10.13.0.tar.xz 20184740 BLAKE2B 4c063889341eb2aa128096466cfdc2c91631a
22 DIST node-v10.9.0.tar.xz 19987812 BLAKE2B 4a5bd257cd527500b691b15d177bde53158b5e46e710ffeaa45224bae821cfaffdf59f24ad6bdc822cf468b90c1a4422a2f82d29e1d4b2dc0f838e3e0ab5b4ac SHA512 19c7366b4c9d1e255b5ac56e974ff86b9ca87c363534b467ecc3c59e170b891e86c479a2bcda6647c6df686b018caaedea84270e848b93a4f1c80ff04af12461
23 DIST node-v11.0.0.tar.xz 20142548 BLAKE2B 97fc14392c449abde0c2b4ef27f020ac215747a5cca327b07ed735dd9867a01f1a64bfa19a62758111b0fbdca92b5536c15d7946bf968b5c3eab9c0b55f7dd26 SHA512 232243f37a8344775b2e0302601ec23310a8915e0913dc0cb0133df75cb7aad315ca0a6d039f8f9e6ae0d9f98aa8049532d80d470cf9ea0e309f8183be870000
24 DIST node-v11.1.0.tar.xz 20207100 BLAKE2B 7ee0912f2fe99ccd2136c6719833b54af59099a2093a8698ebad7a55d4adfc26265e1637b1933e873552c9dbb50387d14c22f6e6785e9b02e866dcca9211c4fb SHA512 faea85516db2063f32ec9c6762ede0e29c8094ea4a52e030d6842df1f42b132d86515e01602510a717c42a69a2684e3758a9f08a4236dd8dd4e0171d71db3380
25 +DIST node-v11.2.0.tar.xz 20332812 BLAKE2B 2bb8cd409dc5328faa1404a36bff5c6bf554de397ce1d010886ee5fd7b15d148abb758d54c48e3f7db46e117f2e5cfe2cf8ff4565a551f1424725c75b40d4bf9 SHA512 6251706437c0344bd4994619b7fe09c36a15e99e707d36b3a3746b7b379a03a9a4758a4fc6fdc0214fbd107eef4ec39bd8b75d88ccab207d97cbf21852eb81b2
26 DIST node-v4.8.7.tar.xz 13370828 BLAKE2B b1ee93a586b66f8582783b1be50667547afe4bf48038ebc0b8148db55542cbc0520ac84ef88e4a7f453cabc245f484c32dbc238c1932bbc708791ceeb5c9d2ab SHA512 25837a31023747723b146c45984a5b2096b61c0aa43cbf45fc8ff50b4bd5079bd0bc9f1dfd3fb076817448dc5537eb93ffb2f345280b7756ba93b67ad757c696
27 DIST node-v4.9.1.tar.xz 13250164 BLAKE2B 7a689b99bb4bf507f7f21dd2c096a5766d023a8174c0f468cab37365af1920b8700da04157e1a406917790524255ef32c243a74662fd50ef7d3567d189dac9cf SHA512 690c9fdf608e5194069a10955bdd94ec87cb1c308f13bc4d2cae92fa01436ace10fadf58f2e51d477dde6c570b23edc1c71fafea79bfc9cab2903eb2fa5f87aa
28 DIST node-v6.11.5.tar.xz 15699404 BLAKE2B ba2df91bf5ef38cedb60b42919cf56f16807e619a81876fc92a5741e49da7ec91c4239d00f549c5e80d0bb8282bb9b396dd984507916cd18d61b403a3a7cef94 SHA512 62490725ef7957294c1bddf21ef0626c7472876791210168116501255ecee58457e9de9b044e10033706243299bbfd1495efeca169596fbf26f5eeba6d8fa4c9
29
30 diff --git a/net-libs/nodejs/nodejs-11.2.0.ebuild b/net-libs/nodejs/nodejs-11.2.0.ebuild
31 new file mode 100644
32 index 00000000000..4bbb68a8177
33 --- /dev/null
34 +++ b/net-libs/nodejs/nodejs-11.2.0.ebuild
35 @@ -0,0 +1,204 @@
36 +# Copyright 1999-2018 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +
41 +PYTHON_COMPAT=( python2_7 )
42 +PYTHON_REQ_USE="threads"
43 +
44 +inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs
45 +
46 +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine"
47 +HOMEPAGE="https://nodejs.org/"
48 +SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz"
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 +snapshot +ssl systemtap test"
54 +REQUIRED_USE="
55 + ${PYTHON_REQUIRED_USE}
56 + inspector? ( icu ssl )
57 + npm? ( ssl )
58 +"
59 +
60 +RDEPEND="
61 + >=dev-libs/libuv-1.23.2:=
62 + >=net-libs/http-parser-2.8.0:=
63 + >=net-libs/nghttp2-1.34.0
64 + sys-libs/zlib
65 + icu? ( >=dev-libs/icu-63.1:= )
66 + ssl? ( =dev-libs/openssl-1.1.0*:0=[-bindist] )
67 +"
68 +DEPEND="
69 + ${RDEPEND}
70 + ${PYTHON_DEPS}
71 + systemtap? ( dev-util/systemtap )
72 + test? ( net-misc/curl )
73 +"
74 +S="${WORKDIR}/node-v${PV}"
75 +PATCHES=(
76 + "${FILESDIR}"/${PN}-10.3.0-global-npm-config.patch
77 +)
78 +
79 +pkg_pretend() {
80 + (use x86 && ! use cpu_flags_x86_sse2) && \
81 + die "Your CPU doesn't support the required SSE2 instruction."
82 +
83 + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \
84 + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
85 +}
86 +
87 +src_prepare() {
88 + tc-export CC CXX PKG_CONFIG
89 + export V=1
90 + export BUILDTYPE=Release
91 +
92 + # fix compilation on Darwin
93 + # https://code.google.com/p/gyp/issues/detail?id=260
94 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
95 +
96 + # make sure we use python2.* while using gyp
97 + sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
98 + sed -i -e "s/|| 'python2'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || 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 deps/v8/gypfiles/toolchain.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 + default
127 +}
128 +
129 +src_configure() {
130 + local myconf=( --shared-http-parser --shared-libuv --shared-nghttp2 --shared-zlib )
131 + use debug && myconf+=( --debug )
132 + use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none )
133 + use inspector || myconf+=( --without-inspector )
134 + use npm || myconf+=( --without-npm )
135 + use snapshot && myconf+=( --with-snapshot )
136 + use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl )
137 +
138 + local myarch=""
139 + case ${ABI} in
140 + amd64) myarch="x64";;
141 + arm) myarch="arm";;
142 + arm64) myarch="arm64";;
143 + ppc64) myarch="ppc64";;
144 + x32) myarch="x32";;
145 + x86) myarch="ia32";;
146 + *) myarch="${ABI}";;
147 + esac
148 +
149 + GYP_DEFINES="linux_use_gold_flags=0
150 + linux_use_bundled_binutils=0
151 + linux_use_bundled_gold=0" \
152 + "${PYTHON}" configure \
153 + --prefix="${EPREFIX}"/usr \
154 + --dest-cpu=${myarch} \
155 + $(use_with systemtap dtrace) \
156 + "${myconf[@]}" || die
157 +}
158 +
159 +src_compile() {
160 + emake -C out mksnapshot
161 + pax-mark m "out/${BUILDTYPE}/mksnapshot"
162 + emake -C out
163 +}
164 +
165 +src_install() {
166 + local LIBDIR="${ED}/usr/$(get_libdir)"
167 + emake install DESTDIR="${D}"
168 + pax-mark -m "${ED}"usr/bin/node
169 +
170 + # set up a symlink structure that node-gyp expects..
171 + dodir /usr/include/node/deps/{v8,uv}
172 + dosym . /usr/include/node/src
173 + for var in deps/{uv,v8}/include; do
174 + dosym ../.. /usr/include/node/${var}
175 + done
176 +
177 + if use doc; then
178 + # Patch docs to make them offline readable
179 + for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do
180 + sed -i '/fonts.googleapis.com/ d' $i;
181 + done
182 + # Install docs
183 + docinto html
184 + dodoc -r "${S}"/doc/*
185 + fi
186 +
187 + if use npm; then
188 + dodir /etc/npm
189 +
190 + # Install bash completion for `npm`
191 + # We need to temporarily replace default config path since
192 + # npm otherwise tries to write outside of the sandbox
193 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
194 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
195 + local tmp_npm_completion_file="$(emktemp)"
196 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
197 + newbashcomp "${tmp_npm_completion_file}" npm
198 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
199 +
200 + # Move man pages
201 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
202 +
203 + # Clean up
204 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
205 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
206 +
207 + local find_exp="-or -name"
208 + local find_name=()
209 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
210 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
211 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
212 + find_name+=( ${find_exp} "${match}" )
213 + done
214 +
215 + # Remove various development and/or inappropriate files and
216 + # useless docs of dependend packages.
217 + find "${LIBDIR}"/node_modules \
218 + \( -type d -name examples \) -or \( -type f \( \
219 + -iname "LICEN?E*" \
220 + "${find_name[@]}" \
221 + \) \) -exec rm -rf "{}" \;
222 + fi
223 +
224 + mv "${D}"/usr/share/doc/node "${D}"/usr/share/doc/${PF} || die
225 +}
226 +
227 +src_test() {
228 + out/${BUILDTYPE}/cctest || die
229 + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
230 +}
231 +
232 +pkg_postinst() {
233 + einfo "The global npm config lives in /etc/npm. This deviates slightly"
234 + einfo "from upstream which otherwise would have it live in /usr/etc/."
235 + einfo ""
236 + einfo "Protip: When using node-gyp to install native modules, you can"
237 + einfo "avoid having to download extras by doing the following:"
238 + einfo "$ node-gyp --nodedir /usr/include/node <command>"
239 +}