Commit f552560c by King Koopa

Update for NAN 1.0.0

parents cacde384 c590f6af
......@@ -3,12 +3,16 @@ language: cpp
env:
matrix:
- export NODE_VERSION="0.8"
- export NODE_VERSION="0.10" NODE_WEBKIT="0.8.4"
- export NODE_VERSION="0.10" NODE_WEBKIT="0.8.6"
global:
- secure: QhuP5E/kYL1j1KDkHGJtk6DSJr1RH4DR/JrC62Viuf5Du8jE+i0kPWfF2MxtuEmKo35orhpu8t8mzKygWfuO63WPuuIE9qd/+V/y99Lqcj0tEN6wJ5RnywktbTJWg23zphjhmYq3Xj8DLVEikCZBwHtlbygkO9Q60cn1PK+bnPg=
- secure: HxCS2dQAWI0KmCFnFNNZoucG4FeAW+itG7+Hp0dNtwmxZzGOZYFO2bZcGvTAMNfVN++oqLxTebYQI1oB5yUl5mPJjrjthaGS6Zq3S6rfJcXiv+icYgEXlR6ejQ97dsHw1Jeg8nedCQlI4kHfvG6pgBLhq9hnugxH1Cjhdt14E9U=
before_install:
# check if tag exists and matches package.json
- scripts/validate_tag.sh
# get commit message
- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
# put node-pre-gyp on path
- export PATH=./node_modules/.bin/:$PATH
- echo $NODE_VERSION
......@@ -18,7 +22,7 @@ before_install:
- nvm use $NODE_VERSION
- node --version
- npm --version
- npm install mocha
- npm install mocha aws-sdk
- platform=$(uname -s | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/")
install:
......@@ -28,15 +32,14 @@ install:
before_script:
# test publishing
- echo $TRAVIS_BRANCH
- echo $TRAVIS_COMMIT
- echo `git describe --tags --always HEAD`
- PUBLISH=false
- if [ "[publish]" = `git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n'` ]; then echo yes;PUBLISH=true; fi;
- if [[ `git describe --contains $( git rev-parse HEAD )` ]]; then echo yes;PUBLISH=true; fi;
- if [[ $PUBLISH == true ]]; then node-pre-gyp package publish; fi
- PUBLISH_BINARY=false
# check if this is a git tag built statically to be portable
#- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then echo PUBLISH_BINARY;PUBLISH_BINARY=true; fi;
# or check if we are manually requesting binary publishing via a commit keyword
- if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then echo PUBLISH_BINARY;PUBLISH_BINARY=true; fi;
- if [[ ${PUBLISH_BINARY} == true ]]; then node-pre-gyp package publish; fi
# for testing node-webkit, launch a virtual display
- if [ "$NODE_WEBKIT" != "" ]; then export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start; fi
- if [ "$NODE_WEBKIT" != "" ]; then export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start +extension RANDR; fi
# note: `sleep 3` gives xvfb some time to start
script:
......@@ -55,7 +58,7 @@ script:
# on Linux 64 bit: rebuild node-sqlite3 for 64 bit node-webkit target (if NODE_WEBKIT is not empty)
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then node-pre-gyp rebuild --runtime=node-webkit --target=$NODE_WEBKIT; fi; fi
# on Linux 64 bit: download and unpack node-webkit, add it to PATH
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then wget https://s3.amazonaws.com/node-webkit/v${NODE_WEBKIT}/node-webkit-v${NODE_WEBKIT}-linux-x64.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then wget http://dl.node-webkit.org/v${NODE_WEBKIT}/node-webkit-v${NODE_WEBKIT}-linux-x64.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then tar xf node-webkit-v${NODE_WEBKIT}-linux-x64.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then prenwpath="$PATH"; export PATH=$(pwd)/node-webkit-v${NODE_WEBKIT}-linux-x64:$PATH; fi; fi
# on Linux 64 bit: ldd nw
......@@ -78,7 +81,7 @@ script:
- if [[ "$platform" == 'linux' ]]; then CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source; else npm install --build-from-source; fi
- npm test
# publish 32 bit build
- if [[ $PUBLISH == true ]]; then node-pre-gyp package publish; fi;
- if [[ ${PUBLISH_BINARY} == true ]]; then node-pre-gyp package publish; fi;
# install nw-gyp in 32 bit environment if NODE_WEBKIT is not empty (but on Linux it's installed earlier on 64 bit)
- if [ "$platform" != 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then npm install nw-gyp -g; fi; fi
# rebuild node-sqlite3 for 32 bit node-webkit target (if NODE_WEBKIT is not empty)
......@@ -104,7 +107,7 @@ script:
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libdbus-1-3:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libudev0:i386; fi; fi
# on Linux 32 bit: download and unpack node-webkit, add it to PATH
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then wget https://s3.amazonaws.com/node-webkit/v${NODE_WEBKIT}/node-webkit-v${NODE_WEBKIT}-linux-ia32.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then wget http://dl.node-webkit.org/v${NODE_WEBKIT}/node-webkit-v${NODE_WEBKIT}-linux-ia32.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then tar xf node-webkit-v${NODE_WEBKIT}-linux-ia32.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then prenwpath="$PATH"; export PATH=$(pwd)/node-webkit-v${NODE_WEBKIT}-linux-ia32:$PATH; fi; fi
# on Linux 32 bit: ldd nw
......
# Changlog
## 2.2.3
- Fixed regression in v2.2.2 for installing from binaries on windows.
## 2.2.2
- Fixed packaging problem whereby a `config.gypi` was unintentially packaged and could cause breakages for OS X builds.
## 2.2.1
- Now shipping with 64bit FreeBSD binaries against both node v0.10.x and node v0.8.x.
- Fixed solaris/smartos source compile by passing `-std=c99` when building internally bundled libsqlite3 (#201)
- Reduced size of npm package by ignoring tests and examples.
- Various fixes and improvements for building against node-webkit
- Upgraded to node-pre-gyp@0.5.x from node-pre-gyp@0.2.5
- Improved ability to build from source against `sqlcipher` by passing custom library name: `--sqlite_libname=sqlcipher`
- No changes to C++ Core / Existing binaries are exactly the same
## 2.2.0
Released Jan 13th, 2014
......
Asynchronous, non-blocking [SQLite3](http://sqlite.org/) bindings for [Node.js](http://nodejs.org/).
[![NPM](https://nodei.co/npm/sqlite3.png)](https://nodei.co/npm/sqlite3/)
[![NPM](https://nodei.co/npm/sqlite3.png?downloads=true)](https://nodei.co/npm/sqlite3/)
[![Build Status](https://travis-ci.org/mapbox/node-sqlite3.png?branch=master)](https://travis-ci.org/mapbox/node-sqlite3)
[![npm package version](https://badge.fury.io/js/sqlite3.png)](https://npmjs.org/package/sqlite3)
[![Build Status](https://travis-ci.org/mapbox/node-sqlite3.svg?branch=master)](https://travis-ci.org/mapbox/node-sqlite3)
[![Build status](https://ci.appveyor.com/api/projects/status/d5dfp6cmo5fmh2a8/branch/master)](https://ci.appveyor.com/project/springmeyer/node-sqlite3)
## Depends
- Node.js v0.8.x or v0.10.x
- Node.js v0.10.x or v0.8.x
Binaries for most Node versions and platforms are provided by default via [node-pre-gyp](https://github.com/springmeyer/node-pre-gyp).
......@@ -67,7 +68,7 @@ and thus your system must meet [node-gyp's requirements](https://github.com/T
It is also possible to make your own build of `sqlite3` from its source instead of its npm package ([see below](#building-from-the-source)).
It is possible to use the installed package in [node-webkit](https://github.com/rogerwang/node-webkit) instead of the vanilla Node.js, but a rebuild is required before use (see the next section).
It is possible to use the installed package in [node-webkit](https://github.com/rogerwang/node-webkit) instead of the vanilla Node.js. See [Building for node-webkit](#building-for-node-webkit) for details.
## Source install
......@@ -100,26 +101,33 @@ Note, if building against homebrew-installed sqlite on OS X you can do:
## Building for node-webkit
Because of ABI differences, only a rebuilt version of `sqlite3` can be used in [node-webkit](https://github.com/rogerwang/node-webkit).
Because of ABI differences, `sqlite3` must be built in a custom to be used with [node-webkit](https://github.com/rogerwang/node-webkit).
After the `sqlite3` module is installed (according to the previous section), do the following:
To build node-sqlite3 for node-webkit:
1. Install [`nw-gyp`](https://github.com/rogerwang/nw-gyp) globally: `npm install nw-gyp -g` *(unless already installed)*
2. Use `nw-gyp` to rebuild the module:
2. Build the module with the custom flags of `--runtime`, `--target_arch`, and `--target`:
```
```sh
NODE_WEBKIT_VERSION="0.8.4" # see latest version at https://github.com/rogerwang/node-webkit#downloads
nw-gyp rebuild --target=${NODE_WEBKIT_VERSION}
npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION)
```
This command internally calls out to [`node-pre-gyp`](https://github.com/mapbox/node-pre-gyp) which itself calls out to [`nw-gyp`](https://github.com/rogerwang/nw-gyp) when the `--runtime=node-webkit` option is passed.
You can also run this command from within a `node-sqlite3` checkout:
```sh
npm install --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION)
```
Remember the following:
* In the `nw-gyp rebuild` command, specify the actual target version of your node-webkit. The command must be run in sqlite3's directory (where its `package.json` resides).
* You must provide the right `--target_arch` flag. `ia32` is needed to target 32bit node-webkit builds, while `x64` will target 64bit node-webkit builds (if available for your platform).
* After the `sqlite3` package is rebuilt for node-webkit it cannot run in the vanilla Node.js (and vice versa).
* After the `sqlite3` package is built for node-webkit it cannot run in the vanilla Node.js (and vice versa).
* For example, `npm test` of the node-webkit's package would fail.
* If you need `sqlite3` package both for Node.js and node-webkit, then you should make two separate installations of `sqlite3` (in different directories) and rebuild only one of them for node-webkit.
Visit the “[Using Node modules](https://github.com/rogerwang/node-webkit/wiki/Using-Node-modules)” article in the node-webkit's wiki for more details.
......
environment:
matrix:
- nodejs_version: 0.8
- nodejs_version: 0.10
platform:
- x64
- x86
install:
- ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version)
- node --version
- npm --version
# ensure python is on path so that srs_settings.js are generated
- cmd: SET PATH=c:\python27;%PATH%
- npm install --build-from-source
- npm install mocha
- npm test
build: OFF
test: OFF
test_script: OFF
deploy: OFF
{
'variables': {
'sqlite_version%':'3080200'
'sqlite_version%':'3080403'
}
}
\ No newline at end of file
{
'includes': [ 'common-sqlite.gypi' ],
'target_defaults': {
'default_configuration': 'Debug',
'default_configuration': 'Release',
'cflags':[
'-std=c99'
],
'configurations': {
'Debug': {
'defines': [ 'DEBUG', '_DEBUG' ],
......
......@@ -26,9 +26,7 @@ sqlite3.cached = {
return new Database(file, a, b);
}
if (file[0] !== '/') {
file = path.join(process.cwd(), file);
}
file = path.resolve(file);
if (!sqlite3.cached.objects[file]) {
var db =sqlite3.cached.objects[file] = new Database(file, a, b);
......
{
"name": "sqlite3",
"description": "Asynchronous, non-blocking SQLite3 bindings",
"version": "2.2.0",
"version": "2.2.3",
"homepage": "http://github.com/mapbox/node-sqlite3",
"author": {
"name": "MapBox",
......@@ -36,8 +36,8 @@
"url": "git://github.com/mapbox/node-sqlite3.git"
},
"dependencies": {
"node-pre-gyp": "0.5.x",
"nan": "git://github.com/rvagg/nan.git#0.9-wip"
"node-pre-gyp": "0.5.13",
"nan": "1.0.0"
},
"bundledDependencies": [
"node-pre-gyp"
......
File mode changed from 100644 to 100755
#!/bin/bash
set -u
# let's catch the case where we tag but
# forget to increment the package.json version
# check if we are on a tag
if [ `git describe --tags --always HEAD` ]; then
echo 'looks like we are on a tag'
if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then
echo 'git reports the same tag as travis'
# now check to make sure package.json `version` matches
MODULE_VERSION=$(node -e "console.log(require('./package.json').version)")
if [[ $MODULE_VERSION != $TRAVIS_BRANCH ]] && [[ v$MODULE_VERSION != $TRAVIS_BRANCH ]]; then
echo "package.json version ($MODULE_VERSION) does not match tag ($TRAVIS_BRANCH)"
exit 1
else
echo "Validation success: package.json ($MODULE_VERSION) matches tag ($TRAVIS_BRANCH)"
fi
else
echo "warning: travis thinks the tag ($TRAVIS_BRANCH) differs from git (`git describe --tags --always HEAD`)"
fi
fi
......@@ -26,7 +26,7 @@ public:
: callback(cb_), parent(parent_) {
watcher.data = this;
NODE_SQLITE3_MUTEX_INIT
uv_async_init(uv_default_loop(), &watcher, listener);
uv_async_init(uv_default_loop(), &watcher, reinterpret_cast<uv_async_cb>(listener));
}
static void listener(uv_async_t* handle, int status) {
......
......@@ -592,7 +592,7 @@ void Statement::Work_BeginEach(Baton* baton) {
// Only create the Async object when we're actually going into
// the event loop. This prevents dangling events.
EachBaton* each_baton = static_cast<EachBaton*>(baton);
each_baton->async = new Async(each_baton->stmt, AsyncEach);
each_baton->async = new Async(each_baton->stmt, reinterpret_cast<uv_async_cb>(AsyncEach));
NanAssignPersistent(each_baton->async->item_cb, each_baton->callback);
NanAssignPersistent(each_baton->async->completed_cb, each_baton->completed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment