add cppzmq, libmd, libbsd (#1063)

* add cppzmq

* add libmd and libbsd

* improve imgui

* update tbb

* update openblas

* try fix openmp

* update expat

* improve tinygltf and tinyobjloader

* switch tbb to build from source
pull/1064/head
Hoildkv 3 years ago committed by GitHub
parent 8919ee04ea
commit acc4aedb80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      packages/c/cppzmq/xmake.lua
  2. 1
      packages/e/expat/xmake.lua
  3. 4
      packages/i/imgui/xmake.lua
  4. 27
      packages/l/libbsd/xmake.lua
  5. 23
      packages/l/libmd/xmake.lua
  6. 2
      packages/l/libomp/xmake.lua
  7. 3
      packages/o/openblas/xmake.lua
  8. 4
      packages/o/openmp/xmake.lua
  9. 54
      packages/t/tbb/xmake.lua
  10. 2
      packages/t/tinygltf/xmake.lua
  11. 3
      packages/t/tinyobjloader/xmake.lua
  12. 38
      packages/z/zeromq/xmake.lua

@ -0,0 +1,26 @@
package("cppzmq")
set_kind("library", {headeronly = true})
set_homepage("http://www.zeromq.org/")
set_description("Header-only C++ binding for libzmq")
set_license("MIT")
add_urls("https://github.com/zeromq/cppzmq/archive/refs/tags/$(version).tar.gz",
"https://github.com/zeromq/cppzmq.git")
add_versions("v4.8.1", "7a23639a45f3a0049e11a188e29aaedd10b2f4845f0000cf3e22d6774ebde0af")
add_deps("cmake", "zeromq")
on_install("windows", "macosx", "linux", function (package)
import("package.tools.cmake").install(package, {"-DCPPZMQ_BUILD_TESTS=OFF"})
end)
on_test(function (package)
assert(package:check_cxxsnippets([[
void test() {
zmq::context_t ctx;
zmq::socket_t sock(ctx, zmq::socket_type::push);
sock.bind("inproc://test");
sock.send(zmq::str_buffer("Hello, world"), zmq::send_flags::dontwait);
}
]], {configs = {languages = "c++14"}, includes = "zmq.hpp"}))
end)

@ -5,6 +5,7 @@ package("expat")
set_license("MIT")
set_urls("https://github.com/libexpat/libexpat/releases/download/R_$(version).tar.bz2", {version = function (version) return version:gsub("%.", "_") .. "/expat-" .. version end})
add_versions("2.4.7", "e149bdd8b90254c62b3d195da53a09bd531a4d63a963b0d8a5268d48dd2f6a65")
add_versions("2.4.5", "fbb430f964c7a2db2626452b6769e6a8d5d23593a453ccbc21701b74deabedff")
add_versions("2.4.1", "2f9b6a580b94577b150a7d5617ad4643a4301a6616ff459307df3e225bcfbf40")
add_versions("2.3.0", "f122a20eada303f904d5e0513326c5b821248f2d4d2afbf5c6f1339e511c0586")

@ -27,7 +27,7 @@ package("imgui")
add_includedirs("include", "include/imgui", "include/backends")
if is_plat("windows", "mingw") then
add_syslinks("Imm32")
add_syslinks("imm32")
end
on_load("macosx", "linux", "windows", "mingw", "android", "iphoneos", function (package)
@ -74,7 +74,7 @@ package("imgui")
target("imgui")
set_kind("static")
add_files("*.cpp")
add_headerfiles("*.h")
add_headerfiles("*.h", {prefixdir = "imgui"})
]]
end

@ -0,0 +1,27 @@
package("libbsd")
set_homepage("https://libbsd.freedesktop.org/wiki/")
set_description("This library provides useful functions commonly found on BSD systems")
set_license("BSD-3-Clause")
add_urls("https://libbsd.freedesktop.org/releases/libbsd-$(version).tar.xz")
add_versions("0.11.5", "1a9c952525635c1bb6770cb22e969b938d8e6a9d7912362b98ee8370599b0efd")
add_deps("libmd")
add_links("bsd")
on_install("linux", function (package)
local configs = {"--disable-dependency-tracking"}
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
if package:config("pic") then
table.insert(configs, "--with-pic")
end
import("package.tools.autoconf").install(package, configs, {packagedeps = {"libmd"}})
if not package:config("shared") then
os.rm(path.join(package:installdir("lib"), "libbsd.so"))
end
end)
on_test(function (package)
assert(package:has_cfuncs("bsd_getopt", {includes = "bsd/unistd.h"}))
end)

