Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Added support for "node-gyp" build #17

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ build/
*.swp
*.swo
TODO
Makefile.gyp
*.Makefile
*.target.gyp.mk
gyp-mac-tool
out/
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ all: build
.PHONY: test clean

clean:
node-waf distclean
node-gyp clean

build: src/contextify.cc
node-waf distclean && node-waf configure build
build: clean src/contextify.cc
node-gyp configure
node-gyp build

test:
npm test
8 changes: 8 additions & 0 deletions bindings.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
'targets': [
{
'target_name': 'contextify',
'sources': [ 'src/contextify.cc' ]
}
]
}
10 changes: 1 addition & 9 deletions lib/contextify.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
try {
var ContextifyContext = require('../build/Release/contextify').ContextifyContext;
} catch (e) {
console.log("Internal Contextify ERROR: Make sure Contextify is built " +
"with your current Node version.\nTo rebuild, go to the " +
"Contextify root folder and run 'node-waf distclean && " +
"node-waf configure build'.");
throw e;
}
var ContextifyContext = require('bindings')('contextify').ContextifyContext;

module.exports = function Contextify (sandbox) {
if (typeof sandbox != 'object') {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"url" : "http://github.com/brianmcd/contextify/blob/master/LICENSE.txt"
}
],
"dependencies": {
"bindings" : "*"
},
"devDependencies": {
"nodeunit" : ">=0.5.x"
}
Expand Down