From 9bd54251864651f49e673a08aec9ef79cfe08f04 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 17 Dec 2017 09:07:15 +0000 Subject: gentoo resync : 17.12.2017 --- net-libs/nodejs/Manifest | 6 +- net-libs/nodejs/nodejs-6.12.2.ebuild | 200 ++++++++++++++++++++++++++++++++++ net-libs/nodejs/nodejs-8.9.3.ebuild | 5 +- net-libs/nodejs/nodejs-9.3.0.ebuild | 201 +++++++++++++++++++++++++++++++++++ 4 files changed, 408 insertions(+), 4 deletions(-) create mode 100644 net-libs/nodejs/nodejs-6.12.2.ebuild create mode 100644 net-libs/nodejs/nodejs-9.3.0.ebuild (limited to 'net-libs/nodejs') diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest index 410ddb02efce..1e4aef572a16 100644 --- a/net-libs/nodejs/Manifest +++ b/net-libs/nodejs/Manifest @@ -4,14 +4,18 @@ AUX nodejs-9.2.0-shared-nghttp2.patch 3166 BLAKE2B 2dfdc5b79ce5c2bb55c016ae78922 DIST node-v0.12.17.tar.gz 19938029 BLAKE2B 0118fb016c70afc9940c3b9e2fbed9fd3a56ae7fd8bff6f2ec69320f1e3a71868f7e882783871e842d163b5195628040736e679ca715ebddc6eb6a76fff1288f SHA512 86c22b17f57018083b07096beeca10e6dfa7569b3d1a25a3b12dd82796db3c9536e6136e0dd0ff62b4de116413f3722b36ce396faa46d8640f80ab09ccfcbca7 DIST node-v4.8.5.tar.xz 13316060 BLAKE2B fb32f176b9d4add3e9695f0bee7ebd0bba66770d479b1fade572de4694566603f08875da6ff97a1904edd1156708b58670fb1c4717e213aab6ad44ae5d470f40 SHA512 64d936ca14648b5648dedb41f2ee8d39466788762d335fbfc9ce4cb7484d05b6c24ad912fb4b1579a08f466be50b129a96be700fd89cbca5e1de84baa63ddd12 DIST node-v6.11.5.tar.xz 15699404 BLAKE2B ba2df91bf5ef38cedb60b42919cf56f16807e619a81876fc92a5741e49da7ec91c4239d00f549c5e80d0bb8282bb9b396dd984507916cd18d61b403a3a7cef94 SHA512 62490725ef7957294c1bddf21ef0626c7472876791210168116501255ecee58457e9de9b044e10033706243299bbfd1495efeca169596fbf26f5eeba6d8fa4c9 +DIST node-v6.12.2.tar.xz 15760164 BLAKE2B 89daf5d52a430a729f9c55f10483805a6b802abdffa2a3bbcaa8ce71c78321eadedaabe1b28cd781c6b894923821bbb1743754cbabafda0a0e9abb7b6b11fa78 SHA512 914eea968dacb086f5083ee0845a982969a5c56ab183c8da17812d8386095db1e9c2d07dee4f6186091d64cde605d1ffc15d17025ea28d1c3ee3bceefff6c399 DIST node-v6.9.4.tar.xz 15519264 BLAKE2B 4dfad88b06b209272b8468501cc3c87c40425781fb55011ee93326555c2df88a166ffaff1877563668e06389703053849361739556f1bc87c1e2386d48b9542e SHA512 86d3e2889031c2b50c021bd3fd63194c2c22c44291d51dff1b5e1652b01853c09d2880c2f58fdad062e3e2a3f637a3f0d78dac66b835b676790cf272e64f8dce DIST node-v8.9.3.tar.xz 18298212 BLAKE2B 7d19fcb77c496fb3aa717d426a3db4630e382738f0fe3273bba3137814470a5fe5e9593c18934cfd62816a0ac33d195eb241c810f4756d84eaa8f974606a485b SHA512 7bd037189925387bfd1339eef5be9af10af0a063914b4cdb2a1f3befec2e76eb566f7d14874b8c70a02172ebeb4d1c1fdbb0715ca8f18b0b5711a38b30214bc8 DIST node-v9.2.1.tar.xz 18346796 BLAKE2B 8fe82a9b50636fef21f9bba05e89381f6785f18599adb5183d4276df4d0e5b2a4d1bb3d8137143fb87d8638ce82f6812ff237764f7b76f1bee65199a93c91e88 SHA512 379a340186c8299df02a90dce730250d46b502ef58ca4720ede48a5053d0f1e6ee958003dd9e3c0b76f4575980217d9dc5a9cd93a2a4e58da324d04d6d5edc7e +DIST node-v9.3.0.tar.xz 18385364 BLAKE2B 825fd8786b68020f7bb2735e519cd5ecb49552766646425613780736e7c20f555007e90048abd3e985d27656a39da6737ced5c905f113b0e531549312751e2d8 SHA512 bafc3bbd01ce0cc00f13e6f34b8ed361cff337c71b90836132c8188b1103ba2d6aab145258b6afafafc2455fa8a5de54be265435a553793946fd6d308095ae3e EBUILD nodejs-0.12.17.ebuild 3425 BLAKE2B b1c8ea2a39ee873c2d46a68af2e6050ae6e879ae9a80d20543e4486fda5885385b702394b4af1284883cc0685541ae7184e3b0c9b97866190d28e66a3d508534 SHA512 5507119d2bf420f8096c15258dded17cd5bc5470aa36d8ca1ef4324c183536580965b5c0b8022f22ebce509621d84ab2423d768e2c5d8e2268a40f622ead8075 EBUILD nodejs-4.8.5.ebuild 4435 BLAKE2B 0a226e511e27eef347c542d1830e86208636159384983d1be76f08b220008e5e999e303a78feeff58beb52d6f3f18382804b9114cd1d73a4b1aaab329f676406 SHA512 66f3bfae15bef4755f9ec630c4bc50a44ae0b63102c3568bf6ca41caea66bca09cd67eb8dc314a27b0a571f2672e93f3937b9f14e3b19a0eaf36221c36c07d66 EBUILD nodejs-6.11.5.ebuild 6090 BLAKE2B c90aa71b89dab6ff99da43cdfeae4eabcbd28f4e865bcd4129a0978070f176a826bd81b7464453ea54f4a17a582667a1a2f4622eec5d76117d4c4b2af6ae15e0 SHA512 3b203a496f10605a816d5cd8ca9563b9d8ce6829dccf6b8934d9c63275e042aca2371bb5b9356ad88d299aa7336c94e074fa5e8d9ebe8259bd80c76205216486 +EBUILD nodejs-6.12.2.ebuild 6179 BLAKE2B 6dfcc4acf5977db1fb003583e194158ba2d5cd5f01873822c17368afe152959bb84fe40587f585a06ba5590bed19b669cbf7816b48d7154d7585e925935dd1a7 SHA512 a5f364c27a4c90be5580329b209f68bbe480626b79bb5f8d0299db1cc6a87f76bd5e80244d6a3b5d4ef10232537e9aa9f82475d5182a8083bda499cdbdbc7bc1 EBUILD nodejs-6.9.4.ebuild 6073 BLAKE2B cf41081773527f8efb120d6d7ba8d21dc834fc47fbf1964fc235853d842321899c605f42e2799136a54f65e6140c89a05726ba49d86a5fcd78fa4c78114f1e96 SHA512 aefc407c057e7c660ed0be4adc5056c9130b95adb63b22bd55d06c4981d70d53d82a65350df4778684c597de5b5bf6b2f8cd28b0ce61de4914c4db02ac3461f7 -EBUILD nodejs-8.9.3.ebuild 6421 BLAKE2B 1cc15687b44dc144b6f004483ed7fb875a3ebc3b2d82c6fdc95cd62b2c2e2ba2400dbb95c5a7ffa9cb338d6bab09fb4ef098fa71e3b3c2d32f6ddd302f384a6e SHA512 8c312851a25fd71aa64fc9b3a209f463b1c5099d87a0ae5ad3b6ba6c4c41651a683249c09b81079cc990c8bdb38bcca12138eec7f4a3d03d04a75c9036c60d7d +EBUILD nodejs-8.9.3.ebuild 6398 BLAKE2B d5a432f78b1613d30fbcf3552665530b1db8f7401e60c858f9160517ce19fbdae99071d41c7cd0c018969b419bb3b54fd11d571f6ff8fc7ba5dfa48efbba1e00 SHA512 7f6ac6b6ba793a09eadde6e7fde3c6787157d60a40d51ba873a85917f72679ee40d57fdbd8b91d93aa7049196abdd2c5faf13a318498dae303fa512a71c16531 EBUILD nodejs-9.2.1.ebuild 6421 BLAKE2B 8373da68cf051d055edfe47e737ecd091dce243430efb25cd9ce2b04213a16364aac0613ff793ef7e44dde94a1c28bfa7b0711c7bfa02a80c01097fb6dfcb546 SHA512 25d09d0fed3bf63d67edfc98699388b8fdd33812577417704f2a242f9e8290dce509c6c90b335020960a387999e35c0343256e5a85003b9a253bcd14ba805eb1 +EBUILD nodejs-9.3.0.ebuild 6350 BLAKE2B 1b8b2ed276c850a2065804e19e79b5a32eb2d768a52f169794732075663cf6ab8d5133cc3b5b5f41f58547745455a0b189af440473db5157539fed6f698afa7d SHA512 dc75843801d5075d8e6b627b85a5272d21e5f7e0a622044578aba30d326b657291b1d9630b0ed293a6b8dda09722edc0b97c037abcd5ea7ad1701d7a0f66a763 EBUILD nodejs-99999999.ebuild 6279 BLAKE2B 4fdab839abcf93e72846133d67e1bddbc3f6df9030f3c50136d21b1a563abffa03042f20264522d4fb6326f4cd7496790e50f027e9b9799d8c557dbb19acea9b SHA512 790483bcd7ca2f1cd362760a9b19bf0d09ec7359ea583909e64bba556b3ed3da13767e611bb64f91c2002650086c2247a1a52088ba62e271d2bb149f5b52fb13 MISC metadata.xml 502 BLAKE2B 8640b71810454f7c091026e02910563ee44866ed666fc18be431415054ce38e6dab45f8e1890161d5b39e6eafe0279caed936046b803e619880a7ddeb3e4e428 SHA512 bc6fd0a671ad96d8c3f190514932ccc19319c895829136cd04d99b4123666380ed84502d7dea711dfb1d0ba7f0c6edb88afdc95ff24fbca4a6ad636062b5c32a diff --git a/net-libs/nodejs/nodejs-6.12.2.ebuild b/net-libs/nodejs/nodejs-6.12.2.ebuild new file mode 100644 index 000000000000..d4deaf929b2d --- /dev/null +++ b/net-libs/nodejs/nodejs-6.12.2.ebuild @@ -0,0 +1,200 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +RESTRICT="test" + +PYTHON_COMPAT=( python2_7 ) +PYTHON_REQ_USE="threads" + +inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs + +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" +HOMEPAGE="https://nodejs.org/" +SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" + +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos" +IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl test" +REQUIRED_USE=" + inspector? ( icu ssl ) +" + +RDEPEND=" + >=dev-libs/libuv-1.15.0:= + >=dev-libs/openssl-1.0.2n:0=[-bindist] + >=net-libs/http-parser-2.7.0:= + sys-libs/zlib + icu? ( >=dev-libs/icu-58.2:= ) +" +DEPEND=" + ${RDEPEND} + ${PYTHON_DEPS} + test? ( net-misc/curl ) +" + +S="${WORKDIR}/node-v${PV}" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +PATCHES=( + "${FILESDIR}"/gentoo-global-npm-config.patch +) + +pkg_pretend() { + (use x86 && ! use cpu_flags_x86_sse2) && \ + die "Your CPU doesn't support the required SSE2 instruction." + + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." +} + +src_prepare() { + tc-export CC CXX PKG_CONFIG + export V=1 + 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 + + # Avoid writing a depfile, not useful + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die + + # Avoid a test that I've only been able to reproduce from emerge. It doesnt + # seem sandbox related either (invoking it from a sandbox works fine). + # The issue is that no stdin handle is openened when asked for one. + # It doesn't really belong upstream , so it'll just be removed until someone + # with more gentoo-knowledge than me (jbergstroem) figures it out. + rm test/parallel/test-stdout-close-unref.js || die + + # 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 + + default +} + +src_configure() { + local myarch="" + local myconf=( --shared-openssl --shared-libuv --shared-http-parser --shared-zlib ) + use debug && myconf+=( --debug ) + use icu && myconf+=( --with-intl=system-icu ) + use inspector || myconf+=( --without-inspector ) + use npm || myconf+=( --without-npm ) + use snapshot && myconf+=( --with-snapshot ) + use ssl || myconf+=( --without-ssl ) + + case ${ABI} in + amd64) myarch="x64";; + arm) myarch="arm";; + arm64) myarch="arm64";; + ppc64) myarch="ppc64";; + x32) myarch="x32";; + x86) myarch="ia32";; + *) myarch="${ABI}";; + esac + + GYP_DEFINES="linux_use_gold_flags=0 + linux_use_bundled_binutils=0 + linux_use_bundled_gold=0" \ + "${PYTHON}" configure \ + --prefix="${EPREFIX}"/usr \ + --dest-cpu=${myarch} \ + --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="${D}" + pax-mark -m "${ED}"usr/bin/node + + # set up a symlink structure that node-gyp 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 + + if use doc; then + # Patch docs to make them offline readable + for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do + sed -i '/fonts.googleapis.com/ d' $i; + done + # Install docs! + dohtml -r "${S}"/doc/* + fi + + if use npm; then + dodir /etc/npm + + # Install bash completion for `npm` + # We need to temporarily replace default config path since + # npm otherwise tries to write outside of the sandbox + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die + local tmp_npm_completion_file="$(emktemp)" + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" + newbashcomp "${tmp_npm_completion_file}" npm + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die + + # Move man pages + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* + + # Clean up + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die + + local find_exp="-or -name" + local find_name=() + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ + "*.md" "*.markdown" "*.bat" "*.cmd"; do + find_name+=( ${find_exp} "${match}" ) + done + + # Remove various development and/or inappropriate files and + # useless docs of dependend packages. + find "${LIBDIR}"/node_modules \ + \( -type d -name examples \) -or \( -type f \( \ + -iname "LICEN?E*" \ + "${find_name[@]}" \ + \) \) -exec rm -rf "{}" \; + fi +} + +src_test() { + out/${BUILDTYPE}/cctest || die + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die +} + +pkg_postinst() { + einfo "The global npm config lives in /etc/npm. This deviates slightly" + einfo "from upstream which otherwise would have it live in /usr/etc/." + einfo "" + einfo "Protip: When using node-gyp to install native modules, you can" + einfo "avoid having to download extras by doing the following:" + einfo "$ node-gyp --nodedir /usr/include/node " +} diff --git a/net-libs/nodejs/nodejs-8.9.3.ebuild b/net-libs/nodejs/nodejs-8.9.3.ebuild index e3f1fec1f463..dac3eab7cd80 100644 --- a/net-libs/nodejs/nodejs-8.9.3.ebuild +++ b/net-libs/nodejs/nodejs-8.9.3.ebuild @@ -27,9 +27,8 @@ RDEPEND=" >=net-libs/http-parser-2.7.0:= >=net-libs/nghttp2-1.25.0 sys-libs/zlib - icu? ( >=dev-libs/icu-56:= ) - npm? ( ${PYTHON_DEPS} ) - ssl? ( >=dev-libs/openssl-1.0.2g:0=[-bindist] ) + icu? ( >=dev-libs/icu-59.1:= ) + ssl? ( >=dev-libs/openssl-1.0.2n:0=[-bindist] ) " DEPEND="${RDEPEND} ${PYTHON_DEPS} diff --git a/net-libs/nodejs/nodejs-9.3.0.ebuild b/net-libs/nodejs/nodejs-9.3.0.ebuild new file mode 100644 index 000000000000..fecad2c1fc65 --- /dev/null +++ b/net-libs/nodejs/nodejs-9.3.0.ebuild @@ -0,0 +1,201 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +RESTRICT="test" + +PYTHON_COMPAT=( python2_7 ) +PYTHON_REQ_USE="threads" + +inherit bash-completion-r1 eutils flag-o-matic pax-utils python-single-r1 toolchain-funcs + +DESCRIPTION="A JavaScript runtime built on Chrome's V8 JavaScript engine" +HOMEPAGE="https://nodejs.org/" +SRC_URI="https://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz" + +LICENSE="Apache-1.1 Apache-2.0 BSD BSD-2 MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x64-macos" +IUSE="cpu_flags_x86_sse2 debug doc icu inspector +npm +snapshot +ssl systemtap test" +REQUIRED_USE=" + ${PYTHON_REQUIRED_USE} + inspector? ( icu ssl ) +" + +RDEPEND=" + >=dev-libs/libuv-1.18.0:= + >=net-libs/http-parser-2.7.0:= + >=net-libs/nghttp2-1.25.0 + sys-libs/zlib + icu? ( >=dev-libs/icu-60.1:= ) + ssl? ( >=dev-libs/openssl-1.0.2n:0=[-bindist] ) +" +DEPEND=" + ${RDEPEND} + ${PYTHON_DEPS} + systemtap? ( dev-util/systemtap ) + test? ( net-misc/curl ) +" +S="${WORKDIR}/node-v${PV}" +PATCHES=( + "${FILESDIR}"/gentoo-global-npm-config.patch +) + +pkg_pretend() { + (use x86 && ! use cpu_flags_x86_sse2) && \ + die "Your CPU doesn't support the required SSE2 instruction." + + ( [[ ${MERGE_TYPE} != "binary" ]] && ! test-flag-CXX -std=c++11 ) && \ + die "Your compiler doesn't support C++11. Use GCC 4.8, Clang 3.3 or newer." +} + +src_prepare() { + tc-export CC CXX PKG_CONFIG + export V=1 + 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/|| 'python2'/|| '${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 deps/npm/lib/npm.js || die + + # Avoid writing a depfile, not useful + sed -i -e "/DEPFLAGS =/d" tools/gyp/pylib/gyp/generator/make.py || die + + sed -i -e "/'-O3'/d" common.gypi deps/v8/gypfiles/toolchain.gypi || die + + # Avoid a test that I've only been able to reproduce from emerge. It doesnt + # seem sandbox related either (invoking it from a sandbox works fine). + # The issue is that no stdin handle is openened when asked for one. + # It doesn't really belong upstream , so it'll just be removed until someone + # with more gentoo-knowledge than me (jbergstroem) figures it out. + rm test/parallel/test-stdout-close-unref.js || die + + # 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 + + default +} + +src_configure() { + local myconf=( --shared-http-parser --shared-libuv --shared-nghttp2 --shared-zlib ) + use debug && myconf+=( --debug ) + use icu && myconf+=( --with-intl=system-icu ) || myconf+=( --with-intl=none ) + use inspector || myconf+=( --without-inspector ) + use npm || myconf+=( --without-npm ) + use snapshot && myconf+=( --with-snapshot ) + use ssl && myconf+=( --shared-openssl ) || myconf+=( --without-ssl ) + + local myarch="" + case ${ABI} in + amd64) myarch="x64";; + arm) myarch="arm";; + arm64) myarch="arm64";; + ppc64) myarch="ppc64";; + x32) myarch="x32";; + x86) myarch="ia32";; + *) myarch="${ABI}";; + esac + + GYP_DEFINES="linux_use_gold_flags=0 + linux_use_bundled_binutils=0 + linux_use_bundled_gold=0" \ + "${PYTHON}" configure \ + --prefix="${EPREFIX}"/usr \ + --dest-cpu=${myarch} \ + $(use_with systemtap 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="${D}" + pax-mark -m "${ED}"usr/bin/node + + # set up a symlink structure that node-gyp 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 + + if use doc; then + # Patch docs to make them offline readable + for i in `grep -rl 'fonts.googleapis.com' "${S}"/out/doc/api/*`; do + sed -i '/fonts.googleapis.com/ d' $i; + done + # Install docs! + dohtml -r "${S}"/doc/* + fi + + if use npm; then + dodir /etc/npm + + # Install bash completion for `npm` + # We need to temporarily replace default config path since + # npm otherwise tries to write outside of the sandbox + local npm_config="usr/$(get_libdir)/node_modules/npm/lib/config/core.js" + sed -i -e "s|'/etc'|'${ED}/etc'|g" "${ED}/${npm_config}" || die + local tmp_npm_completion_file="$(emktemp)" + "${ED}/usr/bin/npm" completion > "${tmp_npm_completion_file}" + newbashcomp "${tmp_npm_completion_file}" npm + sed -i -e "s|'${ED}/etc'|'/etc'|g" "${ED}/${npm_config}" || die + + # Move man pages + doman "${LIBDIR}"/node_modules/npm/man/man{1,5,7}/* + + # Clean up + rm "${LIBDIR}"/node_modules/npm/{.mailmap,.npmignore,Makefile} || die + rm -rf "${LIBDIR}"/node_modules/npm/{doc,html,man} || die + + local find_exp="-or -name" + local find_name=() + for match in "AUTHORS*" "CHANGELOG*" "CONTRIBUT*" "README*" \ + ".travis.yml" ".eslint*" ".wercker.yml" ".npmignore" \ + "*.md" "*.markdown" "*.bat" "*.cmd"; do + find_name+=( ${find_exp} "${match}" ) + done + + # Remove various development and/or inappropriate files and + # useless docs of dependend packages. + find "${LIBDIR}"/node_modules \ + \( -type d -name examples \) -or \( -type f \( \ + -iname "LICEN?E*" \ + "${find_name[@]}" \ + \) \) -exec rm -rf "{}" \; + fi +} + +src_test() { + out/${BUILDTYPE}/cctest || die + "${PYTHON}" tools/test.py --mode=${BUILDTYPE,,} -J message parallel sequential || die +} + +pkg_postinst() { + einfo "The global npm config lives in /etc/npm. This deviates slightly" + einfo "from upstream which otherwise would have it live in /usr/etc/." + einfo "" + einfo "Protip: When using node-gyp to install native modules, you can" + einfo "avoid having to download extras by doing the following:" + einfo "$ node-gyp --nodedir /usr/include/node " +} -- cgit v1.2.3