Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 3d3b03e

Browse files
committed
build: Always grab the latest release of SQLite
This re-uses the same code we wrote yesterday for the DB4S AppImage build, as that seems to work decently well.
1 parent 6aba57f commit 3d3b03e

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

build_dbhub.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/sh
22

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+
37
# Useful variables
48
DEST=${PWD}/local
59
export PKG_CONFIG_PATH=${DEST}/lib/pkgconfig
@@ -22,18 +26,22 @@ if [ ! -e "${DEST}/lib/libsqlite3.so" ]; then
2226
if [ ! -d "other/cache" ]; then
2327
mkdir -p other/cache
2428
fi
25-
cd other/cache
29+
cd other/cache || exit 1
2630
if [ ! -f sqlite.tar.gz ]; then
2731
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
2937
fi
3038
if [ ! -f sqlite.tar.gz ]; then
3139
echo "Downloading the SQLite source code did not work"
32-
exit 1
40+
exit 3
3341
fi
3442
echo "Compiling local SQLite"
3543
tar xfz sqlite.tar.gz
36-
cd sqlite-autoconf-*
44+
cd sqlite-autoconf-* || exit 4
3745
./configure --prefix=${DEST} --enable-dynamic-extensions=no
3846
make -j9
3947
make install
@@ -50,19 +58,19 @@ yarn run webpack -c webui/webpack.config.js
5058
# Builds the Go binaries
5159
if [ -d "${GOBIN}" ]; then
5260
echo "Compiling DBHub.io API executable"
53-
cd api
61+
cd api || exit 5
5462
go install .
5563
cd ..
5664
echo "Compiling DBHub.io DB4S end point executable"
57-
cd db4s
65+
cd db4s || exit 6
5866
go install .
5967
cd ..
6068
echo "Compiling DBHub.io Live executable"
61-
cd live
69+
cd live || exit 7
6270
go install .
6371
cd ..
6472
echo "Compiling DBHub.io Web User Interface executable"
65-
cd webui
73+
cd webui || exit 8
6674
go install .
6775
cd ..
6876
fi

0 commit comments

Comments
 (0)