sqlite-vec: add package (#5406)

* sqlite-vec: add package

* limit plat
pull/5408/head
star9029 7 months ago committed by GitHub
parent 44d5224dd8
commit 56c818ac00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 36
      packages/s/sqlite-vec/xmake.lua

@ -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)
Loading…
Cancel
Save