1{
2 lib,
3 gettext,
4 fetchFromGitHub,
5 sqlite,
6 stdenv,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "sqlite-vec";
11 version = "0.1.6";
12
13 src = fetchFromGitHub {
14 owner = "asg017";
15 repo = "sqlite-vec";
16 rev = "v${finalAttrs.version}";
17 hash = "sha256-CgeSoRoQRMb/V+RzU5NQuIk/3OonYjAfolWD2hqNuXU=";
18 };
19
20 nativeBuildInputs = [ gettext ];
21
22 buildInputs = [ sqlite ];
23
24 makeFlags = [
25 "loadable"
26 "static"
27 ];
28 installPhase = ''
29 runHook preInstall
30
31 install -Dm444 -t "$out/lib" \
32 "dist/libsqlite_vec0${stdenv.hostPlatform.extensions.staticLibrary}" \
33 "dist/vec0${stdenv.hostPlatform.extensions.sharedLibrary}"
34
35 runHook postInstall
36 '';
37
38 meta = with lib; {
39 description = "Vector search SQLite extension that runs anywhere";
40 homepage = "https://github.com/asg017/sqlite-vec";
41 changelog = "https://github.com/asg017/sqlite-vec/releases/tag/${finalAttrs.src.rev}";
42 license = licenses.mit;
43 maintainers = [ maintainers.anmonteiro ];
44 platforms = platforms.unix;
45 };
46})