Commit b9b49d48 by Dane Springmeyer

Merge pull request #473 from coolaj86/patch-2

correct instructions for building against sqlcipher
parents 1127c277 15ce4531
...@@ -136,16 +136,39 @@ Visit the “[Using Node modules](https://github.com/rogerwang/node-webkit/wiki/ ...@@ -136,16 +136,39 @@ Visit the “[Using Node modules](https://github.com/rogerwang/node-webkit/wiki/
## Building for sqlcipher ## Building for sqlcipher
For instructions for building sqlcipher see
[Building SQLCipher for node.js](https://coolaj86.com/articles/building-sqlcipher-for-node-js-on-raspberry-pi-2/)
To run node-sqlite3 against sqlcipher you need to compile from source by passing build options like: To run node-sqlite3 against sqlcipher you need to compile from source by passing build options like:
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/ npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/
If your sqlcipher is installed in a custom location, say if you installed it with homebrew on OS X you also need to do: node -e 'require("sqlite3")'
If your sqlcipher is installed in a custom location (if you compiled and installed it yourself),
you'll also need to to set some environment variables:
### On OS X with Homebrew
Set the location where `brew` installed it:
export LDFLAGS="-L`brew --prefix`/opt/sqlcipher/lib" export LDFLAGS="-L`brew --prefix`/opt/sqlcipher/lib"
export CPPFLAGS="-I`brew --prefix`/opt/sqlcipher/include" export CPPFLAGS="-I`brew --prefix`/opt/sqlcipher/include"
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix` npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix`
node -e 'require("sqlite3")'
### On most Linuxes (including Raspberry Pi)
Set the location where `make` installed it:
export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include -I/usr/local/include/sqlcipher"
export CXXFLAGS="$CPPFLAGS"
npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/local --verbose
node -e 'require("sqlite3")'
# Testing # Testing
[mocha](https://github.com/visionmedia/mocha) is required to run unit tests. [mocha](https://github.com/visionmedia/mocha) is required to run unit tests.
......
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