add libmspack (#693)

* add libmspack

* update poco

* update openvdb

* update glfw

* update imath

* update gr

* update openexr

* use config from msvc toolchain
pull/695/head
Hoildkv 3 years ago committed by GitHub
parent 1999e48a37
commit 10be5546d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/d/directxtk/xmake.lua
  2. 3
      packages/g/glfw/xmake.lua
  3. 9
      packages/g/gr/xmake.lua
  4. 1
      packages/i/imath/xmake.lua
  5. 2
      packages/j/jasper/xmake.lua
  6. 30
      packages/l/libmspack/xmake.lua
  7. 1
      packages/o/openexr/xmake.lua
  8. 37
      packages/o/openvdb/xmake.lua
  9. 3
      packages/p/poco/xmake.lua

@ -8,17 +8,18 @@ package("directxtk")
{version = function (version)
local versions = {
["20.9.0"] = "sept2020",
["21.4.0"] = "apr2021"
["21.4.0"] = "apr2021",
["21.11.0"] = "nov2021"
}
return versions[tostring(version)]
end})
add_versions("20.9.0", "9d5131243bf3e33db2e3a968720d860abdcbbe7cb037c2cb5dd06046d439ed09")
add_versions("21.4.0", "481e769b1aabd08b46659bbec8363a2429f04d3bb9a1e857eb0ebd163304d1bf")
add_versions("21.11.0", "d25e634b0e225ae572f82d0d27c97051b0069c6813d7be12453039a504dffeb8")
on_install("windows", function (package)
local configs = {}
local vs_sdkver = get_config("vs_sdkver")
local vs_sdkver = import("core.tool.toolchain").load("msvc"):config("vs_sdkver")
if vs_sdkver then
local build_ver = string.match(vs_sdkver, "%d+%.%d+%.(%d+)%.?%d*")
assert(tonumber(build_ver) >= 19041, "DirectXTK requires Windows SDK to be at least 10.0.19041.0")

@ -2,11 +2,13 @@ package("glfw")
set_homepage("https://www.glfw.org/")
set_description("GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan application development.")
set_license("zlib")
add_urls("https://github.com/glfw/glfw/archive/$(version).tar.gz",
"https://github.com/glfw/glfw.git")
add_versions("3.3.2", "98768e12e615fbe9f3386f5bbfeb91b5a3b45a8c4c77159cef06b1f6ff749537")
add_versions("3.3.4", "cc8ac1d024a0de5fd6f68c4133af77e1918261396319c24fd697775a6bc93b63")
add_versions("3.3.5", "32fdb8705784adfe3082f97e0d41e7c515963e977b5a14c467a887cf0da827b5")
add_configs("glfw_include", {description = "Choose submodules enabled in glfw", default = "none", type = "string", values = {"none", "vulkan", "glu", "glext", "es2", "es3"}})
@ -35,6 +37,7 @@ package("glfw")
on_install("macosx", "windows", "linux", "mingw", function (package)
local configs = {"-DGLFW_BUILD_DOCS=OFF", "-DGLFW_BUILD_TESTS=OFF", "-DGLFW_BUILD_EXAMPLES=OFF"}
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"))
if package:is_plat("windows") then
table.insert(configs, "-DUSE_MSVC_RUNTIME_LIBRARY_DLL=" .. (package:config("vs_runtime"):startswith("MT") and "OFF" or "ON"))

@ -9,16 +9,19 @@ package("gr")
add_urls("https://github.com/sciapp/gr/releases/download/v$(version)/gr-$(version)-Windows-x86_64-msvc.tar.gz")
add_versions("0.57.0", "5e62a425e60885835fa8177ab5311c131bab0bb484722866ee931e81b77a6a5a")
add_versions("0.58.0", "a8152c15613c8b8e02f57d2b19632576f133e353057d2d824e9b85c203c3aa90")
add_versions("0.62.0", "749ea7757f967720c27990a55c26774d0683dacd81169b12033e4084e0483a85")
end
elseif is_plat("macosx") then
if is_arch("arm64") then
add_urls("https://github.com/sciapp/gr/releases/download/v$(version)/gr-$(version)-Darwin-aarch64.tar.gz")
add_versions("0.57.0", "a867a9233a26f8797f13adf2b7d9324a397a84d256750db0a29f4b5032b9a47f")
add_versions("0.58.0", "3c0132bc7c26665ed812381e103091273999352a3cda8d9e664759c143387755")
add_versions("0.62.0", "9209f18b0affdaabc77e88fc027a8877a2c7c4e06c9fe44fec0da728c8882caf")
else
add_urls("https://github.com/sciapp/gr/releases/download/v$(version)/gr-$(version)-Darwin-x86_64.tar.gz")
add_versions("0.57.0", "b6114420b6ffff1cc41c7a325b53fd2af90942c5d7840ff27b1217488b6fb950")
add_versions("0.58.0", "1c808852fec10badea7a5282bc867c5bcc86eda89e07bce7b2f0017a889f16cf")
add_versions("0.62.0", "e2a185691ef020bddbbb3c93046813335b04df7ca97df8b73032086aca266dce")
end
elseif is_plat("linux") then
if is_arch("x86_64") then
@ -26,27 +29,33 @@ package("gr")
add_urls("https://github.com/sciapp/gr/releases/download/v$(version)/gr-$(version)-Ubuntu-x86_64.tar.gz")
add_versions("0.57.0", "5f157733b750be6e8e771e008bf2dab1ee786d50efcc16deb02f6cdda9d03a54")
add_versions("0.58.0", "c72767b2880fd561508e526286b30c3fc9bfa78f432ac966eb6455d318c1374d")
add_versions("0.62.0", "b539903b16bae5d6b3db01314c39c65819306e9aa8ded15ba52a5aeb7674e776")
elseif linuxos.name() == "debian" then
add_urls("https://github.com/sciapp/gr/releases/download/v$(version)/gr-$(version)-Debian-x86_64.tar.gz")
add_versions("0.57.0", "f20e65b4b93df1409377355cefca0fda714f5b4f1bf0c2292c0bad4232ac0a41")
add_versions("0.58.0", "5fc6fe7b58193fbfac9fc32538d1078dd9ab5a606d38e3fdb2a1683b37ec2a76")
add_versions("0.62.0", "ebc6901b0a3888b7e874c761728fb503029128f0646a9bd0f93e67845467454d")
elseif linuxos.name() == "archlinux" then
add_urls("https://github.com/sciapp/gr/releases/download/v$(version)/gr-$(version)-ArchLinux-x86_64.tar.gz")
add_versions("0.57.0", "3224971f16a8cc223f57ea240dea346747ea18111c91b64b38b5554f93721cf8")
add_versions("0.58.0", "f90fb2b15459d0c3075326646c31a041a61c9b84b4d4ebe015b4283a43c2fe6e")
add_versions("0.62.0", "d8c6c01de2e566fa064836ead23ce139030e7e08961f482ff55942b6fb298e4e")
elseif linuxos.name() == "centos" then
add_urls("https://github.com/sciapp/gr/releases/download/v$(version)/gr-$(version)-CentOS-x86_64.tar.gz")
add_versions("0.57.0", "877d6066690c6dc071db1edb64e79d738fdde6d9a7d4562f33bb76d8b9324b1c")
add_versions("0.58.0", "3d403550ae440d4aac607bd61a9c4140ee98390c48ed44594eebef55308466ed")
add_versions("0.62.0", "c83cb8c6d05877c4b4a050879a82ca6482472b8ea5dea48e608ce61544c34924")
else
add_urls("https://github.com/sciapp/gr/releases/download/v$(version)/gr-$(version)-Linux-x86_64.tar.gz")
add_versions("0.57.0", "793fef6a18f8faa7bc4fbb2067691bc355a9111b5c2ae5ea41f3552d6c7064d5")
add_versions("0.58.0", "d7350611e7bd8a3ff1034b2d13fe4c10c65f99c85c994a32e6dd6da59cb7de3c")
add_versions("0.62.0", "99da04bda9520e99181dd28a175de3689d699e0bbe09495d328b715d17f874a2")
end
elseif is_arch("x86") then
add_urls("https://github.com/sciapp/gr/releases/download/v$(version)/gr-$(version)-Linux-i386.tar.gz")
add_versions("0.57.0", "f6ec390e1f9b2a0a83d5b7da95ebfe615aedc84075475a28c363b671353c65c5")
add_versions("0.58.0", "681dbd0fa7cea25e189d4f58e5a4b7cf002cea2b13a663df67598f95f6a548a6")
add_versions("0.62.0", "2a5bc4959c7254b24d37ee31d5a2294ecdd956730e8ec8abd8d17dde3cc91a01")
end
end

@ -9,6 +9,7 @@ package("imath")
add_versions("v3.1.0", "211c907ab26d10bd01e446da42f073ee7381e1913d8fa48084444bc4e1b4ef87")
add_versions("v3.1.1", "a63fe91d8d0917acdc31b0c9344b1d7dbc74bf42de3e3ef5ec982386324b9ea4")
add_versions("v3.1.2", "f21350efdcc763e23bffd4ded9bbf822e630c15ece6b0697e2fcb42737c08c2d")
add_versions("v3.1.3", "0bf7ec51162c4d17a4c5b850fb3f6f7a195cff9fa71f4da7735f74d7b5124320")
on_load(function (package)
if not package.is_built or package:is_built() then

@ -21,7 +21,7 @@ package("jasper")
on_install("windows", "macosx", "linux", function (package)
io.replace("build/cmake/modules/JasOpenGL.cmake", "find_package(GLUT", "find_package(FreeGLUT", {plain = true})
local configs = {"-DJAS_ENABLE_PROGRAMS=OFF", "-DJAS_ENABLE_DOC=OFF"}
local vs_sdkver = get_config("vs_sdkver")
local vs_sdkver = import("core.tool.toolchain").load("msvc"):config("vs_sdkver")
if vs_sdkver then
local build_ver = string.match(vs_sdkver, "%d+%.%d+%.(%d+)%.?%d*")
assert(tonumber(build_ver) >= 18362, "Jasper requires Windows SDK to be at least 10.0.18362.0")

@ -0,0 +1,30 @@
package("libmspack")
set_homepage("https://www.cabextract.org.uk/libmspack/")
set_description("libmspack is a portable library for some loosely related Microsoft compression formats.")
set_license("LGPL-2.0")
add_urls("https://github.com/kyz/libmspack/archive/refs/tags/$(version).zip",
"https://github.com/kyz/libmspack.git")
add_versions("v0.10.1alpha", "d51e3b0d42afef91939fb282f7712e0b81c243ffe0aaacafc977d384408b4ab1")
on_install("windows", "macosx", "linux", function (package)
os.cd("libmspack/mspack")
io.writefile("xmake.lua", [[
add_rules("mode.debug", "mode.release")
target("mspack")
set_kind("$(kind)")
add_defines("HAVE_INTTYPES_H=1")
add_files("*.c|debug.c")
add_includedirs(".")
add_headerfiles("mspack.h")
if is_plat("windows") and is_kind("shared") then
add_files("mspack.def")
end
]])
import("package.tools.xmake").install(package)
end)
on_test(function (package)
assert(package:has_cfuncs("mspack_create_chm_decompressor", {includes = "mspack.h"}))
end)

@ -10,6 +10,7 @@ package("openexr")
add_versions("2.5.7", "36ecb2290cba6fc92b2ec9357f8dc0e364b4f9a90d727bf9a57c84760695272d")
add_versions("3.1.0", "8c2ff765368a28e8210af741ddf91506cef40f1ed0f1a08b6b73bb3a7faf8d93")
add_versions("3.1.1", "045254e201c0f87d1d1a4b2b5815c4ae54845af2e6ec0ab88e979b5fdb30a86e")
add_versions("3.1.3", "6f70a624d1321319d8269a911c4032f24950cde52e76f46e9ecbebfcb762f28c")
add_deps("cmake")
add_deps("zlib")

@ -8,6 +8,7 @@ package("openvdb")
add_versions("7.1.0", "0c3588c1ca6e647610738654ec2c6aaf41a203fd797f609fbeab1c9f7c3dc116")
add_versions("8.0.1", "a6845da7c604d2c72e4141c898930ac8a2375521e535f696c2cd92bebbe43c4f")
add_versions("8.1.0", "3e09d47331429be7409a3a3c27fdd3c297f96d31d2153febe194e664a99d6183")
add_versions("9.0.0", "ad3816e8f1931d1d6fdbddcec5a1acd30695d049dd10aa965096b2fb9972b468")
add_deps("cmake")
add_deps("boost", {system = false, configs = {regex = true, system = true, iostreams = true}})
@ -19,23 +20,35 @@ package("openvdb")
add_configs("lod", {description = "Command line binary for generating volume mipmaps from an OpenVDB grid.", default = false, type = "boolean"})
add_configs("render", {description = "Command line binary for ray-tracing OpenVDB grids.", default = false, type = "boolean"})
add_configs("view", {description = "Command line binary for displaying OpenVDB grids in a GL viewport.", default = false, type = "boolean"})
add_configs("nanovdb", {description = "Enable building of NanoVDB Module.", default = false, type = "boolean"})
on_load("macosx", "linux", "windows", function (package)
if package:config("with_houdini") == "" then
package:add("deps", "zlib")
package:add("deps", "blosc ~1.5.0", {configs = {shared = package:is_plat("linux")}})
package:add("deps", "openexr", {configs = {shared = package:is_plat("windows")}})
if package:version():ge("9.0.0") then
package:add("deps", "blosc")
else
package:add("deps", "blosc ~1.5.0", {configs = {shared = package:is_plat("linux")}})
package:add("deps", "openexr 2.x", {configs = {shared = package:is_plat("windows")}})
end
if package:config("with_maya") == "" then
package:add("deps", "tbb <2021.0")
package:add("deps", package:version():ge("9.0.0") and "tbb" or "tbb <2021.0")
end
end
if package:config("view") then
package:add("deps", "glew", {configs = {shared = true}})
package:add("deps", "glfw")
end
if package:config("render") then
package:add("deps", "libpng")
end
if not package:config("shared") then
package:add("defines", "OPENVDB_STATICLIB")
end
if package:version():ge("9.0.0") and package:config("nanovdb") then
package:add("deps", "cuda")
package:add("deps", "optix")
end
if package:is_plat("windows") then
package:add("defines", "_USE_MATH_DEFINES")
package:add("defines", "NOMINMAX")
@ -43,6 +56,8 @@ package("openvdb")
end)
on_install("macosx", "linux", "windows", function (package)
io.replace("cmake/FindBlosc.cmake", "${BUILD_TYPE} ${_BLOSC_LIB_NAME}", "${BUILD_TYPE} blosc libblosc", {plain = true})
io.replace("cmake/FindTBB.cmake", "Tbb_${COMPONENT}_LIB_TYPE STREQUAL STATIC", "TRUE", {plain = true})
local configs = {"-DOPENVDB_BUILD_DOCS=OFF", "-DUSE_PKGCONFIG=OFF", "-DBoost_USE_STATIC_LIBS=ON", "-DUSE_CCACHE=OFF"}
if package:config("shared") then
table.insert(configs, "-DOPENVDB_CORE_SHARED=ON")
@ -53,7 +68,7 @@ package("openvdb")
end
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
if package:is_plat("windows") then
if package:config("shared") and package:config("vs_runtime"):startswith("MT") then
if package:version():lt("9.0.0") and package:config("shared") and package:config("vs_runtime"):startswith("MT") then
raise("OpenVDB shared library cannot be linked to a static msvc runtime")
end
table.insert(configs, "-DBoost_USE_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
@ -81,6 +96,10 @@ package("openvdb")
table.insert(configs, "-DUSE_EXR=ON")
end
end
if package:version():ge("9.0.0") then
table.insert(configs, "-DUSE_NANOVDB=" .. (package:config("nanovdb") and "ON" or "OFF"))
table.insert(configs, "-DNANOVDB_USE_CUDA=ON")
end
import("package.tools.cmake").install(package, configs)
package:addenv("PATH", "bin")
end)
@ -96,4 +115,14 @@ package("openvdb")
}
]]}, {configs = {languages = "c++14"},
includes = {"openvdb/openvdb.h", "openvdb/tools/LevelSetSphere.h"}}))
if package:version():ge("9.0.0") and package:config("nanovdb") then
assert(package:check_cxxsnippets({test = [[
void test() {
nanovdb::GridBuilder<float> builder(0.0f);
auto acc = builder.getAccessor();
acc.setValue(nanovdb::Coord(1, 2, 3), 1.0f);
}
]]}, {configs = {languages = "c++14"},
includes = {"nanovdb/util/GridBuilder.h"}}))
end
end)

@ -7,6 +7,7 @@ package("poco")
add_urls("https://github.com/pocoproject/poco/archive/refs/tags/poco-$(version)-release.tar.gz",
"https://github.com/pocoproject/poco.git")
add_versions("1.11.0", "8a7bfd0883ee95e223058edce8364c7d61026ac1882e29643822ce9b753f3602")
add_versions("1.11.1", "2412a5819a239ff2ee58f81033bcc39c40460d7a8b330013a687c8c0bd2b4ac0")
if is_plat("windows") then
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
@ -40,7 +41,7 @@ package("poco")
table.insert(configs, "-DPOCO_MT=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
end
if package:is_plat("windows") then
local vs_sdkver = get_config("vs_sdkver")
local vs_sdkver = import("core.tool.toolchain").load("msvc"):config("vs_sdkver")
if vs_sdkver then
local build_ver = string.match(vs_sdkver, "%d+%.%d+%.(%d+)%.?%d*")
assert(tonumber(build_ver) >= 18362, "poco requires Windows SDK to be at least 10.0.18362.0")

Loading…
Cancel
Save