Make node-fibers use libv8

OK jeremy@
This commit is contained in:
abieber 2012-12-05 00:45:05 +00:00
parent 3b21a33197
commit 0bac080b84
6 changed files with 51 additions and 14 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.8 2012/07/12 21:42:54 jasper Exp $
# $OpenBSD: Makefile,v 1.9 2012/12/05 00:45:05 abieber Exp $
# Currently node itself is only for amd64 and i386, but
# the coroutine library this uses only works on amd64
@ -10,7 +10,7 @@ COMMENT = fiber/coroutine support for Node.js
NPM_VERSION = 0.6.8
NPM_NAME = fibers
REVISION = 0
REVISION = 1
CATEGORIES = devel
MAINTAINER = Jeremy Evans <jeremy@openbsd.org>
@ -33,6 +33,9 @@ SUBST_VARS = FIBERS_ARCH
MODNODE_DEPENDS ?= node-gyp
REGRESS_DEPENDS = ${BUILD_PKGPATH}
pre-configure:
${SUBST_CMD} ${WRKDIST}/binding.gyp
do-regress:
cd ${WRKDIST} && node test.js

View File

@ -1,5 +1,2 @@
MD5 (fibers-0.6.8.tgz) = K8aAESqAfmEptQidDedLHQ==
RMD160 (fibers-0.6.8.tgz) = FbFwvksxY3Iv/BgrVGjh/zTRK0Q=
SHA1 (fibers-0.6.8.tgz) = /XUsW2NADTGM2yRRRr3zdxoL1rk=
SHA256 (fibers-0.6.8.tgz) = SfhknDmJSDHJpSefEkNyK6fWrG2aqZ+GcnyFcT5LCKA=
SIZE (fibers-0.6.8.tgz) = 445390

View File

@ -1,12 +1,16 @@
$OpenBSD: patch-binding_gyp,v 1.1 2012/06/28 17:27:51 jeremy Exp $
$OpenBSD: patch-binding_gyp,v 1.2 2012/12/05 00:45:05 abieber Exp $
Bad hack to get it to use correct implementation, since it is
recognizing the OpenBSD as Linux.
--- binding.gyp.orig Tue Jun 26 11:47:28 2012
+++ binding.gyp Tue Jun 26 11:47:37 2012
@@ -21,7 +21,7 @@
'ldflags': ['-pthread'],
--- binding.gyp.orig Sun Jun 24 05:39:12 2012
+++ binding.gyp Wed Nov 28 09:28:50 2012
@@ -18,10 +18,10 @@
{
'cflags': ['-Wno-deprecated-declarations'],
'defines': ['USE_CORO'],
- 'ldflags': ['-pthread'],
+ 'ldflags': ['-pthread -L${LOCALBASE}/lib'],
}
],
- ['OS == "linux" or OS == "solaris" or OS == "freebsd"', {'defines': ['CORO_UCONTEXT']}],

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-build_js,v 1.1 2012/12/05 00:45:05 abieber Exp $
--- build.js.orig Tue Nov 27 08:13:04 2012
+++ build.js Tue Nov 27 08:15:13 2012
@@ -24,7 +24,12 @@ if (!{ia32: true, x64: true, arm: true}.hasOwnProperty
}
// Test for pre-built library
-var modPath = platform+ '-'+ arch+ '-v8-'+ v8;
+var modPath;
+if ( platform === 'openbsd' ) {
+ modPath = ""
+} else {
+ modPath = platform+ '-'+ arch+ '-v8-'+ v8;
+}
if (!force) {
try {
fs.statSync(path.join(__dirname, 'bin', modPath, 'fibers.node'));

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-fibers_js,v 1.3 2012/12/05 00:45:05 abieber Exp $
--- fibers.js.orig Tue Nov 27 08:17:20 2012
+++ fibers.js Tue Nov 27 08:18:10 2012
@@ -5,7 +5,12 @@ Math.random();
// Look for binary for this platform
var v8 = 'v8-'+ /[0-9]+\.[0-9]+/.exec(process.versions.v8)[0];
-var modPath = path.join(__dirname, 'bin', process.platform+ '-'+ process.arch+ '-'+ v8, 'fibers');
+var modPath;
+if ( process.platform === 'openbsd' ) {
+ modPath = path.join(__dirname, 'bin', 'fibers' );
+} else {
+ modPath = path.join(__dirname, 'bin', process.platform+ '-'+ process.arch+ '-'+ v8, 'fibers');
+}
try {
fs.statSync(modPath+ '.node');
} catch (ex) {

View File

@ -1,13 +1,12 @@
@comment $OpenBSD: PLIST,v 1.2 2012/06/28 17:27:51 jeremy Exp $
bin/${FIBERS_ARCH}-v8-3.11
@comment $OpenBSD: PLIST,v 1.3 2012/12/05 00:45:05 abieber Exp $
bin/fibers.node
lib/node_modules/fibers/
lib/node_modules/fibers/.npmignore
lib/node_modules/fibers/LICENSE
lib/node_modules/fibers/README.md
lib/node_modules/fibers/bin/
lib/node_modules/fibers/bin/.npmignore
lib/node_modules/fibers/bin/${FIBERS_ARCH}-v8-3.11/
@bin lib/node_modules/fibers/bin/${FIBERS_ARCH}-v8-3.11/fibers.node
@bin lib/node_modules/fibers/bin/fibers.node
lib/node_modules/fibers/binding.gyp
lib/node_modules/fibers/build/
lib/node_modules/fibers/build.js