Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

build: detect build path

Node 0.5.5 builds in build/Release instead of build/default.
Add a build wrapper that runs node-waf and moves the .node
to its proper place.

Fixes #12.
  • Loading branch information...
commit f223aee7d0c08ee7e83802d662e9697a1b8c1db1 1 parent 8576c90
@bnoordhuis authored
Showing with 23 additions and 4 deletions.
  1. +3 −2 .gitignore
  2. +1 −1  buffertools.js
  3. +18 −0 build-wrapper
  4. +1 −1  package.json
View
5 .gitignore
@@ -1,2 +1,3 @@
-.lock-wscript
-build/
+/buffertools.node
+/.lock-wscript
+/build/
View
2  buffertools.js
@@ -1,4 +1,4 @@
-buffertools = require('./build/default/buffertools.node');
+buffertools = require('./buffertools.node');
SlowBuffer = require('buffer').SlowBuffer;
Buffer = require('buffer').Buffer;
View
18 build-wrapper
@@ -0,0 +1,18 @@
+#!/usr/bin/env python
+
+import subprocess
+import shutil
+import sys
+import os
+
+status = subprocess.call('node-waf configure build'.split())
+if status:
+ sys.exit(status)
+
+try:
+ prefix = (path for path in ('build/default', 'build/Release') if os.path.isdir(path)).next()
+except StopIteration:
+ raise OSError("Build path not found")
+
+shutil.copy(prefix + '/buffertools.node', '.')
+shutil.rmtree('build/')
View
2  package.json
@@ -11,7 +11,7 @@
"url": "http://bnoordhuis.nl/"
},
"scripts": {
- "preinstall": "node-waf configure build"
+ "preinstall": "./build-wrapper"
},
"repository": {
"type": "git",

0 comments on commit f223aee

Please sign in to comment.
Something went wrong with that request. Please try again.