Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Rely on node-pre-gyp, prebuild binaries #486

Closed
wants to merge 4 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ binding.Makefile
binding.target.gyp.mk
gyp-mac-tool
out/

builds/
11 changes: 11 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@
],
}],
]
},
{
"target_name": "action_after_build",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than adding a 2nd compile target and linking back the original compiled binary, I think it would be better to add an optional condition passed at the command line during an npm install.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the compile target that node-pre-gyp is relying on.

"type": "none",
"dependencies": [ "<(module_name)" ],
"copies": [
{
"files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
"destination": "<(module_path)"
}
]
}
]
}
7 changes: 6 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
* Module dependencies.
*/

// Replaces `var zmq = require('./bindings')`;
var binary = require('node-pre-gyp');
var path = require('path');
var bindingPath = binary.find(path.resolve(path.join(__dirname, '..', 'package.json')));
var zmq = require(bindingPath);

var EventEmitter = require('events').EventEmitter
, zmq = require('bindings')('zmq.node')
, util = require('util');

/**
Expand Down
27 changes: 22 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,38 @@
"url": "http://github.com/JustinTulloss/zeromq.node.git"
},
"dependencies": {
"bindings": "~1.2.1",
"nan": "~2.1.0",
"bindings": "~1.2.1"
"node-pre-gyp": "^0.6.18"
},
"bundledDependencies": ["node-pre-gyp"],
"devDependencies": {
"should": "2.1.x",
"mocha": "~1.13.0",
"semver": "~4.1.1",
"mocha": "~1.13.0"
"should": "2.1.x"
},
"engines": {
"node": ">=0.8"
},
"scripts": {
"test": "mocha --expose-gc --slow 2000 --timeout 600000"
"test": "mocha --expose-gc --slow 2000 --timeout 600000",
"install": "node-pre-gyp install --fallback-to-build"
},
"keywords": ["zeromq", "zmq", "0mq", "ømq", "libzmq", "native", "binding", "addon"],
"binary": {
"module_name": "zmq",
"module_path": "./builds",
"host": "NONE"
},
"keywords": [
"zeromq",
"zmq",
"0mq",
"ømq",
"libzmq",
"native",
"binding",
"addon"
],
"license": "MIT",
"author": "Justin Tulloss <justin.tulloss@gmail.com> (http://justin.harmonize.fm)",
"contributors": [
Expand Down