Skip to content

Commit 578188e

Browse files
author
Dane Springmeyer
committed
add support for dynamically unpacking the bundled sqlite3 dep to avoid having to store the uncompressed files in git
1 parent f4630ff commit 578188e

40 files changed

+50
-208835
lines changed

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
21
build:
3-
node-gyp build
2+
npm install
43

54
clean:
65
rm test/support/big.db*
76
rm test/tmp/*
8-
node-gyp clean
7+
rm -rf ./deps/sqlite-autoconf-*/
8+
rm -rf ./build
99

1010
db:
1111
@if ! [ -f test/support/big.db ]; then \
@@ -15,7 +15,7 @@ db:
1515
echo "okay: database already created" ; \
1616
fi
1717

18-
test: build db
18+
test: db
1919
npm test
2020

2121
.PHONY: build clean test

binding.gyp

+36-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,48 @@
11
{
2+
'includes': [ 'deps/common-sqlite.gypi' ],
3+
'variables': {
4+
'sqlite%':'internal',
5+
},
26
'targets': [
7+
{
8+
'target_name': 'action_before_build',
9+
'type': 'none',
10+
'actions': [
11+
{
12+
'action_name': 'unpack_sqlite_dep',
13+
'inputs': [
14+
'./deps/sqlite-autoconf-<@(sqlite_version).tar.gz'
15+
],
16+
'outputs': [
17+
'./deps/sqlite-autoconf-<@(sqlite_version)'
18+
],
19+
'action': ['./node_modules/.bin/targz','deps/sqlite-autoconf-<@(sqlite_version).tar.gz','-x','deps/']
20+
}
21+
]
22+
},
323
{
424
'target_name': 'node_sqlite3',
25+
'conditions': [
26+
['sqlite != "internal"', {
27+
'libraries': [
28+
'-L<@(sqlite)/lib',
29+
'-lsqlite3'
30+
],
31+
'include_dirs': [ '<@(sqlite)/include' ]
32+
},
33+
{
34+
'dependencies': [
35+
'action_before_build',
36+
'deps/sqlite3.gyp:sqlite3'
37+
]
38+
}
39+
]
40+
],
541
'sources': [
642
'src/database.cc',
743
'src/node_sqlite3.cc',
844
'src/statement.cc'
945
],
10-
'dependencies': [
11-
'deps/sqlite3/binding.gyp:sqlite3'
12-
]
1346
}
1447
]
1548
}

deps/common-sqlite.gypi

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
'variables': {
3+
'sqlite_version%':'3071602'
4+
}
5+
}

deps/sqlite-autoconf-3071602.tar.gz

1.77 MB
Binary file not shown.

deps/sqlite3/binding.gyp renamed to deps/sqlite3.gyp

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
'includes': [ 'common-sqlite.gypi' ],
23
'target_defaults': {
34
'default_configuration': 'Debug',
45
'configurations': {
@@ -56,14 +57,7 @@
5657
'SQLITE_ENABLE_FTS3',
5758
'SQLITE_ENABLE_RTREE'
5859
],
59-
'sources': [ './sqlite3.c', ],
60-
},
61-
62-
{
63-
'target_name': 'shell',
64-
'type': 'executable',
65-
'dependencies': [ 'sqlite3' ],
66-
'sources': [ './shell.c' ]
60+
'sources': [ './sqlite-autoconf-<@(sqlite_version)/sqlite3.c', ],
6761
}
6862
]
6963
}

deps/sqlite3/INSTALL

-236
This file was deleted.

deps/sqlite3/Makefile.am

-19
This file was deleted.

0 commit comments

Comments
 (0)