add uriparser, minizip and draco (#384)
* update icu4c * add uriparser * add minizip * add dracopull/385/head
parent
e0c77aa0da
commit
a6d6a2fc27
4 changed files with 91 additions and 0 deletions
@ -0,0 +1,21 @@ |
||||
package("draco") |
||||
|
||||
set_homepage("https://google.github.io/draco/") |
||||
set_description("Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds.") |
||||
set_license("Apache-2.0") |
||||
|
||||
add_urls("https://github.com/google/draco/archive/refs/tags/$(version).tar.gz", |
||||
"https://github.com/google/draco.git") |
||||
add_versions("1.4.1", "83aa5637d36a835103a61f96af7ff04c6d6528e643909466595d51ee715417a9") |
||||
|
||||
add_deps("cmake") |
||||
on_install("windows", "linux", "macosx", function (package) |
||||
local configs = {"-DCMAKE_INSTALL_LIBDIR=lib"} |
||||
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:has_cxxtypes("draco::Status", {configs = {languages = "c++17"}, includes = {"iostream", "draco/core/status.h"}})) |
||||
end) |
@ -0,0 +1,37 @@ |
||||
package("minizip") |
||||
|
||||
set_homepage("https://www.zlib.net/") |
||||
set_description("Mini zip and unzip based on zlib") |
||||
|
||||
add_urls("https://github.com/madler/zlib/archive/v$(version).tar.gz") |
||||
add_versions("1.2.10", "42cd7b2bdaf1c4570e0877e61f2fdc0bce8019492431d054d3d86925e5058dc5") |
||||
add_versions("1.2.11", "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff") |
||||
|
||||
add_deps("zlib") |
||||
on_install(function (package) |
||||
os.cd(path.join("contrib", "minizip")) |
||||
io.writefile("xmake.lua", [[ |
||||
add_rules("mode.debug", "mode.release") |
||||
add_requires("zlib") |
||||
target("minizip") |
||||
set_kind("$(kind)") |
||||
add_files("zip.c", "unzip.c", "mztools.c", "ioapi.c") |
||||
add_headerfiles("crypt.h", "zip.h", "unzip.h", "ioapi.h", "mztools.h") |
||||
add_packages("zlib") |
||||
if is_plat("windows") then |
||||
add_files("iowin32.c") |
||||
add_headerfiles("iowin32.h") |
||||
end |
||||
]]) |
||||
local configs = {} |
||||
if package:config("shared") then |
||||
configs.kind = "shared" |
||||
elseif not package:is_plat("windows", "mingw") and package:config("pic") ~= false then |
||||
configs.cxflags = "-fPIC" |
||||
end |
||||
import("package.tools.xmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("inflate", {includes = "zip.h"})) |
||||
end) |
@ -0,0 +1,32 @@ |
||||
package("uriparser") |
||||
|
||||
set_homepage("https://uriparser.github.io/") |
||||
set_description("uriparser is a strictly RFC 3986 compliant URI parsing and handling library written in C89.") |
||||
set_license("BSD-3-Clause") |
||||
|
||||
add_urls("https://github.com/uriparser/uriparser/archive/refs/tags/uriparser-$(version).tar.gz") |
||||
add_versions("0.9.5", "dece5067b4517c4b16cde332c491b4b3508249d2a8f4ba393229575d3c5241c0") |
||||
|
||||
add_deps("cmake") |
||||
on_load(function (package) |
||||
if not package:config("shared") then |
||||
package:add("defines", "URI_STATIC_BUILD") |
||||
end |
||||
end) |
||||
|
||||
on_install("windows", "linux", "macosx", function (package) |
||||
local configs = {"-DURIPARSER_BUILD_DOCS=OFF", "-DURIPARSER_BUILD_TESTS=OFF", "-DURIPARSER_BUILD_TOOLS=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, "-DURIPARSER_MSVC_RUNTIME=/" .. package:config("vs_runtime")) |
||||
end |
||||
if package:config("pic") ~= false then |
||||
table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON") |
||||
end |
||||
import("package.tools.cmake").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("uriParseSingleUriA", {includes = "uriparser/Uri.h"})) |
||||
end) |
Loading…
Reference in new issue