package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.9 KiB

6 years ago
package("sqlite3")
set_homepage("https://sqlite.org/")
set_description("The most used database engine in the world")
4 years ago
set_urls("https://sqlite.org/$(version)", {version = function (version)
local year = "2021"
if version:le("3.24") then
year = "2018"
end
local version_str = version:gsub("[.+]", "")
if #version_str < 7 then
version_str = version_str .. "00"
end
return year .. "/sqlite-autoconf-" .. version_str .. ".tar.gz"
end})
6 years ago
4 years ago
add_versions("3.23.0+0", "b7711a1800a071674c2bf76898ae8584fc6c9643cfe933cfc1bc54361e3a6e49")
add_versions("3.24.0+0", "d9d14e88c6fb6d68de9ca0d1f9797477d82fc3aed613558f87ffbdbbc5ceb74a")
add_versions("3.34.0+100", "2a3bca581117b3b88e5361d0ef3803ba6d8da604b1c1a47d902ef785c1b53e89")
6 years ago
if is_plat("macosx", "linux", "bsd") then
4 years ago
add_syslinks("pthread", "dl")
end
on_install(function (package)
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
target("sqlite3")
set_kind("$(kind)")
add_files("sqlite3.c")
add_headerfiles("sqlite3.h", "sqlite3ext.h")
add_defines("SQLITE_ENABLE_EXPLAIN_COMMENTS", "SQLITE_ENABLE_DBPAGE_VTAB", "SQLITE_ENABLE_STMTVTAB", "SQLITE_ENABLE_DBSTAT_VTAB")
if is_kind("shared") and is_plat("windows") then
add_defines("SQLITE_API=__declspec(dllexport)")
end
]])
4 years ago
local configs = {}
if package:config("shared") then
configs.kind = "shared"
4 years ago
end
if not package:is_plat("windows", "mingw") and package:config("pic") ~= false then
configs.cxflags = "-fPIC"
4 years ago
end
import("package.tools.xmake").install(package, configs)
6 years ago
end)
6 years ago
on_test(function (package)
assert(package:has_cfuncs("sqlite3_open_v2", {includes = "sqlite3.h"}))
6 years ago
end)