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: Thu, 04 Jan 2018 12:31:04
Message-Id: 1515069053.59df7be6122b825f167bdfc7b761a0667348ba1b.jer@gentoo
1 commit: 59df7be6122b825f167bdfc7b761a0667348ba1b
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 4 12:27:00 2018 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 4 12:30:53 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59df7be6
7
8 net-libs/nodejs: Version 0.12.18.
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 net-libs/nodejs/Manifest | 1 +
13 net-libs/nodejs/nodejs-0.12.18.ebuild | 124 ++++++++++++++++++++++++++++++++++
14 2 files changed, 125 insertions(+)
15
16 diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
17 index 2a27ec2a9ba..e75e396b7cb 100644
18 --- a/net-libs/nodejs/Manifest
19 +++ b/net-libs/nodejs/Manifest
20 @@ -1,4 +1,5 @@
21 DIST node-v0.12.17.tar.gz 19938029 BLAKE2B 0118fb016c70afc9940c3b9e2fbed9fd3a56ae7fd8bff6f2ec69320f1e3a71868f7e882783871e842d163b5195628040736e679ca715ebddc6eb6a76fff1288f SHA512 86c22b17f57018083b07096beeca10e6dfa7569b3d1a25a3b12dd82796db3c9536e6136e0dd0ff62b4de116413f3722b36ce396faa46d8640f80ab09ccfcbca7
22 +DIST node-v0.12.18.tar.gz 19842591 BLAKE2B f94f4de6e2875267be194580c645087a262b90da99f10d651a22838c041da07056df81204bb04ce8da083a080062509dcca4d1e3ac2250d651ead8a4cc025028 SHA512 6866608a43eb213f3b715ea0fcc28983fd959ab679c567a1b464f62acd936506f2bce88ea48a60209d8ef8d98259f4b47cd3434893eb4ff82a132775edb37b7b
23 DIST node-v4.8.5.tar.xz 13316060 BLAKE2B fb32f176b9d4add3e9695f0bee7ebd0bba66770d479b1fade572de4694566603f08875da6ff97a1904edd1156708b58670fb1c4717e213aab6ad44ae5d470f40 SHA512 64d936ca14648b5648dedb41f2ee8d39466788762d335fbfc9ce4cb7484d05b6c24ad912fb4b1579a08f466be50b129a96be700fd89cbca5e1de84baa63ddd12
24 DIST node-v4.8.7.tar.xz 13370828 BLAKE2B b1ee93a586b66f8582783b1be50667547afe4bf48038ebc0b8148db55542cbc0520ac84ef88e4a7f453cabc245f484c32dbc238c1932bbc708791ceeb5c9d2ab SHA512 25837a31023747723b146c45984a5b2096b61c0aa43cbf45fc8ff50b4bd5079bd0bc9f1dfd3fb076817448dc5537eb93ffb2f345280b7756ba93b67ad757c696
25 DIST node-v6.11.5.tar.xz 15699404 BLAKE2B ba2df91bf5ef38cedb60b42919cf56f16807e619a81876fc92a5741e49da7ec91c4239d00f549c5e80d0bb8282bb9b396dd984507916cd18d61b403a3a7cef94 SHA512 62490725ef7957294c1bddf21ef0626c7472876791210168116501255ecee58457e9de9b044e10033706243299bbfd1495efeca169596fbf26f5eeba6d8fa4c9
26
27 diff --git a/net-libs/nodejs/nodejs-0.12.18.ebuild b/net-libs/nodejs/nodejs-0.12.18.ebuild
28 new file mode 100644
29 index 00000000000..4bfc66c6f8c
30 --- /dev/null
31 +++ b/net-libs/nodejs/nodejs-0.12.18.ebuild
32 @@ -0,0 +1,124 @@
33 +# Copyright 1999-2018 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +# has known failures. sigh.
39 +RESTRICT="test"
40 +
41 +PYTHON_COMPAT=( python2_7 )
42 +PYTHON_REQ_USE="threads"
43 +
44 +inherit pax-utils python-single-r1 toolchain-funcs
45 +
46 +DESCRIPTION="Evented IO for V8 Javascript"
47 +HOMEPAGE="http://nodejs.org/"
48 +SRC_URI="http://nodejs.org/dist/v${PV}/node-v${PV}.tar.gz"
49 +
50 +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
51 +SLOT="0"
52 +KEYWORDS="~amd64 ~arm ~x86 ~x64-macos"
53 +IUSE="debug icu +npm +snapshot +ssl"
54 +
55 +RDEPEND="icu? ( dev-libs/icu )
56 + ${PYTHON_DEPS}
57 + ssl? ( dev-libs/openssl:0=[-bindist] )
58 + >=net-libs/http-parser-2.6.1
59 + >=dev-libs/libuv-1.4.2"
60 +DEPEND="${RDEPEND}"
61 +
62 +S="${WORKDIR}/node-v${PV}"
63 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
64 +
65 +src_prepare() {
66 + tc-export CC CXX PKG_CONFIG
67 + export V=1 # Verbose build
68 + export BUILDTYPE=Release
69 +
70 + # fix compilation on Darwin
71 + # https://code.google.com/p/gyp/issues/detail?id=260
72 + sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
73 +
74 + # make sure we use python2.* while using gyp
75 + sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
76 + sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
77 +
78 + # less verbose install output (stating the same as portage, basically)
79 + sed -i -e "/print/d" tools/install.py || die
80 +
81 + # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
82 + local LIBDIR=$(get_libdir)
83 + sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
84 + sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die
85 + sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die
86 +
87 + default
88 +
89 + # debug builds. change install path, remove optimisations and override buildtype
90 + if use debug; then
91 + sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
92 + BUILDTYPE=Debug
93 + fi
94 +}
95 +
96 +src_configure() {
97 + local myconf=()
98 + local myarch=""
99 + use debug && myconf+=( --debug )
100 + use icu && myconf+=( --with-intl=system-icu )
101 + use npm || myconf+=( --without-npm )
102 + use snapshot || myconf+=( --without-snapshot )
103 + use ssl || myconf+=( --without-ssl )
104 +
105 + case ${ABI} in
106 + x86) myarch="ia32";;
107 + amd64) myarch="x64";;
108 + arm) myarch="arm";;
109 + *) die "Unrecognized ARCH ${ARCH}";;
110 + esac
111 +
112 + "${PYTHON}" configure \
113 + --prefix="${EPREFIX}"/usr \
114 + --dest-cpu=${myarch} \
115 + --shared-openssl \
116 + --shared-libuv \
117 + --shared-http-parser \
118 + --shared-zlib \
119 + --without-dtrace \
120 + "${myconf[@]}" || die
121 +}
122 +
123 +src_compile() {
124 + emake -C out mksnapshot
125 + pax-mark m "out/${BUILDTYPE}/mksnapshot"
126 + emake -C out
127 +}
128 +
129 +src_install() {
130 + local LIBDIR="${ED}/usr/$(get_libdir)"
131 + emake install DESTDIR="${ED}" PREFIX=/usr
132 + use npm && dodoc -r "${LIBDIR}"/node_modules/npm/html
133 + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html} || die
134 + find "${LIBDIR}"/node_modules -type f -name "LICENSE*" -or -name "LICENCE*" -delete
135 +
136 + # set up a symlink structure that npm expects..
137 + dodir /usr/include/node/deps/{v8,uv}
138 + dosym . /usr/include/node/src
139 + for var in deps/{uv,v8}/include; do
140 + dosym ../.. /usr/include/node/${var}
141 + done
142 +
143 + pax-mark -m "${ED}"/usr/bin/node
144 +}
145 +
146 +src_test() {
147 + declare -xl TESTTYPE="${BUILDTYPE}"
148 + "${PYTHON}" tools/test.py --mode=${TESTTYPE} -J message simple || die
149 +}
150 +
151 +pkg_postinst() {
152 + einfo "When using node-gyp to install native modules, you can avoid"
153 + einfo "having to download the full tarball by doing the following:"
154 + einfo ""
155 + einfo "node-gyp --nodedir /usr/include/node <command>"
156 +}