This patch allows for building of sub-packages ( node-sqlite3 ) with
USE_SYSTRACE enabled, and also prevents future downloading of node
distfile.
Index: Makefile
===================================================================
RCS file: /cvs/ports/www/node/Makefile,v
retrieving revision 1.35
diff -N -u -p Makefile
--- Makefile 8 May 2012 15:38:01 -0000 1.35
+++ Makefile 9 May 2012 02:31:52 -0000
@@ -11,7 +11,7 @@ COMMENT= V8 JavaScript for clients and servers
NODE_VERSION= v0.6.17
DISTNAME= node-${NODE_VERSION}
PKGNAME= ${DISTNAME:S/v//g}
-REVISION= 1
+REVISION= 2
CATEGORIES= www devel
Index: patches/patch-deps_npm_node_modules_node-gyp_lib_install_js
===================================================================
RCS file: patches/patch-deps_npm_node_modules_node-gyp_lib_install_js
diff -N -u -p patches/patch-deps_npm_node_modules_node-gyp_lib_install_js
--- /dev/null 8 May 2012 20:31:52 -0000
+++ patches/patch-deps_npm_node_modules_node-gyp_lib_install_js 9 May 2012
02:31:52 -0000
@@ -0,0 +1,30 @@
+$OpenBSD$
+--- deps/npm/node_modules/node-gyp/lib/install.js.orig Tue May 8 20:06:20 2012
++++ deps/npm/node_modules/node-gyp/lib/install.js Tue May 8 20:08:56 2012
+@@ -166,11 +166,21 @@ function install (gyp, argv, callback) {
+ extracter.on('error', cb)
+ extracter.on('end', afterTarball)
+
+- // download the tarball, gunzip and extract!
+- var req = download(tarballUrl, downloadError)
+- .pipe(gunzip)
+- .pipe(extracter)
+-
++ var filePath = '/usr/ports/distfiles/node-v' + version + '.tar.gz';
++ gyp.info('If this fails, please ensure ' + filePath + ' exists!!')
++ fs.stat(filePath, function(err, stat) {
++ if (err) {
++ // download the tarball
++ var req = download(tarballUrl, downloadError)
++ .pipe(gunzip)
++ .pipe(extracter)
++ } else {
++ // use existing tarball
++ fs.createReadStream(filePath)
++ .pipe(gunzip)
++ .pipe(extracter)
++ }
++ });
+ // something went wrong downloading the tarball?
+ function downloadError (err, res) {
+ if (err || res.statusCode != 200) {