Skip to content

Commit e8322e1

Browse files
committed
Update some config and instructions.
1 parent 8411f7f commit e8322e1

6 files changed

Lines changed: 30 additions & 71 deletions

File tree

CONTRIBUTING.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Contributing
22

3-
General guidelines for contributing to node-sqlite3
3+
General guidelines for contributing to node-sqlcipher.
44

5-
## Install Help
5+
# Testing
66

7-
If you've landed here due to a failed install of `node-sqlite3` then feel free to create a [new issue](https://github.com/mapbox/node-sqlite3/issues/new) to ask for help. The most likely problem is that we do not yet provide pre-built binaries for your particular platform and so the `node-sqlite3` install attempted a source compile but failed because you are missing the [dependencies for node-gyp](https://github.com/TooTallNate/node-gyp#installation). But please provide as much detail on your problem as possible and we'll try to help. Please include:
8-
- terminal logs of failed install (preferably from running `npm install sqlite3 --loglevel=info`)
9-
- `node-sqlite3` version you tried to install
10-
- node version you are running
11-
- operating system and architecture you are running, e.g. `Windows 7 64 bit`.
7+
[mocha](https://github.com/visionmedia/mocha) is required to run unit tests.
8+
9+
In sqlite3's directory (where its `package.json` resides) run the following:
10+
11+
npm install --build-from-source
12+
npm test
1213

1314
## Developing / Pre-release
1415

@@ -36,13 +37,7 @@ git commit --allow-empty -m "[publish binary]"
3637

3738
**3)** Ensure binaries built
3839

39-
Check the travis and appveyor pages to ensure they are all green as an indication that the `[publish binary]` command worked.
40-
41-
If you need to republish binaries you can do this with the command below, however this should not be a common thing for you to do!
42-
43-
```sh
44-
git commit --allow-empty -m "[republish binary]"
45-
```
40+
Check the CircleCI pages to ensure they are all green as an indication that the `[publish binary]` command worked.
4641

4742
Note: NEVER republish binaries for an existing released version.
4843

README.md

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,10 @@ A copy of the source for SQLCipher 4.4.2 is bundled, which is based on SQLite 3.
5353

5454
## Building from source.
5555

56-
This is done automatically by node-pre-gyp when installing on a platform without pre-built binaries. This should generally
57-
not be required with later versions, since two pre-built versions (N-API 3 and N-API 6) cover all electron and node versions.
56+
Building from source when installing the package is only supported up to version 5.2.0.
5857

59-
However, this does require some additional setup, and is likely to run against obscure errors when installing.
60-
61-
Requirements:
62-
63-
### Mac
64-
65-
* `brew install openssl@1.1`
66-
67-
### Windows
68-
69-
* Visual Studio 2015
70-
* Python 2.7
58+
The two pre-built versions (N-API 3 and N-API 6) cover all electron and node versions, so building from source should
59+
not be required.
7160

7261
## Usage with electron-forge / electron-rebuild
7362

@@ -97,7 +86,7 @@ SQLCipher depends on OpenSSL.
9786

