frigate/docker/main/build_sqlite_vec.sh

33 lines
858 B
Bash
Raw Normal View History

2024-10-07 17:23:20 +03:00
#!/bin/bash
set -euxo pipefail
SQLITE_VEC_VERSION="0.1.3"
2024-10-07 19:25:44 +03:00
cp /etc/apt/sources.list /etc/apt/sources.list.d/sources-src.list
sed -i 's|deb http|deb-src http|g' /etc/apt/sources.list.d/sources-src.list
2024-10-07 19:09:39 +03:00
apt-get update
2024-10-07 19:31:50 +03:00
apt-get -yqq build-dep sqlite3 gettext git
2024-10-07 19:09:39 +03:00
2024-10-07 17:23:20 +03:00
mkdir /tmp/sqlite_vec
# Grab the sqlite_vec source code.
wget -nv https://github.com/asg017/sqlite-vec/archive/refs/tags/v${SQLITE_VEC_VERSION}.tar.gz
tar -zxf v${SQLITE_VEC_VERSION}.tar.gz -C /tmp/sqlite_vec
cd /tmp/sqlite_vec/sqlite-vec-${SQLITE_VEC_VERSION}
2024-10-07 19:54:17 +03:00
mkdir -p vendor
curl -o sqlite-amalgamation.zip https://www.sqlite.org/2024/sqlite-amalgamation-3450300.zip
unzip -d
unzip sqlite-amalgamation.zip
mv sqlite-amalgamation-3450300/* vendor/
rmdir sqlite-amalgamation-3450300
rm sqlite-amalgamation.zip
2024-10-07 17:23:20 +03:00
# build loadable module
make loadable
# install it
2024-10-07 19:55:14 +03:00
cp dist/vec0.* /usr/local/lib
2024-10-07 17:23:20 +03:00