-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.sh
executable file
·41 lines (33 loc) · 1.46 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -eo pipefail
# Cleanup old files.
rm -f sqlite-src-*.zip
rm -rf sqlite-src-*/
rm -rf build/
touch build.log
BUILD_LOG="$(realpath build.log)"
echo -e "Built on $(date -u '+%Y-%m-%dT%H:%M:%SZ')\n" | tee "$BUILD_LOG"
echo "Toolchain versions" | tee -a "$BUILD_LOG"
emcc --version | head -n1 | tee -a "$BUILD_LOG"
echo -e "wasm-strip $(wasm-strip --version)\n" | tee -a "$BUILD_LOG"
# Check https://sqlite.org/download.html and update the source link, if needed.
SQLITE_SRC_URL="https://sqlite.org/2025/sqlite-src-3480000.zip"
echo -e "Getting sources from $SQLITE_SRC_URL\n" | tee -a "$BUILD_LOG"
SQLITE_SRC_FILE="$(basename $SQLITE_SRC_URL)"
curl -o "$SQLITE_SRC_FILE" $SQLITE_SRC_URL
unzip "$SQLITE_SRC_FILE"
# Paths and information in make output could be sensitive, so don't save in log.
echo "Building..." | tee -a "$BUILD_LOG"
pushd sqlite-src-*/
./configure
cd ext/wasm
make dist
popd
echo "Copying files from sqlite-src-*/ext/wasm/ into build/" | tee -a "$BUILD_LOG"
mkdir -p build/{common,jswasm} | tee -a "$BUILD_LOG"
cp sqlite-src-*/ext/wasm/jswasm/speedtest1.{js,wasm} build/jswasm/ | tee -a "$BUILD_LOG"
# The next files are only needed for the upstream browser build, not the
# JetStream version, hence don't copy them by default.
# cp sqlite-src-*/ext/wasm/speedtest1.html build/ | tee -a "$BUILD_LOG"
# cp sqlite-src-*/ext/wasm/common/{emscripten.css,SqliteTestUtil.js,testing.css} build/common/ | tee -a "$BUILD_LOG"
echo "Build success" | tee -a "$BUILD_LOG"