Gentoo Archives: gentoo-commits

From: Patrick Lauer <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/nodejs/
Date: Wed, 02 Aug 2017 12:56:15
Message-Id: 1501678510.113df05f8629fe955ce5253dbcc686c66cc161ea.patrick@gentoo
1 commit: 113df05f8629fe955ce5253dbcc686c66cc161ea
2 Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 2 12:55:10 2017 +0000
4 Commit: Patrick Lauer <patrick <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 2 12:55:10 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=113df05f
7
8 net-libs/nodejs: Bump
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.3
11
12 net-libs/nodejs/Manifest | 1 +
13 net-libs/nodejs/nodejs-6.11.2.ebuild | 193 +++++++++++++++++++++++++++++++++++
14 2 files changed, 194 insertions(+)
15
16 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
17 index 69c1dd050aa..9911e42715c 100644
18 --- a/net-libs/nodejs/Manifest
19 +++ b/net-libs/nodejs/Manifest
20 @@ -5,6 +5,7 @@ DIST node-v6.10.2.tar.xz 15764488 SHA256 80aa11333da99813973a99646e2113c6be5b63f
21 DIST node-v6.10.3.tar.xz 15772552 SHA256 82262a703e61164e09170a14d88b1726720651b0c7ee87a277654247b21b5388 SHA512 bc3350caf8bfe182296e53df2d68c552d06f68f86de2800d01ea17d5ae2582935b44a0fd6064e7a87fbbabdc1ba067c6baf994417690f7c64ebc135890306fc5 WHIRLPOOL c221a3ff4264ce45e5b66f21e1694f2d0ca15b23353c446ca8681a0a190f752a57c9c05fde73e4023d9418b22854243af53ddf8dc680d926cb4a0eec077976b5
22 DIST node-v6.11.0.tar.xz 15797124 SHA256 02ba35391edea2b294c736489af01954ce6e6c39d318f4423ae6617c69ef0a51 SHA512 2f57211b92eb0a9a4f8bc5c5b0239d3bbffae468028c524c3b44bee51cb3184a71d9d451a7098c09548886abb3b4a3754d948533250560885f67019f52044ca8 WHIRLPOOL b55d0b1199c956e47201a8369b087264488725676c78bb05577ce021678990182d101b8649fdfe2550fc0a04605ea12fea593032811e46453e6cebf8c9f05f25
23 DIST node-v6.11.1.tar.xz 15798184 SHA256 6f6655b85919aa54cb045a6d69a226849802fcc26491d0db4ce59873e41cc2b8 SHA512 b01f0fb73f6279578e21127f4a8d247f9e7adbe3693cb7f01efe1bd64701ea2d2e0ff94f9aa23709b563313ca6d6f83a5f60311c40a6e5c7cf5e47a45e9c21d3 WHIRLPOOL 45bc19a606576744c53e293300888a60987f6655734d26904a1b68457a02147ffe4bece431bb8fe9c42806d9db5f57f169ac89e54eff69b23f6ffaae0a78ba18
24 +DIST node-v6.11.2.tar.xz 15665456 SHA256 04af4992238b19124ea56f1bcfda36827613a24eb3b00fc3b50f261a415a26e4 SHA512 9ea203e402b5d57fb5d30cc4e9e59e9dac5303134d687888ee5e7e004388054086d82dd9097408bb3cfb25826dcefe720b75052542f8c88867de382efe91b3b8 WHIRLPOOL af8467f21b812fa2f6e723dbd7be2579257175cc7a826a1863044b69f8384a74bd9da2a7096cf29b6f1e7cfbb439ce179a66c45e063edd60f456dad0410aa42a
25 DIST node-v6.9.4.tar.xz 15519264 SHA256 c51d7c61db40455d57428abcadc7eb0f0a08a8878cb1d8ea3c1e211c54532c35 SHA512 86d3e2889031c2b50c021bd3fd63194c2c22c44291d51dff1b5e1652b01853c09d2880c2f58fdad062e3e2a3f637a3f0d78dac66b835b676790cf272e64f8dce WHIRLPOOL d1bcf488ed1aae7959303b988c9467fc5d0930166c7bfe0e441392763e19f788496971c07560a9f62586bbb2be7ce741ece8346140d665d29593b9b8f649b002
26 DIST node-v7.10.0.tar.xz 16751724 SHA256 dc34dd15524ba821ffcae7b245eabe8631e2614d5e3cb8ff08fbfdadf5919f21 SHA512 d9bb8b4e17c41a9726bba0e32f0cbcdec9cde920457242a7170c8f8fe37aed21d77a0340b7b9bbca2e60cfe5a41da65f0ce7dc295b0a7a823c9e863bd232171b WHIRLPOOL f7cd2a6a4aa6a5dc6c5f59be6897c13f4bdd1230e1324d97704ed32efcc65685d0d5b180e0f0018f9564bd4f4e6df43c0b90a289d5e5a92937e60a13d0281bf3
27 DIST node-v7.6.0.tar.xz 16635292 SHA256 6ff9042696fff0b49647f5864e71cb495e554e4f66e61443494210f5e16ab4a9 SHA512 17bf7353f19a6bba659b8f238b83333241e721363b22adb01aa9dce421dc47826e47edd0ed2f7eee0209146ef322b2ca9fe6fe2733140c3e79c1498bc7c9b166 WHIRLPOOL 803efc7de3d18cd86a6b45675b01da79c271a8c36792fb875c307e224f8575e6c47d35816c56136ecd15f05029febae46faa6b020188c96e14269f2075f878e3
28
29 diff --git a/net-libs/nodejs/nodejs-6.11.2.ebuild b/net-libs/nodejs/nodejs-6.11.2.ebuild
30 new file mode 100644
31 index 00000000000..67c45191733
32 --- /dev/null
33 +++ b/net-libs/nodejs/nodejs-6.11.2.ebuild
34 @@ -0,0 +1,193 @@
35 +# Copyright 1999-2017 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +RESTRICT="test"
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 +npm +snapshot +ssl test"
54 +
55 +RDEPEND="icu? ( >=dev-libs/icu-56:= )
56 + npm? ( ${PYTHON_DEPS} )
57 + >=net-libs/http-parser-2.6.2:=
58 + >=dev-libs/libuv-1.9.0:=
59 + >=dev-libs/openssl-1.0.2g:0=[-bindist]
60 + sys-libs/zlib"
61 +DEPEND="${RDEPEND}
62 + ${PYTHON_DEPS}
63 + test? ( net-misc/curl )"
64 +
65 +S="${WORKDIR}/node-v${PV}"
66 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
67 +
68 +PATCHES=(
69 + "${FILESDIR}"/gentoo-global-npm-config.patch
70 +)
71 +
72 +pkg_pretend() {
73 + (use x86 && ! use cpu_flags_x86_sse2) && \
74 + die "Your CPU doesn't support the required SSE2 instruction."
75 +
76 + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \
77 + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer."
78 +}
79 +
80 +src_prepare() {
81 + tc-export CC CXX PKG_CONFIG
82 + export V=1
83 + export BUILDTYPE=Release
84 +
85 + # fix compilation on Darwin
86 + # https://code.google.com/p/gyp/issues/detail?id=260
87 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
88 +
89 + # make sure we use python2.* while using gyp
90 + sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
91 + sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
92 +
93 + # less verbose install output (stating the same as portage, basically)
94 + sed -i -e "/print/d" tools/install.py || die
95 +
96 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
97 + local LIBDIR=$(get_libdir)
98 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
99 + sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die
100 + sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die
101 +
102 + # Avoid writing a depfile, not useful
103 + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die
104 +
105 + # Avoid a test that I've only been able to reproduce from emerge. It doesnt
106 + # seem sandbox related either (invoking it from a sandbox works fine).
107 + # The issue is that no stdin handle is openened when asked for one.
108 + # It doesn't really belong upstream , so it'll just be removed until someone
109 + # with more gentoo-knowledge than me (jbergstroem) figures it out.
110 + rm test/parallel/test-stdout-close-unref.js || die
111 +
112 + # debug builds. change install path, remove optimisations and override buildtype
113 + if use debug; then
114 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
115 + BUILDTYPE=Debug
116 + fi
117 +
118 + default
119 +}
120 +
121 +src_configure() {
122 + local myarch=""
123 + local myconf=( --shared-openssl --shared-libuv --shared-http-parser --shared-zlib )
124 + use npm || myconf+=( --without-npm )
125 + use icu && myconf+=( --with-intl=system-icu )
126 + use snapshot && myconf+=( --with-snapshot )
127 + use ssl || myconf+=( --without-ssl )
128 + use debug && myconf+=( --debug )
129 +
130 + case ${ABI} in
131 + amd64) myarch="x64";;
132 + arm) myarch="arm";;
133 + arm64) myarch="arm64";;
134 + ppc64) myarch="ppc64";;
135 + x32) myarch="x32";;
136 + x86) myarch="ia32";;
137 + *) myarch="${ABI}";;
138 + esac
139 +
140 + GYP_DEFINES="linux_use_gold_flags=0
141 + linux_use_bundled_binutils=0
142 + linux_use_bundled_gold=0" \
143 + "${PYTHON}" configure \
144 + --prefix="${EPREFIX}"/usr \
145 + --dest-cpu=${myarch} \
146 + --without-dtrace \
147 + "${myconf[@]}" || die
148 +}
149 +
150 +src_compile() {
151 + emake -C out mksnapshot
152 + pax-mark m "out/${BUILDTYPE}/mksnapshot"
153 + emake -C out
154 +}
155 +
156 +src_install() {
157 + local LIBDIR="${ED}/usr/$(get_libdir)"
158 + emake install DESTDIR="${D}"
159 + pax-mark -m "${ED}"usr/bin/node
160 +
161 + # set up a symlink structure that node-gyp expects..
162 + dodir /usr/include/node/deps/{v8,uv}
163 + dosym . /usr/include/node/src
164 + for var in deps/{uv,v8}/include; do
165 + dosym ../.. /usr/include/node/${var}
166 + done
167 +
168 + if use doc; then
169 + # Patch docs to make them offline readable
170 + for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do
171 + sed -i '/fonts.googleapis.com/ d' $i;
172 + done
173 + # Install docs!
174 + dohtml -r "${S}"/doc/*
175 + fi
176 +
177 + if use npm; then
178 + dodir /etc/npm
179 +
180 + # Install bash completion for `npm`
181 + # We need to temporarily replace default config path since
182 + # npm otherwise tries to write outside of the sandbox
183 + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js"
184 + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die
185 + local tmp_npm_completion_file="$(emktemp)"
186 + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}"
187 + newbashcomp "${tmp_npm_completion_file}" npm
188 + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die
189 +
190 + # Move man pages
191 + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/*
192 +
193 + # Clean up
194 + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die
195 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die
196 +
197 + local find_exp="-or -name"
198 + local find_name=()
199 + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \
200 + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \
201 + "*.md" "*.markdown" "*.bat" "*.cmd"; do
202 + find_name+=( ${find_exp} "${match}" )
203 + done
204 +
205 + # Remove various development and/or inappropriate files and
206 + # useless docs of dependend packages.
207 + find "${LIBDIR}"/node_modules \
208 + \( -type d -name examples \) -or \( -type f \( \
209 + -iname "LICEN?E*" \
210 + "${find_name[@]}" \
211 + \) \) -exec rm -rf "{}" \;
212 + fi
213 +}
214 +
215 +src_test() {
216 + out/${BUILDTYPE}/cctest || die
217 + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die
218 +}
219 +
220 +pkg_postinst() {
221 + einfo "The global npm config lives in /etc/npm. This deviates slightly"
222 + einfo "from upstream which otherwise would have it live in /usr/etc/."
223 + einfo ""
224 + einfo "Protip: When using node-gyp to install native modules, you can"
225 + einfo "avoid having to download extras by doing the following:"
226 + einfo "$ node-gyp --nodedir /usr/include/node <command>"
227 +}