Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #188 from ralphtheninja/prebuilt
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphtheninja committed Jun 1, 2015
2 parents 07d7bc7 + 25d5f62 commit ddcc9ce
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
build/
build-pre-gyp/
libleveldb.so
libleveldb.a
leakydb
Expand Down
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ language: node_js

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

node_js:
- "2.0.0"
- "1.8.1"
- "2.2"
- "2.1"
- "2.0"
- "1.8"
- "0.12"
- "0.10"

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ See the [contribution guide](https://github.com/Level/community/blob/master/CONT
A large portion of the Windows support comes from code by [Krzysztof Kowalczyk](http://blog.kowalczyk.info/) [@kjk](https://twitter.com/kjk), see his Windows LevelDB port [here](http://code.google.com/r/kkowalczyk-leveldb/). If you're using LevelUP on Windows, you should give him your thanks!


Prebuilt binaries
-----------------

LevelDOWN uses `node-pre-gyp` to support prebuilt binaries. For a list of supported prebuilt platform binaries see https://github.com/Level/leveldown/releases

<a name="license"></a>
License &amp; copyright
-------------------
Expand Down
12 changes: 11 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,15 @@
, "src/leveldown.cc"
, "src/leveldown_async.cc"
]
}]
}, {
"target_name": "action_after_build",
"type": "none",
"dependencies": [ "<(module_name)" ],
"copies": [
{
"files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
"destination": "<(module_path)"
}
]
}]
}
2 changes: 1 addition & 1 deletion 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('bindings')('leveldown.node').leveldown
, binding = require('./prebuilt')

, ChainedBatch = require('./chained-batch')
, Iterator = require('./iterator')
Expand Down
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"abstract-leveldown": "~2.4.0",
"bindings": "~1.2.1",
"fast-future": "~1.0.0",
"nan": "~1.8.4"
"nan": "~1.8.4",
"node-pre-gyp": "~0.6.2"
},
"devDependencies": {
"async": "~1.0.0",
Expand All @@ -49,8 +50,19 @@
"tape": "~4.0.0"
},
"scripts": {
"test": "tape test/*-test.js | faucet"
"install": "node-pre-gyp install --fallback-to-build",
"test": "tape test/*-test.js | faucet",
"prebuild": "node-pre-gyp rebuild && node-pre-gyp package"
},
"license": "MIT",
"gypfile": true
"gypfile": true,
"bundledDependencies": [
"node-pre-gyp"
],
"binary": {
"module_name": "leveldown",
"module_path": "./build-pre-gyp/",
"host": "https://github.com/level/leveldown/releases/download",
"remote_path": "./v{version}"
}
}
5 changes: 5 additions & 0 deletions prebuilt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var binary = require('node-pre-gyp');
var path = require('path');
var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));

module.exports = require(binding_path).leveldown;

0 comments on commit ddcc9ce

Please sign in to comment.