Skip to content

Commit

Permalink
switch from node-pre-gyp to prebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphtheninja committed Jul 26, 2015
1 parent c9fe03d commit a3f429d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ language: node_js

before_install:
- export JOBS=max
- npm install -g node-gyp-install
- node-gyp-install
- export prebuild_compile=true

node_js:
- "2.2"
Expand All @@ -13,7 +12,7 @@ node_js:
- "0.10"

install:
- npm install --build-from-source
- npm install

script:
- npm test
Expand Down
11 changes: 11 additions & 0 deletions binding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const bindings = require('bindings')
, opts = {
bindings : 'leveldown'
, try : [
[ 'module_root', 'build-pre-gyp', 'bindings' ]
, [ 'module_root', 'build', 'Debug', 'bindings' ]
, [ 'module_root', 'build', 'Release', 'bindings' ]
]
}

module.exports = bindings(opts).leveldown
4 changes: 2 additions & 2 deletions leveldown.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const util = require('util')
, AbstractLevelDOWN = require('abstract-leveldown').AbstractLevelDOWN

, binding = require('./prebuilt')
, binding = require('./binding')

, ChainedBatch = require('./chained-batch')
, Iterator = require('./iterator')
Expand Down Expand Up @@ -99,4 +99,4 @@ LevelDOWN.repair = function (location, callback) {
}


module.exports = LevelDOWN
module.exports = LevelDOWN
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"bindings": "~1.2.1",
"fast-future": "~1.0.0",
"nan": "~1.8.4",
"node-pre-gyp": "~0.6.2"
"prebuild": "~2.1.0"
},
"devDependencies": {
"async": "~1.0.0",
Expand All @@ -50,15 +50,11 @@
"tape": "~4.0.0"
},
"scripts": {
"install": "node-pre-gyp install --fallback-to-build",
"test": "tape test/*-test.js | faucet",
"prebuild": "node-pre-gyp rebuild && node-pre-gyp package"
"install": "prebuild --download",
"test": "tape test/*-test.js | faucet"
},
"license": "MIT",
"gypfile": true,
"bundledDependencies": [
"node-pre-gyp"
],
"binary": {
"module_name": "leveldown",
"module_path": "./build-pre-gyp/",
Expand Down
5 changes: 0 additions & 5 deletions prebuilt.js

This file was deleted.

0 comments on commit a3f429d

Please sign in to comment.