Merge pull request #1114 from xq114/dev

add z3
pull/1118/head
ruki 3 years ago committed by GitHub
commit dc06d36890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/o/oatpp/xmake.lua
  2. 1
      packages/x/xsimd/xmake.lua
  3. 1
      packages/x/xtensor/xmake.lua
  4. 1
      packages/x/xtl/xmake.lua
  5. 80
      packages/z/z3/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,14 +36,14 @@ 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==";
{
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"}}))

@ -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")

@ -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")

@ -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")

@ -0,0 +1,80 @@
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 not 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", package:installdir("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")
end
os.vrunv("python", args)
os.cd("build")
import("package.tools.make").install(package)
if not package:config("shared") then
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", 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)
Loading…
Cancel
Save