@ -0,0 +1,23 @@
package("libmd")
set_homepage("https://www.hadrons.org/software/libmd/")
set_description("Message Digest functions from BSD systems")
set_license("BSD-3-Clause")
add_urls("https://archive.hadrons.org/software/libmd/libmd-$(version).tar.xz")
add_urls("https://libbsd.freedesktop.org/releases/libmd-$(version).tar.xz")
add_versions("1.0.4", "f51c921042e34beddeded4b75557656559cf5b1f2448033b4c1eec11c07e530f")
on_install("linux", function (package)
local configs = {"--disable-dependency-tracking"}
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
if package:config("pic") then
table.insert(configs, "--with-pic")
end
import("package.tools.autoconf").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("MD5Init", {includes = "md5.h"}))
end)

@ -7,6 +7,7 @@ package("libomp")
add_versions("10.0.1", "d19f728c8e04fb1e94566c8d76aef50ec926cd2f95ef3bf1e0a5de4909b28b44")
add_versions("11.1.0", "d187483b75b39acb3ff8ea1b7d98524d95322e3cb148842957e9b0fbb866052e")
add_versions("12.0.1", "60fe79440eaa9ebf583a6ea7f81501310388c02754dbe7dc210776014d06b091")
add_versions("13.0.1", "6b79261371616c31fea18cd3ee1797c79ee38bcaf8417676d4fa366a24c96b4f")
add_deps("cmake")
@ -14,6 +15,7 @@ package("libomp")
if is_plat("macosx") then
add_extsources("brew::libomp")
elseif is_plat("linux") then
add_extsources("apt::libomp-dev")
add_syslinks("pthread", "dl")
end

@ -12,12 +12,14 @@ package("openblas")
add_versions("0.3.17", "85b650e6519371b80c1fc10cbaa74af671df9215a53c5d11c64e758396f030ef")
add_versions("0.3.18", "767757039c354b6625c497a856c362546c1b1e7400278ffb40e3b9bf731f3b27")
add_versions("0.3.19", "d85b09d80bbb40442d608fa60353ccec5f112cebeccd805c0e139057e26d1795")
add_versions("0.3.20", "cacfb8563e2a98260e35a09c92fd3b7383a9cd1367444edfa1b46cb0225ee9c3")
elseif is_arch("x86") then
add_urls("https://github.com/xianyi/OpenBLAS/releases/download/v$(version)/OpenBLAS-$(version)-x86.zip")
add_versions("0.3.15", "bcde933737b477813eaac290de5cb8756d3b42199e8ef5f44b23ae5f06fe0834")
add_versions("0.3.17", "8258a9a22075280fb02b65447ea77d9439a0097711e220fc4ae8f92927f32273")
add_versions("0.3.18", "c24ecd6e5f561de3861bf714b35e0957a27ee0e03ab4d2867d08377892daf66e")
add_versions("0.3.19", "478cbaeb9364b4681a7c982626e637a5a936514a45e12b6f0caddbcb9483b795")
add_versions("0.3.20", "0ee249246af7ce2fd66f86cb9350f5f5a7b97496b9b997bfd0680048dd194158")
end
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true})
@ -29,6 +31,7 @@ package("openblas")
add_versions("0.3.17", "df2934fa33d04fd84d839ca698280df55c690c86a5a1133b3f7266fce1de279f")
add_versions("0.3.18", "1632c1e8cca62d8bed064b37747e331a1796fc46f688626337362bf0d16aeadb")
add_versions("0.3.19", "947f51bfe50c2a0749304fbe373e00e7637600b0a47b78a51382aeb30ca08562")
add_versions("0.3.20", "8495c9affc536253648e942908e88e097f2ec7753ede55aca52e5dead3029e3c")
add_configs("fortran", {description = "Compile with fortran enabled.", default = is_plat("linux"), type = "boolean"})
add_configs("openmp", {description = "Compile with OpenMP enabled.", default = not is_plat("macosx"), type = "boolean"})

