2018-02-10 18:04:02 +08:00
|
|
|
SCRIPT_DIR=$(cd "$(dirname "$_")" && pwd)
|
|
|
|
echo $SCRIPT_DIR
|
|
|
|
cd $SCRIPT_DIR
|
2018-09-18 00:42:19 +08:00
|
|
|
export SQLITE3_LIB_DIR=$SCRIPT_DIR/sqlite3
|
2018-02-10 18:04:02 +08:00
|
|
|
|
|
|
|
# Download and extract amalgamation
|
2019-03-10 20:49:21 +08:00
|
|
|
SQLITE=sqlite-amalgamation-3270200
|
|
|
|
curl -O http://sqlite.org/2019/$SQLITE.zip
|
2018-02-10 18:04:02 +08:00
|
|
|
unzip -p $SQLITE.zip $SQLITE/sqlite3.c > $SQLITE3_LIB_DIR/sqlite3.c
|
|
|
|
unzip -p $SQLITE.zip $SQLITE/sqlite3.h > $SQLITE3_LIB_DIR/sqlite3.h
|
|
|
|
unzip -p $SQLITE.zip $SQLITE/sqlite3ext.h > $SQLITE3_LIB_DIR/sqlite3ext.h
|
|
|
|
rm -f $SQLITE.zip
|
|
|
|
|
|
|
|
# Regenerate bindgen file
|
|
|
|
rm -f $SQLITE3_LIB_DIR/bindgen_bundled_version.rs
|
2018-09-18 00:42:19 +08:00
|
|
|
export SQLITE3_INCLUDE_DIR=$SQLITE3_LIB_DIR
|
2018-02-10 18:04:02 +08:00
|
|
|
cargo update
|
2018-03-24 10:48:09 +08:00
|
|
|
# Just to make sure there is only one bindgen.rs file in target dir
|
2019-03-10 20:49:21 +08:00
|
|
|
find $SCRIPT_DIR/../target -type f -name bindgen.rs -exec rm {} \;
|
2018-02-10 18:04:02 +08:00
|
|
|
cargo build --features "buildtime_bindgen" --no-default-features
|
2019-03-10 20:49:21 +08:00
|
|
|
find $SCRIPT_DIR/../target -type f -name bindgen.rs -exec cp {} $SQLITE3_LIB_DIR/bindgen_bundled_version.rs \;
|
2018-02-10 18:04:02 +08:00
|
|
|
# Sanity check
|
|
|
|
cd $SCRIPT_DIR/..
|
|
|
|
cargo update
|
2018-12-15 17:51:02 +08:00
|
|
|
cargo test --features "backup blob chrono functions limits load_extension serde_json trace vtab bundled"
|
2018-02-10 18:04:02 +08:00
|
|
|
echo 'You should increment the version in libsqlite3-sys/Cargo.toml'
|