commit:     f23d77314a0490304f83bba4d8076b768426ccab
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 18 14:16:41 2017 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Fri Aug 18 14:17:02 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f23d7731

net-libs/nodejs: Version bump.

Package-Manager: Portage-2.3.8, Repoman-2.3.3

 net-libs/nodejs/Manifest                           |   1 +
 .../nodejs/files/nodejs-8.4.0-shared-nghttp2.patch | 105 +++++++++++
 net-libs/nodejs/nodejs-8.4.0.ebuild                | 196 +++++++++++++++++++++
 3 files changed, 302 insertions(+)

diff --git a/net-libs/nodejs/Manifest b/net-libs/nodejs/Manifest
index 9911e42715c..c1f487949bc 100644
--- a/net-libs/nodejs/Manifest
+++ b/net-libs/nodejs/Manifest
@@ -17,3 +17,4 @@ DIST node-v8.1.0.tar.xz 17723984 SHA256 
f2ff20b69b782dee85e887ad06e830590b225085
 DIST node-v8.1.2.tar.xz 17730764 SHA256 
ac190c1964ee0c28d4c163c0ccbb47435b2e4bd9b4c065b74a93373105c574b3 SHA512 
c071040c33c69768d021613c3213bb227a8afe0868232e3a6094f28e86c118c4e2a74acefa1870e3d54c09c7b0ba6d0bda13ae16e954cdb0dc098aa638037788
 WHIRLPOOL 
deac3b78e0219369d026df189206da1e0596a215ab670ac96192fa41d9622aa79fc3a79ee56af12fc57aa362c528c8b5b73a9e20dc69dd94682abd3c352a167c
 DIST node-v8.1.4.tar.xz 17737792 SHA256 
a83c86445f79749c46fd4f2c4e681a3e5bb51b2bde5dc7aed1dc38e4e242c301 SHA512 
b9b8d0842313f456e156ca88ec0d7f0082130368597d2d8d7a547658342d7e1692be928c17d2a77a09ee0ac2b443038b135cd99055ffee29ff61d957dea4ee14
 WHIRLPOOL 
4955ea1778f95a3232c0eaf45407eaa04ae91de2180341d4b87e711e484d2abbfc9875577be7df4d59fb3c8dc34579c779fbe47153a248be202cd0265f581585
 DIST node-v8.2.1.tar.xz 17897168 SHA256 
02c46d8914540eea73d0ad33bf9f371a28aa0dc8c5d740948491fef044ad8c8b SHA512 
8d84998e8408b89e003929d7fce89c31703aea59ca5826246422d4d1935941730b0b9907a8a9af088ec8ccad60d8919da04104037083a2363daf118682a3b82a
 WHIRLPOOL 
dbbf430699f88b1c86b1a818b9c2fe424d3c63eb36c2b85b54de78954d8f01dc47a2f66a6cecf30c43e8ab29236f0a7509a26afc4586501abcda4494a78a21c7
+DIST node-v8.4.0.tar.xz 18265792 SHA256 
5d5aa2a101dcc617231a475812eb8ed87cac21491f1dcc7997b9dd463563f361 SHA512 
7d0d97ca64db0bf87f1892490f8b7758a879d2ac22532b69e8e0ee5c04bd11073fd917353eeeabdcfbebc83540715d8c520ec9bf9ea1afc82d8ee7b6caf819f1
 WHIRLPOOL 
23f50be06615350564577349f6388d6563cbcae9e9b0229133baaab30852be7c759fbb4f265816ab999fa2bfa8666b47fb3ba438e09beff8e030fa2db547001c

