From c995658e2262e7049711e32f640765ac03ea41ed Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Mon, 28 Mar 2022 22:38:51 +0800 Subject: [PATCH 1/6] add z3 --- packages/z/z3/xmake.lua | 81 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 packages/z/z3/xmake.lua diff --git a/packages/z/z3/xmake.lua b/packages/z/z3/xmake.lua new file mode 100644 index 000000000..5ad0047f7 --- /dev/null +++ b/packages/z/z3/xmake.lua @@ -0,0 +1,81 @@ +package("z3") + + set_homepage("https://github.com/Z3Prover/z3") + set_description("Z3 is a theorem prover from Microsoft Research.") + set_license("MIT") + + add_urls("https://github.com/Z3Prover/z3/releases/download/z3-$(version)/z3-solver-$(version).0.tar.gz") + add_versions("4.8.15", "4f1612fcca67eba92bb1752182e6e659d0607ae5d88d8db99a07451ed7f8ff49") + + add_deps("python 3.x", {kind = "binary"}) + if is_plat("linux") then + add_syslinks("pthread", "rt") + end + on_install("windows", function (package) + os.cd("core") + io.gsub("scripts/mk_project.py", " *add_[^\n]-_example%([^\n]-%)", "") + local args = {"scripts/mk_make.py"} + table.insert(args, "--python") + if package:debug() then + table.insert(args, "--debug") + end + if package:is_arch("x64") then + table.insert(args, "--x64") + end + if package:config("shared") then + table.insert(args, "--staticlib") + end + if package:config("vs_runtime"):startswith("MT") then + table.insert(args, "--staticbin") + end + os.vrunv("python", args) + for _, header in ipairs({"z3_algebraic.h", "z3_api.h", "z3_ast_containers.h", "z3_fixedpoint.h", "z3_fpa.h", "z3.h", "c++/z3++.h", "z3_macros.h", "z3_optimization.h", "z3_polynomial.h", "z3_rcf.h", "z3_v1.h", "z3_spacer.h"}) do + os.cp(path.join("src", "api", header), package:installdir("include")) + end + os.cd("build") + import("package.tools.nmake").build(package) + os.cp("z3.exe", package:installdir("bin")) + os.cp("python", package:installdir()) + if package:config("shared") then + os.cp("libz3.dll", package:installdir("bin")) + os.cp("libz3.lib", package:installdir("lib")) + else + os.cp("libz3-static.lib", package:installdir("lib")) + end + package:addenv("PATH", "bin") + package:addenv("PYTHONPATH", "python") + end) + + on_install("macosx", "linux", function (package) + os.cd("core") + io.gsub("scripts/mk_project.py", " *add_[^\n]-_example%([^\n]-%)", "") + local args = {"scripts/mk_make.py"} + table.insert(args, "--prefix=" .. package:installdir()) + table.insert(args, "--python") + table.insert(args, "--pypkgdir=" .. package:installdir("python")) + if package:debug() then + table.insert(args, "--debug") + end + if package:is_arch("x86") then + table.insert(args, "--x86") + end + if not package:config("shared") then + table.insert(args, "--staticlib") + table.insert(args, "--staticbin") + end + os.vrunv("python", args) + os.cd("build") + import("package.tools.make").install(package) + if not package:config("shared") then + -- allow python to find libz3.so + os.mv(path.join(package:installdir("lib"), "libz3.so"), package:installdir("python")) + package:addenv("LD_LIBRARY_PATH", "python") + end + package:addenv("PATH", "bin") + package:addenv("PYTHONPATH", "python") + end) + + on_test(function (package) + os.vrun("z3 -version") + assert(package:has_cfuncs("Z3_mk_config", {includes = "z3.h"})) + end) From a6df4ee5ec13e1b664894441ef0e26bb42ee16fa Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Mon, 28 Mar 2022 22:43:44 +0800 Subject: [PATCH 2/6] update oatpp --- packages/o/oatpp/xmake.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/o/oatpp/xmake.lua b/packages/o/oatpp/xmake.lua index 1a48ae782..61417755f 100644 --- a/packages/o/oatpp/xmake.lua +++ b/packages/o/oatpp/xmake.lua @@ -8,6 +8,7 @@ package("oatpp") "https://github.com/oatpp/oatpp.git") add_versions("1.0.0", "9ba7c75e3ada8ec894ec10beae712e775774a835fd3de89d8c34e17740202619") add_versions("1.2.5", "36276e8b23e68ece1e6093c3f06fc80e3d42a5f4e47cdeef5e7e63f36eeddaad") + add_versions("1.3.0", "e1f80fa8fd7a74da6737e7fee1a4db68b4d7085a3f40e7d550752d6ff5714583") if is_plat("windows") then add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) @@ -35,7 +36,7 @@ package("oatpp") on_test(function (package) assert(package:check_cxxsnippets({test = [[ #include "oatpp/encoding/Base64.hpp" - void test(int argc, char** argv) { + void test() { oatpp::String message = "oat++ web framework"; oatpp::String messageEncoded = "b2F0Kysgd2ViIGZyYW1ld29yaw=="; { From 5ad266260b2a130706bbc6f494b1d814a1a05ed0 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Mon, 28 Mar 2022 22:44:50 +0800 Subject: [PATCH 3/6] update xtl --- packages/x/xtl/xmake.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/x/xtl/xmake.lua b/packages/x/xtl/xmake.lua index c3b277482..0859c9e2d 100644 --- a/packages/x/xtl/xmake.lua +++ b/packages/x/xtl/xmake.lua @@ -9,6 +9,7 @@ package("xtl") "https://github.com/xtensor-stack/xtl.git") add_versions("0.7.2", "95c221bdc6eaba592878090916383e5b9390a076828552256693d5d97f78357c") add_versions("0.7.3", "f4a81e3c9ca9ddb42bd4373967d4859ecfdca1aba60b9fa6ced6c84d8b9824ff") + add_versions("0.7.4", "3c88be0e696b64150c4de7a70f9f09c00a335186b0b0b409771ef9f56bca7d9a") add_deps("cmake") add_deps("nlohmann_json") From a56efa17262722afa74f0f73e42aebebc8b9c3b4 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Mon, 28 Mar 2022 22:46:34 +0800 Subject: [PATCH 4/6] update xtensor --- packages/x/xsimd/xmake.lua | 1 + packages/x/xtensor/xmake.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/x/xsimd/xmake.lua b/packages/x/xsimd/xmake.lua index 560dc97f0..617d9ddfc 100644 --- a/packages/x/xsimd/xmake.lua +++ b/packages/x/xsimd/xmake.lua @@ -9,6 +9,7 @@ package("xsimd") "https://github.com/xtensor-stack/xsimd.git") add_versions("7.6.0", "eaf47f1a316ef6c3287b266161eeafc5aa61226ce5ac6c13502546435b790252") add_versions("8.0.3", "d1d41253c4f82eaf2f369d7fcb4142e35076cf8675b9d94caa06ecf883024344") + add_versions("8.0.5", "0e1b5d973b63009f06a3885931a37452580dbc8d7ca8ad40d4b8c80d2a0f84d7") if is_plat("windows") then add_cxxflags("/arch:AVX2") diff --git a/packages/x/xtensor/xmake.lua b/packages/x/xtensor/xmake.lua index 8e2ad167d..2a1ad2fe7 100644 --- a/packages/x/xtensor/xmake.lua +++ b/packages/x/xtensor/xmake.lua @@ -9,6 +9,7 @@ package("xtensor") "https://github.com/xtensor-stack/xtensor.git") add_versions("0.23.10", "2e770a6d636962eedc868fef4930b919e26efe783cd5d8732c11e14cf72d871c") add_versions("0.24.0", "37738aa0865350b39f048e638735c05d78b5331073b6329693e8b8f0902df713") + add_versions("0.24.1", "dd1bf4c4eba5fbcf386abba2627fcb4a947d14a806c33fde82d0cc1194807ee4") add_deps("cmake") add_deps("xtl", "xsimd") From f8c74ee45740b0397b242f17a846c9c7af2d51d0 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Mon, 28 Mar 2022 22:58:39 +0800 Subject: [PATCH 5/6] fix test --- packages/o/oatpp/xmake.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/o/oatpp/xmake.lua b/packages/o/oatpp/xmake.lua index 61417755f..327553f37 100644 --- a/packages/o/oatpp/xmake.lua +++ b/packages/o/oatpp/xmake.lua @@ -41,9 +41,9 @@ package("oatpp") oatpp::String messageEncoded = "b2F0Kysgd2ViIGZyYW1ld29yaw=="; { oatpp::String encoded = oatpp::encoding::Base64::encode(message); - OATPP_ASSERT(encoded->equals(messageEncoded.get())); + OATPP_ASSERT(encoded == messageEncoded); oatpp::String decoded = oatpp::encoding::Base64::decode(encoded); - OATPP_ASSERT(message->equals(decoded.get())); + OATPP_ASSERT(message == decoded); } } ]]}, {configs = {languages = "c++11"}})) From 89801c89ff8558d58d3581a0dcb3929a880150f2 Mon Sep 17 00:00:00 2001 From: xq114 <1140735506@qq.com> Date: Tue, 29 Mar 2022 17:41:46 +0800 Subject: [PATCH 6/6] fix python interface --- packages/z/z3/xmake.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/z/z3/xmake.lua b/packages/z/z3/xmake.lua index 5ad0047f7..1eac9e7e0 100644 --- a/packages/z/z3/xmake.lua +++ b/packages/z/z3/xmake.lua @@ -22,7 +22,7 @@ package("z3") if package:is_arch("x64") then table.insert(args, "--x64") end - if package:config("shared") then + if not package:config("shared") then table.insert(args, "--staticlib") end if package:config("vs_runtime"):startswith("MT") then @@ -43,7 +43,7 @@ package("z3") os.cp("libz3-static.lib", package:installdir("lib")) end package:addenv("PATH", "bin") - package:addenv("PYTHONPATH", "python") + package:addenv("PYTHONPATH", package:installdir("python")) end) on_install("macosx", "linux", function (package) @@ -61,21 +61,20 @@ package("z3") end if not package:config("shared") then table.insert(args, "--staticlib") - table.insert(args, "--staticbin") end os.vrunv("python", args) os.cd("build") import("package.tools.make").install(package) if not package:config("shared") then - -- allow python to find libz3.so - os.mv(path.join(package:installdir("lib"), "libz3.so"), package:installdir("python")) - package:addenv("LD_LIBRARY_PATH", "python") + local libfile = package:is_plat("macosx") and "libz3.dylib" or "libz3.so" + os.mv(path.join(package:installdir("lib"), libfile), path.join(package:installdir("python"), "z3", "lib", libfile)) end package:addenv("PATH", "bin") - package:addenv("PYTHONPATH", "python") + package:addenv("PYTHONPATH", package:installdir("python")) end) on_test(function (package) os.vrun("z3 -version") + os.vrun("python3 -c \"import z3\"") assert(package:has_cfuncs("Z3_mk_config", {includes = "z3.h"})) end)