diff --git a/packages/l/libpq/xmake.lua b/packages/l/libpq/xmake.lua index f79a89957..0777a8345 100644 --- a/packages/l/libpq/xmake.lua +++ b/packages/l/libpq/xmake.lua @@ -3,12 +3,10 @@ package("libpq") set_description("Postgres C API library") set_license("PostgreSQL") - add_urls("https://ftp.postgresql.org/pub/source/v$(version)/postgresql-$(version).tar.bz2", {alias = "home"}) add_urls("https://github.com/postgres/postgres/archive/refs/tags/REL_$(version).tar.gz", {alias = "github", version = function (version) return version:gsub("%.", "_") end}) - add_versions("home:14.1", "4d3c101ea7ae38982f06bdc73758b53727fb6402ecd9382006fa5ecc7c2ca41f") - add_versions("github:14.1", "14809c9f669851ab89b344a50219e85b77f3e93d9df9e255b9781d8d60fcfbc9") + add_versions("14.1", "14809c9f669851ab89b344a50219e85b77f3e93d9df9e255b9781d8d60fcfbc9") add_deps("krb5", "openssl", "zlib") if is_plat("linux") then diff --git a/packages/l/libpqxx/xmake.lua b/packages/l/libpqxx/xmake.lua new file mode 100644 index 000000000..935114a22 --- /dev/null +++ b/packages/l/libpqxx/xmake.lua @@ -0,0 +1,26 @@ +package("libpqxx") + set_homepage("http://pqxx.org/") + set_description("The official C++ client API for PostgreSQL.") + + add_urls("https://github.com/jtv/libpqxx/archive/refs/tags/$(version).tar.gz", + "https://github.com/jtv/libpqxx.git") + add_versions("7.7.0", "2d99de960aa3016915bc69326b369fcee04425e57fbe9dad48dd3fa6203879fb") + + add_deps("cmake", "python 3.x") + add_deps("xmlto", "libpq") + + on_install("linux", "macosx", function (package) + local configs = {"-DSKIP_BUILD_TEST=ON"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + pqxx::connection con; + } + ]]}, {configs = {languages = "c++17"}, includes = "pqxx/pqxx"})) + end) +