diff --git a/net-libs/nodejs/files/nodejs-8.4.0-shared-nghttp2.patch 
b/net-libs/nodejs/files/nodejs-8.4.0-shared-nghttp2.patch
new file mode 100644
index 00000000000..1f1a2e6ea63
--- /dev/null
+++ b/net-libs/nodejs/files/nodejs-8.4.0-shared-nghttp2.patch
@@ -0,0 +1,105 @@
+--- a/configure
++++ b/configure
+@@ -182,6 +182,27 @@
+     dest='shared_http_parser_libpath',
+     help='a directory to search for the shared http_parser DLL')
+ 
++shared_optgroup.add_option('--shared-nghttp2',
++    action='store_true',
++    dest='shared_nghttp2',
++    help='link to a shared nghttp2 DLL instead of static linking')
++
++shared_optgroup.add_option('--shared-nghttp2-includes',
++    action='store',
++    dest='shared_nghttp2_includes',
++    help='directory containing nghttp2 header files')
++
++shared_optgroup.add_option('--shared-nghttp2-libname',
++    action='store',
++    dest='shared_nghttp2_libname',
++    default='nghttp2',
++    help='alternative lib name to link to [default: %default]')
++
++shared_optgroup.add_option('--shared-nghttp2-libpath',
++    action='store',
++    dest='shared_nghttp2_libpath',
++    help='a directory to search for the shared nghttp2 DLL')
++
+ shared_optgroup.add_option('--shared-libuv',
+     action='store_true',
+     dest='shared_libuv',
+@@ -1381,6 +1381,7 @@
+ configure_node(output)
+ configure_library('zlib', output)
+ configure_library('http_parser', output)
++configure_library('nghttp2', output)
+ configure_library('libuv', output)
+ configure_library('libcares', output)
+ # stay backwards compatible with shared cares builds
+--- a/node.gyp
++++ b/node.gyp
+@@ -14,6 +14,7 @@
+     'node_module_version%': '',
+     'node_shared_zlib%': 'false',
+     'node_shared_http_parser%': 'false',
++    'node_shared_nghttp2%': 'false',
+     'node_shared_cares%': 'false',
+     'node_shared_libuv%': 'false',
+     'node_use_openssl%': 'true',
+@@ -149,10 +150,17 @@
+       'type': '<(node_target_type)',
+
+       'dependencies': [
+-        'node_js2c#host',
+-        'deps/nghttp2/nghttp2.gyp:nghttp2'
++        'node_js2c#host'
+       ],
+
++      'conditions': [
++        [ 'node_shared_nghttp2=="false"', {
++          'dependencies': [
++            'deps/nghttp2/nghttp2.gyp:nghttp2'
++          ]
++        }]
++      ],
++
+       'includes': [
+         'node.gypi'
+       ],
+@@ -161,8 +161,7 @@
+         'src',
+         'tools/msvs/genfiles',
+         'deps/uv/src/ares',
+-        '<(SHARED_INTERMEDIATE_DIR)', # for node_natives.h
+-        'deps/nghttp2/lib/includes'
++        '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
+       ],
+ 
+       'sources': [
+@@ -275,9 +274,7 @@
+         'NODE_PLATFORM="<(OS)"',
+         'NODE_WANT_INTERNALS=1',
+         # Warn when using deprecated V8 APIs.
+-        'V8_DEPRECATION_WARNINGS=1',
+-        # We're using the nghttp2 static lib
+-        'NGHTTP2_STATICLIB'
++        'V8_DEPRECATION_WARNINGS=1'
+       ],
+     },
+     {
+@@ -687,6 +684,15 @@
+                 'deps/http_parser/http_parser.gyp:http_parser'
+               ]
+             }],
++            [ 'node_shared_nghttp2=="false"', {
++              'dependencies': [
++                'deps/nghttp2/nghttp2.gyp:nghttp2'
++              ],
++              'defines': [
++                # We're using the nghttp2 static lib
++                'NGHTTP2_STATICLIB'
++              ]
++            }],
+             [ 'node_shared_libuv=="false"', {
+               'dependencies': [
+                 'deps/uv/uv.gyp:libuv'

diff --git a/net-libs/nodejs/nodejs-8.4.0.ebuild 
b/net-libs/nodejs/nodejs-8.4.0.ebuild
new file mode 100644
index 00000000000..a86e5fe18f8
--- /dev/null
+++ b/net-libs/nodejs/nodejs-8.4.0.ebuild
@@ -0,0 +1,196 @@
+# 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 +npm +snapshot +ssl systemtap test"
+
+RDEPEND="icu? ( >=dev-libs/icu-56:= )
+       npm? ( ${PYTHON_DEPS} )
+       >=net-libs/http-parser-2.6.2:=
+       >=dev-libs/libuv-1.11.0:=
+       net-libs/nghttp2
+       >=dev-libs/openssl-1.0.2g:0=[-bindist]
+       sys-libs/zlib"
+DEPEND="${RDEPEND}
+       ${PYTHON_DEPS}
+       systemtap? ( dev-util/systemtap )
+       test? ( net-misc/curl )"
+
+S="${WORKDIR}/node-v${PV}"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+PATCHES=(
+       "${FILESDIR}"/gentoo-global-npm-config.patch
+       "${FILESDIR}"/nodejs-8.4.0-shared-nghttp2.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-http-parser --shared-libuv --shared-nghttp2 
--shared-openssl --shared-zlib )
+       use npm || myconf+=( --without-npm )
+       use icu && myconf+=( --with-intl=system-icu )
+       use snapshot && myconf+=( --with-snapshot )
+       use ssl || myconf+=( --without-ssl )
+       use debug && myconf+=( --debug )
+
+       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 <command>"
+}

Reply via email to