Permalink
Browse files

add docs for building against sqlcipher

  • Loading branch information...
Dane Springmeyer
Dane Springmeyer committed Feb 26, 2014
1 parent a01efe7 commit a3693f5831e68ee9b2c5114c34615a10bb22dc42
Showing with 35 additions and 26 deletions.
  1. +35 −26 README.md
View
@@ -67,6 +67,34 @@ It is also possible to make your own build of `sqlite3` from its source instea
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).
+# BUILDING FROM THE SOURCE
+
+Unless building via `npm install` (which uses its own `node-gyp`) you will need `node-gyp` installed globally:
+
+ npm install node-gyp -g
+
+The sqlite3 module depends only on libsqlite3. However, by default, an internal/bundled copy of sqlite will be built and statically linked, so an externally installed sqlite3 is not required.
+
+If you wish to install against an external sqlite then you need to pass the `--sqlite` argument to `node-gyp`, `npm install` or the `configure` wrapper.
+
+ ./configure --sqlite=/usr/local
+ make
+
+Or, using the node-gyp directly:
+
+ node-gyp --sqlite=/usr/local
+ make
+
+Or, using npm:
+
+ npm install --sqlite=/usr/local
+
+If building against an external sqlite3 make sure to have the development headers available. Mac OS X ships with these by default. If you don't have them installed, install the `-dev` package with your package manager, e.g. `apt-get install libsqlite3-dev` for Debian/Ubuntu. Make sure that you have at least `libsqlite3` >= 3.6.
+
+Note, if building against homebrew-installed sqlite on OS X you can do:
+
+ ./configure --sqlite=/usr/local/opt/sqlite/
+ make
# REBUILDING FOR NODE-WEBKIT
@@ -93,36 +121,17 @@ Remember the following:
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.
+# BUILDING AGAINST SQLCIPHER
-# BUILDING FROM THE SOURCE
-
-Unless building via `npm install` (which uses its own `node-gyp`) you will need `node-gyp` installed globally:
-
- npm install node-gyp -g
-
-The sqlite3 module depends only on libsqlite3. However, by default, an internal/bundled copy of sqlite will be built and statically linked, so an externally installed sqlite3 is not required.
-
-If you wish to install against an external sqlite then you need to pass the `--sqlite` argument to `node-gyp`, `npm install` or the `configure` wrapper.
+To run node-sqlite3 against sqlcipher you need to compile from source by passing build options like:
- ./configure --sqlite=/usr/local
- make
-
-Or, using the node-gyp directly:
+ npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=/usr/
- node-gyp --sqlite=/usr/local
- make
-
-Or, using npm:
-
- npm install --sqlite=/usr/local
-
-If building against an external sqlite3 make sure to have the development headers available. Mac OS X ships with these by default. If you don't have them installed, install the `-dev` package with your package manager, e.g. `apt-get install libsqlite3-dev` for Debian/Ubuntu. Make sure that you have at least `libsqlite3` >= 3.6.
-
-Note, if building against homebrew-installed sqlite on OS X you can do:
-
- ./configure --sqlite=/usr/local/opt/sqlite/
- make
+If your sqlcipher is installed in a custom location, say if you installed it with homebrew on OS X you also need to do:
+ export LDFLAGS="-L`brew --prefix`/opt/sqlcipher/lib"
+ export CPPFLAGS="-I/`brew --prefix`opt/sqlcipher/include"
+ npm install sqlite3 --build-from-source --sqlite_libname=sqlcipher --sqlite=`brew --prefix`
# TESTING

0 comments on commit a3693f5

Please sign in to comment.