diff --git a/binding.gyp b/binding.gyp index 2073fe3..1fa30c5 100644 --- a/binding.gyp +++ b/binding.gyp @@ -9,6 +9,17 @@ 'dependencies': [ 'deps/libexpat/libexpat.gyp:expat' ] + }, + { + 'target_name': 'action_after_build', + 'type': 'none', + 'dependencies': [ '<(module_name)' ], + 'copies': [ + { + 'files': [ '<(PRODUCT_DIR)/<(module_name).node' ], + 'destination': '<(module_path)' + } + ] } ] } diff --git a/lib/node-expat.js b/lib/node-expat.js index 597a047..55d78cd 100644 --- a/lib/node-expat.js +++ b/lib/node-expat.js @@ -1,7 +1,10 @@ var EventEmitter = require('events').EventEmitter var util = require('util') // Only support nodejs v0.6 and on so no need to look for older module location -var expat = require('bindings')('node_expat') +var binary = require('node-pre-gyp') +var path = require('path') +var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json'))) +var expat = require(binding_path) var Stream = require('stream').Stream var Parser = function(encoding) { @@ -109,4 +112,4 @@ exports.createParser = function(cb) { parser.on('startElement', cb) } return parser -} \ No newline at end of file +} diff --git a/package.json b/package.json index 3de1b0a..9395308 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "node-expat", - "version": "2.3.7", - "main": "./lib/node-expat", + "version": "2.3.8", + "main": "./lib/node-expat.js", "description": "NodeJS binding for fast XML parsing.", "keywords": [ "xml", @@ -12,16 +12,25 @@ "parsing" ], "scripts": { - "test": "vows --spec ./test/**/*.js" + "test": "vows --spec ./test/**/*.js", + "install": "node-pre-gyp install --fallback-to-build" }, "dependencies": { "bindings": "~1.2.1", "debug": "~2.1.0", "iconv": "~2.1.5", - "nan": "~1.7.0" + "nan": "~1.7.0", + "node-pre-gyp": "0.5.x" }, "devDependencies": { - "vows": ">=0.5.12" + "vows": ">=0.5.12", + "aws-sdk": "~2.0.0-rc.15" + }, + "bundledDependencies": ["node-pre-gyp"], + "binary": { + "module_name": "node_expat", + "module_path": "./lib/binding/", + "host": "https://github.com/node-xmpp/node-expat/releases/download/v2.3.8" }, "repository": { "type": "git",