Update node-fibers to 0.6.8, works with node 0.8.0.

Build process changed from waf to gyp, so modify patches accordingly.
This commit is contained in:
jeremy 2012-06-28 17:27:51 +00:00
parent 2558168c89
commit 0376117422
11 changed files with 80 additions and 140 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.6 2012/05/23 15:13:20 jasper Exp $
# $OpenBSD: Makefile,v 1.7 2012/06/28 17:27:51 jeremy Exp $
# Currently node itself is only for amd64 and i386, but
# the coroutine library this uses only works on amd64
@ -8,12 +8,10 @@ ONLY_FOR_ARCHS= amd64 i386
COMMENT = fiber/coroutine support for nodejs
NPM_VERSION = 0.6.4
NPM_VERSION = 0.6.8
NPM_NAME = fibers
CATEGORIES = devel
REVISION = 2
MAINTAINER = Jeremy Evans <jeremy@openbsd.org>
HOMEPAGE = https://github.com/laverdet/node-fibers
@ -28,11 +26,13 @@ MODULES = lang/node
CONFIGURE_STYLE = npm ext
USE_GMAKE = Yes
SUBST_VARS = CFLAGS
FIBERS_ARCH = openbsd-${PKG_ARCH:S/amd64/x64/:S/i386/ia32/}
SUBST_VARS = FIBERS_ARCH
REGRESS_TARGET = test
MODNODE_DEPENDS ?= node-gyp
REGRESS_DEPENDS = ${BUILD_PKGPATH}
pre-configure:
${SUBST_CMD} ${WRKDIST}/src/platform.mk
do-regress:
cd ${WRKDIST} && node test.js
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (fibers-0.6.4.tgz) = rY5cv97tO9sO4qtP2DlRnA==
RMD160 (fibers-0.6.4.tgz) = 9Mw3D9B2GnzrH/kdBgG0j0yjo7E=
SHA1 (fibers-0.6.4.tgz) = K3Zl0he9gGtWSByhkHg8j9P1FZs=
SHA256 (fibers-0.6.4.tgz) = jrIeMPCP1V/VqQnRKKT5vwb13ni9xJelSNTQJxWqLmA=
SIZE (fibers-0.6.4.tgz) = 25553
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,15 +0,0 @@
$OpenBSD: patch-Makefile,v 1.1 2012/05/10 08:41:39 jasper Exp $
Don't run tests as part of the normal build.
--- Makefile.orig Thu May 10 09:54:35 2012
+++ Makefile Thu May 10 09:54:48 2012
@@ -1,7 +1,7 @@
include src/platform.mk
FIBERS_SO := $(shell echo `pwd`/src/fibers.node)
-all: fibers test
+all: fibers
fibers: $(FIBERS_SO)

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-binding_gyp,v 1.1 2012/06/28 17:27:51 jeremy 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'],
}
],
- ['OS == "linux" or OS == "solaris" or OS == "freebsd"', {'defines': ['CORO_UCONTEXT']}],
+ ['OS == "linux" or OS == "solaris" or OS == "freebsd"', {'defines': ['CORO_ASM']}],
['OS == "mac"', {
'defines': ['CORO_SJLJ'],
'xcode_settings': {

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-fibers_js,v 1.1.1.1 2012/04/03 18:46:03 jeremy Exp $
Don't check mtimes against process, as it appears to break things
and should not be a problem with ports.
--- fibers.js.orig Wed Feb 1 13:54:47 2012
+++ fibers.js Wed Feb 1 13:55:09 2012
@@ -1,13 +1,2 @@
-var fs = require('fs'), path = require('path');
-
-if (fs.statSync(process.execPath).mtime >
- fs.statSync(require.resolve('./src/fibers')).mtime) {
- throw new Error(
- '`node` has a newer mtime than `fiber`; it is possible your build is out of date. This ' +
- 'could happen if you upgrade node. Try `npm rebuild fibers` to rebuild. If that doesn\'t ' +
- 'work you could consider running `touch ' + __dirname + 'src/fibers` and maybe there won\'t ' +
- 'be a problem.');
-}
-
// Injects `Fiber` and `yield` in to global
require('./src/fibers');

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-package_json,v 1.1.1.1 2012/04/03 18:46:03 jeremy Exp $
--- package.json.orig Wed Jan 4 21:24:45 2012
+++ package.json Sun Apr 1 19:33:55 2012
@@ -8,14 +8,14 @@
"author": "Marcel Laverdet <marcel@laverdet.com> (https://github.com/laverdet/)",
"main": "fibers",
"scripts": {
- "install": "make clean all"
+ "install": "gmake clean all"
},
"man": "./man/fibers.1",
"repository": {
"type": "git",
"url": "git://github.com/laverdet/node-fibers.git"
},
- "os": ["macos", "linux"],
+ "os": ["macos", "linux", "openbsd"],
"engines": {
"node": ">=0.5.2"
}

View File

@ -1,22 +0,0 @@
$OpenBSD: patch-src_Makefile,v 1.1.1.1 2012/04/03 18:46:03 jeremy Exp $
--- src/Makefile.orig Wed Jan 4 21:24:45 2012
+++ src/Makefile Wed Feb 1 14:25:00 2012
@@ -9,6 +9,9 @@ endif
ifeq ($(NODE_PLATFORM), darwin)
CPP_NODEFLAGS = -bundle -undefined dynamic_lookup
endif
+ifeq ($(NODE_PLATFORM), openbsd)
+ CPP_NODEFLAGS = -fPIC -shared -Wl,-Bdynamic
+endif
all: fibers.node
@@ -19,7 +22,7 @@ coroutine.o: coroutine.cc
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -fPIC -c -o $@ $^
fibers.node: fibers.cc coroutine.o libcoro.o
- $(CXX) $(CPP_NODEFLAGS) $(CPPFLAGS) $^ -o $@ -lpthread
+ $(CXX) $(CPP_NODEFLAGS) $(CPPFLAGS) $^ -o $@ -pthread
clean:
-$(RM) fibers.node libcoro.o coroutine.o

View File

@ -1,30 +0,0 @@
$OpenBSD: patch-src_platform_mk,v 1.1.1.1 2012/04/03 18:46:03 jeremy Exp $
Enable build on OpenBSD and respect CFLAGS.
--- src/platform.mk.orig Wed Jan 4 21:24:45 2012
+++ src/platform.mk Tue Feb 7 14:04:54 2012
@@ -1,13 +1,13 @@
# I know nothing about scons, waf, or autoconf. Sorry.
NODE_PREFIX := $(shell echo "console.log(require('path').dirname(require('path').dirname(process.execPath)))" | node)
NODE_PLATFORM := $(shell echo "console.log(process.platform.replace('2', ''))" | node)
-NODE_BITS := $(shell file `echo "console.log(process.execPath)" | node` | egrep -o '[0-9]{2}-bit' | cut -c-2)
+NODE_BITS := $(shell file `echo "console.log(process.arch.replace(/ia|x/, ''))" | node`)
CPPFLAGS = -Wall -Wno-deprecated-declarations -I$(NODE_PREFIX)/include -I$(NODE_PREFIX)/include/node
ifdef DEBUG
CPPFLAGS += -ggdb -O0
else
- CPPFLAGS += -g -O3 -minline-all-stringops
+ CPPFLAGS += -g -I${LOCALBASE}/include -I${LOCALBASE}/include/node ${CFLAGS} -minline-all-stringops
endif
ifeq ($(NODE_BITS), )
@@ -30,4 +30,7 @@ endif
ifeq ($(NODE_PLATFORM), darwin)
# UCONTEXT in os x = hangs & segfaults :(
CPPFLAGS += -DCORO_SJLJ
+endif
+ifeq ($(NODE_PLATFORM), openbsd)
+ CPPFLAGS += -DCORO_ASM
endif

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-test_js,v 1.1 2012/06/28 17:27:51 jeremy Exp $
Don't change NODE_PATH in regression tests, since build is done
in separate directory.
--- test.js.orig Tue May 22 13:28:22 2012
+++ test.js Tue May 22 13:28:34 2012
@@ -4,7 +4,7 @@ var spawn = require('child_process').spawn;
var path = require('path');
function runTest(test, cb) {
- var proc = spawn(process.execPath, [path.join('test', test)], {env: {NODE_PATH: __dirname}});
+ var proc = spawn(process.execPath, [path.join('test', test)]);
proc.stdout.setEncoding('utf8');
proc.stderr.setEncoding('utf8');

View File

@ -1,9 +0,0 @@
$OpenBSD: patch-test_sh,v 1.1.1.1 2012/04/03 18:46:03 jeremy Exp $
--- test.sh.orig Wed Feb 1 13:47:26 2012
+++ test.sh Wed Feb 1 13:47:37 2012
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
for ii in `ls test`
do echo -n $ii': '
OUTPUT=$(NODE_PATH=`pwd` node test/$ii 2>&1)

View File

@ -1,31 +1,56 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2012/04/03 18:46:03 jeremy Exp $
lib/node_modules/
@comment $OpenBSD: PLIST,v 1.2 2012/06/28 17:27:51 jeremy Exp $
bin/${FIBERS_ARCH}-v8-3.11
lib/node_modules/fibers/
lib/node_modules/fibers/.npmignore
lib/node_modules/fibers/LICENSE
lib/node_modules/fibers/Makefile
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
lib/node_modules/fibers/binding.gyp
lib/node_modules/fibers/build/
lib/node_modules/fibers/build.js
lib/node_modules/fibers/build/Makefile
lib/node_modules/fibers/build/Release/
lib/node_modules/fibers/build/Release/.deps/
lib/node_modules/fibers/build/Release/.deps/Release/
lib/node_modules/fibers/build/Release/.deps/Release/fibers.node.d
lib/node_modules/fibers/build/Release/.deps/Release/obj.target/
lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers/
lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers.node.d
lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers/src/
lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers/src/coroutine.o.d
lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers/src/fibers.o.d
lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers/src/libcoro/
lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers/src/libcoro/coro.o.d
lib/node_modules/fibers/build/Release/linker.lock
lib/node_modules/fibers/build/Release/obj.target/
lib/node_modules/fibers/build/Release/obj.target/fibers/
@bin lib/node_modules/fibers/build/Release/obj.target/fibers.node
lib/node_modules/fibers/build/Release/obj.target/fibers/src/
lib/node_modules/fibers/build/Release/obj.target/fibers/src/coroutine.o
lib/node_modules/fibers/build/Release/obj.target/fibers/src/fibers.o
lib/node_modules/fibers/build/Release/obj.target/fibers/src/libcoro/
lib/node_modules/fibers/build/Release/obj.target/fibers/src/libcoro/coro.o
lib/node_modules/fibers/build/binding.Makefile
lib/node_modules/fibers/build/config.gypi
lib/node_modules/fibers/build/fibers.target.mk
lib/node_modules/fibers/fibers.js
lib/node_modules/fibers/future.js
lib/node_modules/fibers/package.json
lib/node_modules/fibers/src/
lib/node_modules/fibers/src/Makefile
lib/node_modules/fibers/src/coroutine.cc
lib/node_modules/fibers/src/coroutine.h
lib/node_modules/fibers/src/coroutine.o
lib/node_modules/fibers/src/fibers.cc
@bin lib/node_modules/fibers/src/fibers.node
lib/node_modules/fibers/src/libcoro/
lib/node_modules/fibers/src/libcoro.o
lib/node_modules/fibers/src/libcoro/LICENSE
lib/node_modules/fibers/src/libcoro/README
lib/node_modules/fibers/src/libcoro/conftest.c
lib/node_modules/fibers/src/libcoro/coro.c
lib/node_modules/fibers/src/libcoro/coro.h
lib/node_modules/fibers/src/platform.mk
lib/node_modules/fibers/src/platform.mk.beforesubst
lib/node_modules/fibers/test/
lib/node_modules/fibers/test.sh
lib/node_modules/fibers/test.js
lib/node_modules/fibers/test/already-running.js
lib/node_modules/fibers/test/bad-context.js
lib/node_modules/fibers/test/child-process.js