Note: All these steps have already been performed in this repository. This is just for reference to e.g. change the SQLCipher version.
Start from an official SQLCipher release tarball or a release tag, then build the amalgamation source.
curl -L https://github.com/sqlcipher/sqlcipher/archive/refs/tags/v4.14.0.tar.gz -o sqlcipher.tar.gz
tar xf sqlcipher.tar.gz
cd sqlcipher-4.14.0
./configure --enable-all --disable-tcl
make sqlite3.c
The build produces the files we vendor in deps/sqlcipher-amalgamation:
sqlite3.c
sqlite3.h
shell.c
sqlite3ext.h
VERSION # rename to VERSION.txt
Copy these files into deps/sqlcipher-amalgamation, renaming VERSION to VERSION.txt.
macOS no longer vendors OpenSSL in this repository. It uses SQLCipher's CommonCrypto provider through Security.framework.
Linux links against the system libcrypto.
Windows is not supported in this phase.
Run:
pnpm exec node-gyp rebuildThen run the tests:
pnpm testIf you want to verify the install path used by the published package, run pnpm install in a clean checkout and then rerun the tests.
This repository now builds SQLCipher with:
SQLITE_HAS_CODECSQLITE_EXTRA_INIT=sqlcipher_extra_initSQLITE_EXTRA_SHUTDOWN=sqlcipher_extra_shutdownSQLITE_TEMP_STORE=2
deps/sqlite3.gyp has been modified from the original node-sqlite3 one to:
- Use CommonCrypto on macOS.
- Link against system
libcryptoon Linux. - Add additional define statements required by SQLCipher.