Skip to content

Commit f55cf5e

Browse files
committed
Fixing binary releases.
Point to an agreeable path, pull in things required for binary building fallback. Add the necessary stuff to bindings.gyp for node-pre-gyp. Make an index.js that can find the binary module.
1 parent 3ce6aef commit f55cf5e

File tree

4 files changed

+29
-9
lines changed

4 files changed

+29
-9
lines changed

binding.gyp

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
11
{
22
"targets": [
33
{
4-
"target_name": "autovivify",
4+
"target_name": "<(module_name)",
55
"sources": [
66
"autovivify.cc"
77
],
88
"include_dirs": [
99
"<!(node -e \"require('nan')\")"
1010
]
11+
},
12+
{
13+
"target_name": "action_after_build",
14+
"type": "none",
15+
"dependencies": [
16+
"<(module_name)"
17+
],
18+
"copies": [
19+
{
20+
"files": [
21+
"<(PRODUCT_DIR)/<(module_name).node"
22+
],
23+
"destination": "<(module_path)"
24+
}
25+
]
1126
}
1227
]
1328
}

index.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
var binary = require('node-pre-gyp')
2+
var path = require('path')
3+
var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')))
4+
module.exports = require(binding_path)

package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"name": "autovivify",
33
"description": "Automatic creation of subobjects and arrays",
4-
"main": "build/Release/autovivify",
4+
"main": "index.js",
55
"scripts": {
66
"test": "mocha",
7-
"install": "node-gyp rebuild"
7+
"install": "node-pre-gyp install --fallback-to-build"
88
},
99
"binary": {
1010
"module_name": "autovivify",
11-
"module_path": "build/Release",
11+
"module_path": "./build/{configuration}/{node_abi}-{platform}-{arch}/",
12+
"package_name": "autovivify-{node_abi}-{platform}-{arch}.tar.gz",
1213
"host": "https://github.com/allenluce/node-autovivify/releases/download/{version}"
1314
},
1415
"author": "Allen Luce",
@@ -22,22 +23,22 @@
2223
"bindings": "^1.2.1",
2324
"chai": "^3.5.0",
2425
"cz-conventional-changelog": "^1.1.5",
25-
"mocha": "^3.1.2",
26-
"nan": "^2.2.0",
27-
"node-gyp": "^3.2.1"
26+
"mocha": "^3.1.2"
2827
},
2928
"config": {
3029
"commitizen": {
3130
"path": "./node_modules/cz-conventional-changelog"
3231
}
3332
},
34-
"version": "1.0.8",
33+
"version": "1.0.11",
3534
"engines": {
3635
"node": ">= 0.10",
3736
"iojs": ">= 1.0.0"
3837
},
3938
"dependencies": {
4039
"aws-sdk": "^2.6.9",
40+
"nan": "^2.2.0",
41+
"node-gyp": "^3.2.1",
4142
"node-pre-gyp": "^0.6.30",
4243
"node-pre-gyp-github": "^1.3.1"
4344
}

test/test-autovivify.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* global describe it beforeEach */
22
const expect = require('chai').expect
3-
const Av = require('bindings')('autovivify')
3+
const Av = require('..')
44
const eql = require('./equal')
55

66
describe('Autovivify', function () {

0 commit comments

Comments
 (0)