On 05/21 10:20, Jeremy Evans wrote: > This updates node-fibers to 0.6.7, the latest version. Doing so > requires some patches to node.
Here's a new patch just for node-fibers that fixes the regression tests and works on both amd64 and i386. It still requires the patches to www/node in the earlier patch. Thanks, Jeremy Index: Makefile =================================================================== RCS file: /cvs/ports/devel/node-fibers/Makefile,v retrieving revision 1.5 diff -u -p -r1.5 Makefile --- Makefile 10 May 2012 08:41:39 -0000 1.5 +++ Makefile 22 May 2012 20:27:41 -0000 @@ -8,12 +8,10 @@ ONLY_FOR_ARCHS= amd64 i386 COMMENT = fiber/coroutine support for nodejs -NPM_VERSION = 0.6.4 +NPM_VERSION = 0.6.7 NPM_NAME = fibers CATEGORIES = devel -REVISION = 1 - MAINTAINER = Jeremy Evans <[email protected]> HOMEPAGE = https://github.com/laverdet/node-fibers @@ -28,11 +26,13 @@ MODULES = www/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> Index: distinfo =================================================================== RCS file: /cvs/ports/devel/node-fibers/distinfo,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 distinfo --- distinfo 3 Apr 2012 18:46:03 -0000 1.1.1.1 +++ distinfo 9 May 2012 15:34:31 -0000 @@ -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.7.tgz) = ZP0GQ3XmyvXJTE5gnOsSWw== +RMD160 (fibers-0.6.7.tgz) = n48ko/37dGLCAEeDhXFrzCV5yOQ= +SHA1 (fibers-0.6.7.tgz) = 2toR/RzDUqJuU3Ut8tZcUvomiKk= +SHA256 (fibers-0.6.7.tgz) = sELHlWKmAzPUtZDjOfwt8ICuOofaZ0uaoAxdg/NnXhk= +SIZE (fibers-0.6.7.tgz) = 237132 Index: patches/patch-Makefile =================================================================== RCS file: patches/patch-Makefile diff -N patches/patch-Makefile --- patches/patch-Makefile 10 May 2012 08:41:39 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -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) - Index: patches/patch-build_js =================================================================== RCS file: patches/patch-build_js diff -N patches/patch-build_js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-build_js 22 May 2012 04:00:29 -0000 @@ -0,0 +1,12 @@ +$OpenBSD$ +--- build.js.orig Mon May 21 21:00:16 2012 ++++ build.js Mon May 21 21:00:25 2012 +@@ -34,7 +34,7 @@ if (!force) { + // Build it + spawn( + 'node', +- ['./node_modules/node-gyp/bin/node-gyp.js', 'rebuild'].concat(args), ++ ['../node-gyp/bin/node-gyp.js', 'rebuild'].concat(args), + {customFds: [0, 1, 2]}) + .on('exit', function(err) { + if (err) { Index: patches/patch-fibers_js =================================================================== RCS file: patches/patch-fibers_js diff -N patches/patch-fibers_js --- patches/patch-fibers_js 3 Apr 2012 18:46:03 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -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'); Index: patches/patch-package_json =================================================================== RCS file: /cvs/ports/devel/node-fibers/patches/patch-package_json,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 patch-package_json --- patches/patch-package_json 3 Apr 2012 18:46:03 -0000 1.1.1.1 +++ patches/patch-package_json 22 May 2012 03:54:07 -0000 @@ -1,20 +1,11 @@ -$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 <[email protected]> (https://github.com/laverdet/)", - "main": "fibers", - "scripts": { -- "install": "make clean all" -+ "install": "gmake clean all" +$OpenBSD$ +--- package.json.orig Mon May 21 20:54:00 2012 ++++ package.json Mon May 21 20:54:04 2012 +@@ -17,6 +17,5 @@ }, - "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" - } +- }, +- "dependencies": {"node-gyp": "*"} ++ } + } Index: patches/patch-src_Makefile =================================================================== RCS file: patches/patch-src_Makefile diff -N patches/patch-src_Makefile --- patches/patch-src_Makefile 3 Apr 2012 18:46:03 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -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 Index: patches/patch-src_platform_mk =================================================================== RCS file: patches/patch-src_platform_mk diff -N patches/patch-src_platform_mk --- patches/patch-src_platform_mk 3 Apr 2012 18:46:03 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -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 Index: patches/patch-test_sh =================================================================== RCS file: patches/patch-test_sh diff -N patches/patch-test_sh --- patches/patch-test_sh 3 Apr 2012 18:46:03 -0000 1.1.1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -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) Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/devel/node-fibers/pkg/PLIST,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 PLIST --- pkg/PLIST 3 Apr 2012 18:46:03 -0000 1.1.1.1 +++ pkg/PLIST 22 May 2012 20:20:47 -0000 @@ -1,31 +1,55 @@ @comment $OpenBSD: PLIST,v 1.1.1.1 2012/04/03 18:46:03 jeremy Exp $ -lib/node_modules/ 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}/ +@bin lib/node_modules/fibers/bin/${FIBERS_ARCH}/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-${FIBERS_ARCH}.node.d +lib/node_modules/fibers/build/Release/.deps/Release/obj.target/ +lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers-${FIBERS_ARCH}/ +lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers-${FIBERS_ARCH}.node.d +lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers-${FIBERS_ARCH}/src/ +lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers-${FIBERS_ARCH}/src/coroutine.o.d +lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers-${FIBERS_ARCH}/src/fibers.o.d +lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers-${FIBERS_ARCH}/src/libcoro/ +lib/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers-${FIBERS_ARCH}/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-${FIBERS_ARCH}/ +@bin lib/node_modules/fibers/build/Release/obj.target/fibers-${FIBERS_ARCH}.node +lib/node_modules/fibers/build/Release/obj.target/fibers-${FIBERS_ARCH}/src/ +lib/node_modules/fibers/build/Release/obj.target/fibers-${FIBERS_ARCH}/src/coroutine.o +lib/node_modules/fibers/build/Release/obj.target/fibers-${FIBERS_ARCH}/src/fibers.o +lib/node_modules/fibers/build/Release/obj.target/fibers-${FIBERS_ARCH}/src/libcoro/ +lib/node_modules/fibers/build/Release/obj.target/fibers-${FIBERS_ARCH}/src/libcoro/coro.o +lib/node_modules/fibers/build/binding.Makefile +lib/node_modules/fibers/build/config.gypi +lib/node_modules/fibers/build/fibers-${FIBERS_ARCH}.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
