Skip to content

Commit

Permalink
sqlite-vec: add package (#5406)
Browse files Browse the repository at this point in the history
* sqlite-vec: add package

* limit plat
  • Loading branch information
star-hengxing authored Oct 3, 2024
1 parent 44d5224 commit 56c818a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions packages/s/sqlite-vec/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package("sqlite-vec")
set_homepage("https://github.com/asg017/sqlite-vec")
set_description("A vector search SQLite extension that runs anywhere!")
set_license("Apache-2.0")

add_urls("https://github.com/asg017/sqlite-vec/releases/download/v$(version)/sqlite-vec-$(version)-amalgamation.tar.gz",
"https://github.com/asg017/sqlite-vec.git")

add_versions("0.1.3", "cd4da66333caa62dc63dcac99baeed1b38aa327e1d29f12a4a76df34860de442")

add_deps("sqlite3")

on_install("!bsd and (!windows or windows|!x86)", function (package)
if package:is_plat("windows") and not package:config("shared") then
package:add("defines", "SQLITE_VEC_STATIC")
end

io.writefile("xmake.lua", [[
add_rules("mode.release", "mode.debug")
add_requires("sqlite3")
target("sqlite-vec")
set_kind("$(kind)")
add_files("*.c")
add_headerfiles("*.h")
add_packages("sqlite3")
]])
import("package.tools.xmake").install(package)

if package:is_plat("windows") and package:config("shared") then
io.replace(package:installdir("include/sqlite-vec.h"), "__declspec(dllexport)", "__declspec(dllimport)", {plain = true})
end
end)

on_test(function (package)
assert(package:has_cfuncs("sqlite3_vec_init", {includes = "sqlite-vec.h"}))
end)

0 comments on commit 56c818a

Please sign in to comment.