nodejs: forked with two patches of mine: -ssl and bindist fixes

This commit is contained in:
Anton Bolshakov 2015-07-31 10:33:38 +00:00
parent b17de14e6a
commit 238fdf34ce
4 changed files with 189 additions and 0 deletions

4
net-libs/nodejs/Manifest Normal file
View file

@ -0,0 +1,4 @@
AUX nodejs-0.12.7_bindist.patch 733 SHA256 b5c817c420cf1f64299df0c93198990670faf55afc72b318a4af94f3431c6e39 SHA512 e5f94f8b648e4a19e964121f7901f936a7da8fd10e33eeab744e76c638bb31ac48d4cc6aebc5dc017faaf4d69450e64739acedb42b8af433d091c9ad66ecb441 WHIRLPOOL 2996f4b42f5db67858d588aa9ffcff475b1b84eb80fe2c37e0a8cfb44e0eb7eae4358ab332419e429aa978b1fda30be4fb1ebeffa1e1e4e878d00ef22965d290
AUX nodejs-0.12.7_ssl.patch 863 SHA256 2e4952286c145892b65091321b9ec5af88d2fb3114b3500ec78d7520a8952eb8 SHA512 23ebfe5c36f4f0998552c1a66eb8c3719990fa5dbd41d00cefdf65c0b598de29d1d88378c5600e7ea62997b13635b6fac59ec9a060e086acb453490cfda48569 WHIRLPOOL 289edc5d86b08bdc2987382907126bd6d0401d95e2ea207260bdcc7deee7a947d5ea6049efb1028af3619ab4c469392f58f52a183d85e3387fc68b9bbbe045c7
DIST node-v0.12.7.tar.gz 20063992 SHA256 b23d64df051c9c969b0c583f802d5d71de342e53067127a5061415be7e12f39d SHA512 0c9cb7542530463e7703435c8d819949785c1c6497c6d98f9854ca615fe33a62f451833e856f0159b836a698b4dee5d165fa505bad5d474f664e1533090d8606 WHIRLPOOL 647391b8c49fda868c14bd4eb3089cac139f50e710ac6b141ea82e1013c4ff7d40cdb0e88d69604d06e3bd07775876c754211a2b099685cb7353ae5708812525
EBUILD nodejs-0.12.7-r1.ebuild 3625 SHA256 e8269e7112ffa58c0a263b9c7a177bc1117582026017eeea7f82838370ff05f6 SHA512 5ea514064c910502c5f1c48df860fe4c04966dbae0dd3e9326da5079bfd355d758191ee0da04fc5adc0f3b4b3e90b355ad037db4652973abd0e214686c646c1e WHIRLPOOL 0a04a3b1497f225b1c6feee34c7878864600222d40c4528bbed4df34e962696424bce5afd0f466dc9aa33970c522333978b62930f2cccf0017f13cc866bf496c

View file

@ -0,0 +1,32 @@
--- src/node_constants.cc.orig 2015-07-10 06:41:19.000000000 +0800
+++ src/node_constants.cc 2015-07-31 18:28:15.699044453 +0800
@@ -33,7 +33,11 @@
#include <sys/stat.h>
#if HAVE_OPENSSL
+
+#ifndef OPENSSL_NO_EC
# include <openssl/ec.h>
+#endif
+
# include <openssl/ssl.h>
# ifndef OPENSSL_NO_ENGINE
# include <openssl/engine.h>
--- src/node_crypto.h.orig 2015-07-10 06:41:19.000000000 +0800
+++ src/node_crypto.h 2015-07-31 18:28:37.043044258 +0800
@@ -39,8 +39,15 @@
#include "v8.h"
#include <openssl/ssl.h>
+
+#ifndef OPENSSL_NO_EC
#include <openssl/ec.h>
+#endif
+
+#ifndef OPENSSL_NO_ECDH
#include <openssl/ecdh.h>
+#endif
+
#ifndef OPENSSL_NO_ENGINE
# include <openssl/engine.h>
#endif // !OPENSSL_NO_ENGINE

View file

@ -0,0 +1,26 @@
--- src/node.cc.orig 2015-07-10 06:41:19.000000000 +0800
+++ src/node.cc 2015-07-31 17:33:25.035074443 +0800
@@ -2934,8 +2934,10 @@
" present.\n"
#endif
#endif
+#if HAVE_OPENSSL
" --enable-ssl2 enable ssl2\n"
" --enable-ssl3 enable ssl3\n"
+#endif // HAVE_OPENSSL
"\n"
"Environment variables:\n"
#ifdef _WIN32
@@ -3003,10 +3005,12 @@
} else if (strcmp(arg, "--version") == 0 || strcmp(arg, "-v") == 0) {
printf("%s\n", NODE_VERSION);
exit(0);
+#if HAVE_OPENSSL
} else if (strcmp(arg, "--enable-ssl2") == 0) {
SSL2_ENABLE = true;
} else if (strcmp(arg, "--enable-ssl3") == 0) {
SSL3_ENABLE = true;
+#endif // HAVE_OPENSSL
} else if (strcmp(arg, "--help") == 0 || strcmp(arg, "-h") == 0) {
PrintHelp();
exit(0);

View file

@ -0,0 +1,127 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-libs/nodejs/nodejs-0.12.7.ebuild,v 1.1 2015/07/12 00:25:09 patrick Exp $
EAPI=5
# 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 )
>=net-libs/http-parser-2.3
>=dev-libs/libuv-1.4.2"
DEPEND="${RDEPEND}
!!net-libs/iojs"
S="${WORKDIR}/node-v${PV}"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
src_prepare() {
epatch "${FILESDIR}"/"${P}"_ssl.patch
epatch "${FILESDIR}"/"${P}"_bindist.patch
tc-export CC CXX PKG_CONFIG
export V=1 # Verbose build
export BUILDTYPE=Release
# fix compilation on Darwin
# http://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
# 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>"
}