Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add preliminary node-pre-gyp support #116

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
}
]
}
]
}
7 changes: 5 additions & 2 deletions lib/node-expat.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -109,4 +112,4 @@ exports.createParser = function(cb) {
parser.on('startElement', cb)
}
return parser
}
}
19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down