summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-libs')
-rw-r--r--net-libs/nodejs/Manifest1
-rw-r--r--net-libs/nodejs/nodejs-0.12.18.ebuild124
2 files changed, 125 insertions, 0 deletions
diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
index 2a27ec2a9ba0..e75e396b7cb9 100644
--- a/net-libs/nodejs/Manifest
+++ b/net-libs/nodejs/Manifest
@@ -1,4 +1,5 @@
DIST node-v0.12.17.tar.gz 19938029 BLAKE2B 0118fb016c70afc9940c3b9e2fbed9fd3a56ae7fd8bff6f2ec69320f1e3a71868f7e882783871e842d163b5195628040736e679ca715ebddc6eb6a76fff1288f SHA512 86c22b17f57018083b07096beeca10e6dfa7569b3d1a25a3b12dd82796db3c9536e6136e0dd0ff62b4de116413f3722b36ce396faa46d8640f80ab09ccfcbca7
+DIST node-v0.12.18.tar.gz 19842591 BLAKE2B f94f4de6e2875267be194580c645087a262b90da99f10d651a22838c041da07056df81204bb04ce8da083a080062509dcca4d1e3ac2250d651ead8a4cc025028 SHA512 6866608a43eb213f3b715ea0fcc28983fd959ab679c567a1b464f62acd936506f2bce88ea48a60209d8ef8d98259f4b47cd3434893eb4ff82a132775edb37b7b
DIST node-v4.8.5.tar.xz 13316060 BLAKE2B fb32f176b9d4add3e9695f0bee7ebd0bba66770d479b1fade572de4694566603f08875da6ff97a1904edd1156708b58670fb1c4717e213aab6ad44ae5d470f40 SHA512 64d936ca14648b5648dedb41f2ee8d39466788762d335fbfc9ce4cb7484d05b6c24ad912fb4b1579a08f466be50b129a96be700fd89cbca5e1de84baa63ddd12
DIST node-v4.8.7.tar.xz 13370828 BLAKE2B b1ee93a586b66f8582783b1be50667547afe4bf48038ebc0b8148db55542cbc0520ac84ef88e4a7f453cabc245f484c32dbc238c1932bbc708791ceeb5c9d2ab SHA512 25837a31023747723b146c45984a5b2096b61c0aa43cbf45fc8ff50b4bd5079bd0bc9f1dfd3fb076817448dc5537eb93ffb2f345280b7756ba93b67ad757c696
DIST node-v6.11.5.tar.xz 15699404 BLAKE2B ba2df91bf5ef38cedb60b42919cf56f16807e619a81876fc92a5741e49da7ec91c4239d00f549c5e80d0bb8282bb9b396dd984507916cd18d61b403a3a7cef94 SHA512 62490725ef7957294c1bddf21ef0626c7472876791210168116501255ecee58457e9de9b044e10033706243299bbfd1495efeca169596fbf26f5eeba6d8fa4c9
diff --git a/net-libs/nodejs/nodejs-0.12.18.ebuild b/net-libs/nodejs/nodejs-0.12.18.ebuild
new file mode 100644
index 000000000000..4bfc66c6f8cf
--- /dev/null
+++ b/net-libs/nodejs/nodejs-0.12.18.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# has known failures. sigh.
+RESTRICT="test"
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+
+inherit pax-utils python-single-r1 toolchain-funcs
+
+DESCRIPTION="Evented IO for V8 Javascript"
+HOMEPAGE="http://nodejs.org/"
+SRC_URI="http://nodejs.org/dist/v${PV}/node-v${PV}.tar.gz"
+
+LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86 ~x64-macos"
+IUSE="debug icu +npm +snapshot +ssl"
+
+RDEPEND="icu? ( dev-libs/icu )
+ ${PYTHON_DEPS}
+ ssl? ( dev-libs/openssl:0=[-bindist] )
+ >=net-libs/http-parser-2.6.1
+ >=dev-libs/libuv-1.4.2"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/node-v${PV}"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+src_prepare() {
+ tc-export CC CXX PKG_CONFIG
+ export V=1 # Verbose build
+ export BUILDTYPE=Release
+
+ # fix compilation on Darwin
+ # https://code.google.com/p/gyp/issues/detail?id=260
+ sed -i -e "/append('-arch/d" tools/gyp/pylib/gyp/xcode_emulation.py || die
+
+ # make sure we use python2.* while using gyp
+ sed -i -e "s/python/${EPYTHON}/" deps/npm/node_modules/node-gyp/gyp/gyp || die
+ sed -i -e "s/|| 'python'/|| '${EPYTHON}'/" deps/npm/node_modules/node-gyp/lib/configure.js || die
+
+ # less verbose install output (stating the same as portage, basically)
+ sed -i -e "/print/d" tools/install.py || die
+
+ # proper libdir, hat tip @ryanpcmcquen https://github.com/iojs/io.js/issues/504
+ local LIBDIR=$(get_libdir)
+ sed -i -e "s|lib/|${LIBDIR}/|g" tools/install.py || die
+ sed -i -e "s/'lib'/'${LIBDIR}'/" lib/module.js || die
+ sed -i -e "s|\"lib\"|\"${LIBDIR}\"|" deps/npm/lib/npm.js || die
+
+ default
+
+ # debug builds. change install path, remove optimisations and override buildtype
+ if use debug; then
+ sed -i -e "s|out/Release/|out/Debug/|g" tools/install.py || die
+ BUILDTYPE=Debug
+ fi
+}
+
+src_configure() {
+ local myconf=()
+ local myarch=""
+ use debug && myconf+=( --debug )
+ use icu && myconf+=( --with-intl=system-icu )
+ use npm || myconf+=( --without-npm )
+ use snapshot || myconf+=( --without-snapshot )
+ use ssl || myconf+=( --without-ssl )
+
+ case ${ABI} in
+ x86) myarch="ia32";;
+ amd64) myarch="x64";;
+ arm) myarch="arm";;
+ *) die "Unrecognized ARCH ${ARCH}";;
+ esac
+
+ "${PYTHON}" configure \
+ --prefix="${EPREFIX}"/usr \
+ --dest-cpu=${myarch} \
+ --shared-openssl \
+ --shared-libuv \
+ --shared-http-parser \
+ --shared-zlib \
+ --without-dtrace \
+ "${myconf[@]}" || die
+}
+
+src_compile() {
+ emake -C out mksnapshot
+ pax-mark m "out/${BUILDTYPE}/mksnapshot"
+ emake -C out
+}
+
+src_install() {
+ local LIBDIR="${ED}/usr/$(get_libdir)"
+ emake install DESTDIR="${ED}" PREFIX=/usr
+ use npm && dodoc -r "${LIBDIR}"/node_modules/npm/html
+ rm -rf "${LIBDIR}"/node_modules/npm/{doc,html} || die
+ find "${LIBDIR}"/node_modules -type f -name "LICENSE*" -or -name "LICENCE*" -delete
+
+ # set up a symlink structure that npm expects..
+ dodir /usr/include/node/deps/{v8,uv}
+ dosym . /usr/include/node/src
+ for var in deps/{uv,v8}/include; do
+ dosym ../.. /usr/include/node/${var}
+ done
+
+ pax-mark -m "${ED}"/usr/bin/node
+}
+
+src_test() {
+ declare -xl TESTTYPE="${BUILDTYPE}"
+ "${PYTHON}" tools/test.py --mode=${TESTTYPE} -J message simple || die
+}
+
+pkg_postinst() {
+ einfo "When using node-gyp to install native modules, you can avoid"
+ einfo "having to download the full tarball by doing the following:"
+ einfo ""
+ einfo "node-gyp --nodedir /usr/include/node <command>"
+}