1
1
#! /bin/sh
2
2
3
+ # TODO: Consider adding the same extensions to the SQLite compile here, that we use
4
+ # in our macOS, AppImage (etc) builds. Then add the function names to the allowed
5
+ # list for the API Query() function
6
+
3
7
# Useful variables
4
8
DEST=${PWD} /local
5
9
export PKG_CONFIG_PATH=${DEST} /lib/pkgconfig
@@ -22,18 +26,22 @@ if [ ! -e "${DEST}/lib/libsqlite3.so" ]; then
22
26
if [ ! -d " other/cache" ]; then
23
27
mkdir -p other/cache
24
28
fi
25
- cd other/cache
29
+ cd other/cache || exit 1
26
30
if [ ! -f sqlite.tar.gz ]; then
27
31
echo " Downloading SQLite source code"
28
- curl -sL -o sqlite.tar.gz https://sqlite.org/2023/sqlite-autoconf-3410100.tar.gz
32
+ TARBALL=$( curl -s https://sqlite.org/download.html | awk ' /<!--/,/-->/ {print}' | grep ' sqlite-autoconf' | cut -d ' ,' -f 3)
33
+ SHA3=$( curl -s https://sqlite.org/download.html | awk ' /<!--/,/-->/ {print}' | grep ' sqlite-autoconf' | cut -d ' ,' -f 5)
34
+ curl -LsS -o sqlite.tar.gz https://sqlite.org/${TARBALL}
35
+ VERIFY=$( openssl dgst -sha3-256 sqlite.tar.gz | cut -d ' ' -f 2)
36
+ if [ " $SHA3 " != " $VERIFY " ]; then exit 2 ; fi
29
37
fi
30
38
if [ ! -f sqlite.tar.gz ]; then
31
39
echo " Downloading the SQLite source code did not work"
32
- exit 1
40
+ exit 3
33
41
fi
34
42
echo " Compiling local SQLite"
35
43
tar xfz sqlite.tar.gz
36
- cd sqlite-autoconf-*
44
+ cd sqlite-autoconf-* || exit 4
37
45
./configure --prefix=${DEST} --enable-dynamic-extensions=no
38
46
make -j9
39
47
make install
@@ -50,19 +58,19 @@ yarn run webpack -c webui/webpack.config.js
50
58
# Builds the Go binaries
51
59
if [ -d " ${GOBIN} " ]; then
52
60
echo " Compiling DBHub.io API executable"
53
- cd api
61
+ cd api || exit 5
54
62
go install .
55
63
cd ..
56
64
echo " Compiling DBHub.io DB4S end point executable"
57
- cd db4s
65
+ cd db4s || exit 6
58
66
go install .
59
67
cd ..
60
68
echo " Compiling DBHub.io Live executable"
61
- cd live
69
+ cd live || exit 7
62
70
go install .
63
71
cd ..
64
72
echo " Compiling DBHub.io Web User Interface executable"
65
- cd webui
73
+ cd webui || exit 8
66
74
go install .
67
75
cd ..
68
76
fi
0 commit comments