@ -11,9 +11,7 @@ package("openmp")
for _, toolkind in ipairs({"cc", "cxx"}) do
if package:config("runtime") == "default" then
if package:has_tool(toolkind, "clang", "clangxx") then
if package:is_plat("macosx") then
package:add("deps", "libomp") -- need to tell apple clang from llvm clang
end
package:add("deps", "libomp")
end
end
end

@ -4,17 +4,25 @@ package("tbb")
set_description("Threading Building Blocks (TBB) lets you easily write parallel C++ programs that take full advantage of multicore performance, that are portable, composable and have future-proof scalability.")
if is_plat("windows") then
add_urls("https://github.com/oneapi-src/oneTBB/releases/download/v$(version)-win.zip", {version = function (version) return version .. (version:ge("2021.0") and "/oneapi-tbb-" or "/tbb-") .. version end})
add_urls("https://github.com/oneapi-src/oneTBB/$(version)", {version = function (version)
if version:ge("2021.0") then
return "archive/v" .. version .. ".tar.gz"
else
return "releases/download/v" .. version .. "/tbb-" .. version .. "-win.zip"
end
end})
add_versions("2020.3", "cda37eed5209746a79c88a658f8c1bf3782f58bd9f9f6ba0da3a16624a9bfaa1")
add_versions("2021.2.0", "9be37b1cb604a5905db0a15b2b893d85579fd0b2f1024859e1f75e96d7331a02")
add_versions("2021.3.0", "90e2055cd4be55f79eedd3d50b2010bf05d1739309c4cdd219192d129e931093")
add_versions("2021.4.0", "3868c557739a7a5b74c985571648c066167fd7a0a8c63bdac00a6cfeeb58037f")
add_versions("2021.2.0", "cee20b0a71d977416f3e3b4ec643ee4f38cedeb2a9ff015303431dd9d8d79854")
add_versions("2021.3.0", "8f616561603695bbb83871875d2c6051ea28f8187dbe59299961369904d1d49e")
add_versions("2021.4.0", "021796c7845e155e616f5ecda16daa606ebb4c6f90b996e5c08aebab7a8d3de3")
add_versions("2021.5.0", "e5b57537c741400cf6134b428fc1689a649d7d38d9bb9c1b6d64f092ea28178a")
else
add_urls("https://github.com/oneapi-src/oneTBB/archive/v$(version).tar.gz")
add_versions("2020.3", "ebc4f6aa47972daed1f7bf71d100ae5bf6931c2e3144cf299c8cc7d041dca2f3")
add_versions("2021.2.0", "cee20b0a71d977416f3e3b4ec643ee4f38cedeb2a9ff015303431dd9d8d79854")
add_versions("2021.3.0", "8f616561603695bbb83871875d2c6051ea28f8187dbe59299961369904d1d49e")
add_versions("2021.4.0", "021796c7845e155e616f5ecda16daa606ebb4c6f90b996e5c08aebab7a8d3de3")
add_versions("2021.5.0", "e5b57537c741400cf6134b428fc1689a649d7d38d9bb9c1b6d64f092ea28178a")
add_patches("2021.2.0", path.join(os.scriptdir(), "patches", "2021.2.0", "gcc11.patch"), "181511cf4878460cb48ac0531d3ce8d1c57626d698e9001a0951c728fab176fb")
@ -39,7 +47,7 @@ package("tbb")
on_install("macosx", "linux", "mingw@windows", "mingw@msys", "android", function (package)
if package:version():ge("2021.0") then
if package:is_plat("mingw") then
if package:version():le("2021.4") and package:is_plat("mingw") then
raise("mingw build is not supported in this version")
end
local configs = {"-DTBB_TEST=OFF"}
@ -67,22 +75,28 @@ package("tbb")
end)
on_install("windows", function (package)
local incdir = (package:version():ge("2021.0") and "include" or "tbb/include")
local libdir = (package:version():ge("2021.0") and "lib/" or "tbb/lib/")
local bindir = (package:version():ge("2021.0") and "redist/" or "tbb/bin/")
os.cp(incdir, package:installdir())
local prefix = ""
if package:is_arch("x64", "x86_64") then
prefix = "intel64/vc14"
else
prefix = "ia32/vc14"
end
if package:config("debug") then
os.cp(libdir .. prefix .. "/*_debug.*", package:installdir("lib"))
os.cp(bindir .. prefix .. "/*_debug.*", package:installdir("bin"))
if package:version():ge("2021.0") then
local configs = {"-DTBB_TEST=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
import("package.tools.cmake").install(package, configs)
else
os.cp(libdir .. prefix .. "/**|*_debug.*", package:installdir("lib"))
os.cp(bindir .. prefix .. "/**|*_debug.*", package:installdir("bin"))
local incdir = "tbb/include"
local libdir = "tbb/lib/"
local bindir = "tbb/bin/"
os.cp(incdir, package:installdir())
local prefix = ""
if package:is_arch("x64", "x86_64") then
prefix = "intel64/vc14"
else
prefix = "ia32/vc14"
end
if package:config("debug") then
os.cp(libdir .. prefix .. "/*_debug.*", package:installdir("lib"))
os.cp(bindir .. prefix .. "/*_debug.*", package:installdir("bin"))
else
os.cp(libdir .. prefix .. "/**|*_debug.*", package:installdir("lib"))
os.cp(bindir .. prefix .. "/**|*_debug.*", package:installdir("bin"))
end
end
package:addenv("PATH", "bin")
end)

@ -1,5 +1,6 @@
package("tinygltf")
set_kind("library", {headeronly = true})
set_homepage("https://github.com/syoyo/tinygltf/")
set_description("Header only C++11 tiny glTF 2.0 library")
set_license("MIT")
@ -11,6 +12,7 @@ package("tinygltf")
add_deps("stb", "nlohmann_json")
on_install(function (package)
os.cp("tiny_gltf.h", package:installdir("include"))
os.cp("cmake/TinyGLTFConfig.cmake", package:installdir("cmake"))
end)
on_test(function (package)

@ -10,7 +10,7 @@ package("tinyobjloader")
add_configs("double", {description = "Use double precision floating numbers.", default = false, type = "boolean"})
if is_plat("windows") then
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true})
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
end
on_load(function (package)
@ -22,6 +22,7 @@ package("tinyobjloader")
on_install("macosx", "linux", "windows", "mingw", "android", "iphoneos", function (package)
io.writefile("xmake.lua", string.format([[
add_rules("mode.debug", "mode.release")
add_rules("utils.install.cmake_importfiles")
target("tinyobjloader")
set_kind("$(kind)")
%s

@ -2,28 +2,48 @@ package("zeromq")
set_homepage("https://zeromq.org/")
set_description("High-performance, asynchronous messaging library")
set_license("GPL-3.0")
set_urls("https://github.com/zeromq/libzmq/releases/download/v$(version)/zeromq-$(version).tar.gz",
"https://github.com/zeromq/libzmq.git")
add_versions("4.3.2", "ebd7b5c830d6428956b67a0454a7f8cbed1de74b3b01e5c33c5378e22740f763")
add_versions("4.3.4", "c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5")
if is_plat("linux") then
add_configs("libunwind", {description = "Enable libunwind.", default = false, type = "boolean"})
end
if is_host("windows") then
if is_plat("windows") then
add_deps("cmake")
add_syslinks("ws2_32", "advapi32", "rpcrt4", "iphlpapi")
elseif is_plat("linux") then
add_syslinks("pthread")
end
on_load("windows", "linux", function (package)
if package:is_plat("windows") and not package:config("shared") then
package:add("defines", "ZMQ_STATIC")
end
if package:is_plat("linux") and package:config("libunwind") then
package:add("deps", "libunwind")
end
end)
on_install("windows", function (package)
local configs = {}
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
io.replace("CMakeLists.txt", "NOT ${CMAKE_BUILD_TYPE} MATCHES \"Debug\"", "FALSE", {plain = true})
local configs = {"-DBUILD_TESTS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_STATIC=" .. (package:config("shared") and "OFF" or "ON"))
table.insert(configs, "-DBUILD_SHARED=" .. (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
on_install("linux", "macosx", function (package)
local configs = {}
if package:config("shared") then
table.insert(configs, "--enable-shared=yes")
else
table.insert(configs, "--enable-shared=no")
local configs = {"--disable-dependency-tracking", "--without-docs", "--enable-libbsd=no"}
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
table.insert(configs, "--enable-libunwind=" .. (package:config("libunwind") and "yes" or "no"))
if package:config("pic") then
table.insert(configs, "--with-pic")
end
import("package.tools.autoconf").install(package, configs)
end)

Loading…
Cancel
Save