Browse Source

add uriparser, minizip and draco (#384)

* update icu4c

* add uriparser

* add minizip

* add draco
Hoildkv 4 years ago
parent
commit
a6d6a2fc27

+ 21 - 0
packages/d/draco/xmake.lua

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

+ 1 - 0
packages/i/icu4c/xmake.lua

@@ -6,6 +6,7 @@ package("icu4c")
     add_urls("https://github.com/unicode-org/icu/releases/download/release-$(version)-src.tgz", {version = function (version)
             return (version:gsub("%.", "-")) .. "/icu4c-" .. (version:gsub("%.", "_"))
         end})
+    add_versions("69.1", "4cba7b7acd1d3c42c44bb0c14be6637098c7faf2b330ce876bc5f3b915d09745")
     add_versions("68.2", "c79193dee3907a2199b8296a93b52c5cb74332c26f3d167269487680d479d625")
     add_versions("68.1", "a9f2e3d8b4434b8e53878b4308bd1e6ee51c9c7042e2b1a376abefb6fbb29f2d")
     add_versions("64.2", "627d5d8478e6d96fc8c90fed4851239079a561a6a8b9e48b0892f24e82d31d6c")

+ 37 - 0
packages/m/minizip/xmake.lua

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

+ 32 - 0
packages/u/uriparser/xmake.lua

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