9887
For Windows, we bundle OpenSSL 1.1.1i. Binaries are generated using [vckpg](https://github.com/microsoft/vcpkg) (e.g., `.\vcpkg\vcpkg install openssl:x64-windows-static`).
9988

100-
On Mac we build against OpenSSL installed via brew, but statically link it so that end-users do not need to install it.
89+
On Mac we bundle OpenSSL 1.1.1l.
10190

10291
On Linux we dynamically link against the system OpenSSL.
10392

@@ -107,24 +96,6 @@ See the [API documentation](https://github.com/mapbox/node-sqlite3/wiki) in the
10796

10897
Documentation for the SQLCipher extension is available [here](https://www.zetetic.net/sqlcipher/sqlcipher-api/).
10998

110-
# Testing
111-
112-
[mocha](https://github.com/visionmedia/mocha) is required to run unit tests.
113-
114-
In sqlite3's directory (where its `package.json` resides) run the following:
115-
116-
npm install --build-from-source
117-
npm test
118-
119-
# Publishing
120-
121-
To publish a new version, run:
122-
123-
npm version minor -m "%s [publish binary]"
124-
npm publish
125-
126-
Publishing of the prebuilt binaries is performed on CircleCI.
127-
12899
# Acknowledgments
129100

130101
Most of the work in this library is from the [node-sqlite3](https://github.com/mapbox/node-sqlite3) library by [MapBox](https://mapbox.com/).

SQLCipher.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ The above produces 4 files of interest:
2222
```
2323
sqlite3.c
2424
sqlite3.h
25-
shell.c # optional
26-
sqlite3ext.h # optional
27-
VERSION # optional
25+
shell.c
26+
sqlite3ext.h
27+
VERSION # rename to VERSION.txt
2828
```
2929

30-
The files are copied to: `sqlcipher-amalgamation-<version>`.
30+
Copy these files to: `deps/sqlcipher-amalgamation`.
3131

3232
## Step 2: Get OpenSSL libraries
3333

34-
NodeJS typically includes OpenSSL. However, for Electron on Windows, we need to bundle a copy.
34+
NodeJS typically includes OpenSSL. However, to support Electron, we statically link against libcrypto from OpenSSL.
3535

3636
Run the following commands to generate the latest OpenSSL libs for Windows:
3737

@@ -40,25 +40,15 @@ cd deps
4040
.\openssl-windows.bat
4141
```
4242

43-
... this will output the libs in `deps/openssl-windows` (OpenSSL-WinXX), including the header files in `deps/openssl-windows/openssl-include`. Every arch-specific folder includes these binaries:
43+
... this will output the libs in `deps/` (OpenSSL-WinXX), including the header files in `deps/openssl-include`. Every arch-specific folder includes these binaries:
4444

4545
```
4646
libcrypto.lib
4747
libssl.lib
4848
ossl_static.pdb
4949
```
5050

51-
Copy all folders under `deps/openssl-windows` to `sqlcipher-amalgamation-<version>`.
52-
53-
## Step 3: Build the archive
54-
55-
Archive the folder as `deps/sqlcipher-amalgamation-<version>.tar.gz`, and update the version number in `common-sqlite.gypi` (must be the same).
56-
57-
```
58-
tar czf sqlcipher-amalgamation-$VERSION.tar.gz sqlcipher-amalgamation-$VERSION
59-
```
60-
61-
## Step 4: Test the build
51+
## Step 3: Test the build
6252

6353
Run:
6454

@@ -78,7 +68,7 @@ npm run test
7868
The OpenSSL files are specifically required for Electron, which doesn't bundle OpenSSL like NodeJS does. The header and .lib files are required at compile-time. We bundle a statically-linked version of OpenSSL with the library, so the user does not need to manually install OpenSSL.
7969

8070
`deps/sqlite3.gyp` has been modified from the original node-sqlite3 one to:
81-
* Use the bundled OpenSSL on Windows.
71+
* Use the bundled OpenSSL on Windows and MacOS.
8272
* Add additional define statements required by SQLCipher.
8373

8474

deps/common-sqlite.gypi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
'variables': {
3-
'sqlite_version%':'3033000',
43
"toolset%":''
54
},
65
'target_defaults': {

deps/openssl-windows.bat

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ if %errorlevel% neq 0 exit /b %errorlevel%
88
.\vcpkg\vcpkg install openssl:arm64-windows-static
99
if %errorlevel% neq 0 exit /b %errorlevel%
1010

11-
if not exist .\openssl-windows mkdir .\openssl-windows .\openssl-windows\OpenSSL-Win64 .\openssl-windows\OpenSSL-Win32 .\openssl-windows\OpenSSL-Win64-ARM .\openssl-windows\openssl-include\openssl
11+
if not exist .\OpenSSL-Win32 mkdir .\OpenSSL-Win32
12+
if not exist .\OpenSSL-Win64 mkdir .\OpenSSL-Win64
13+
if not exist .\OpenSSL-Win64-ARM mkdir .\OpenSSL-Win64-ARM
14+
if not exist .\openssl-include mkdir .\openssl-include
1215

13-
copy .\vcpkg\installed\x64-windows-static\lib\*.* .\openssl-windows\OpenSSL-Win64
14-
copy .\vcpkg\installed\x64-windows-static\include\openssl\*.* .\openssl-windows\openssl-include\openssl
15-
copy .\vcpkg\installed\x86-windows-static\lib\*.* .\openssl-windows\OpenSSL-Win32
16-
copy .\vcpkg\installed\arm64-windows-static\lib\*.* .\openssl-windows\OpenSSL-Win64-ARM
16+
copy .\vcpkg\installed\x64-windows-static\lib\*.* .\OpenSSL-Win64
17+
copy .\vcpkg\installed\x64-windows-static\include\openssl\*.* .\openssl-include\openssl
18+
copy .\vcpkg\installed\x86-windows-static\lib\*.* .\OpenSSL-Win32
19+
copy .\vcpkg\installed\arm64-windows-static\lib\*.* .\OpenSSL-Win64-ARM

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"lib/**/*.js",
7373
"sqlite3.js",
7474
"src",
75+
"deps",
7576
"*.gyp"
7677
]
7778
}

0 commit comments

Comments
 (0)