Explorar el Código

add package clara, lyra and tinyobjloader (#146)

* add package clara and lyra

* add package tinyobjloader
Hoildkv hace 4 años
padre
commit
48baf57fc4
Se han modificado 3 ficheros con 80 adiciones y 0 borrados
  1. 21 0
      packages/c/clara/xmake.lua
  2. 24 0
      packages/l/lyra/xmake.lua
  3. 35 0
      packages/t/tinyobjloader/xmake.lua

+ 21 - 0
packages/c/clara/xmake.lua

@@ -0,0 +1,21 @@
+package("clara")
+
+    set_homepage("https://github.com/catchorg/Clara")
+    set_description("A simple to use, composable, command line parser for C++ 11 and beyond.")
+    set_license("BSL-1.0")
+
+    add_urls("https://github.com/catchorg/Clara/archive/v$(version).tar.gz")
+    add_versions("1.1.5", "767dc1718e53678cbea00977adcd0a8a195802a505aec3c537664cf25a173142")
+
+    on_install(function (package)
+        os.cp("include", package:installdir())
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            void test() {
+                bool flag = false;
+                auto p = clara::Opt(flag, "true|false")["-f"]("A flag");
+            }
+        ]]}, {configs = {languages = "c++11"}, includes = "clara.hpp"}))
+    end)

+ 24 - 0
packages/l/lyra/xmake.lua

@@ -0,0 +1,24 @@
+package("lyra")
+
+    set_homepage("https://www.bfgroup.xyz/Lyra/")
+    set_description("A simple to use, composable, command line parser for C++ 11 and beyond")
+    set_license("BSL-1.0")
+
+    add_urls("https://github.com/bfgroup/Lyra/archive/1.5.1.tar.gz",
+             "https://github.com/bfgroup/Lyra.git")
+    add_versions("1.5.1", "11ccdfc6f776b9a2ebe987d9b4e492981f88f3642546fd1c2e1115741863cae0")
+
+    on_install(function (package)
+        os.cp("include", package:installdir())
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            void test() {
+                int width = 0;
+                auto cli = lyra::cli()
+                    | lyra::opt(width, "width")
+                        ["-w"]["--width"]("How wide should it be?");
+            }
+        ]]}, {configs = {languages = "c++17"}, includes = "lyra/lyra.hpp"}))
+    end)

+ 35 - 0
packages/t/tinyobjloader/xmake.lua

@@ -0,0 +1,35 @@
+package("tinyobjloader")
+
+    set_homepage("https://github.com/tinyobjloader/tinyobjloader")
+    set_description("Tiny but powerful single file wavefront obj loader")
+    set_license("MIT")
+
+    add_urls("https://github.com/tinyobjloader/tinyobjloader/archive/v$(version).tar.gz",
+             "https://github.com/tinyobjloader/tinyobjloader.git")
+    add_versions("1.0.7", "b9d08b675ba54b9cb00ffc99eaba7616d0f7e6f6b8947a7e118474e97d942129")
+
+    add_configs("double", {description = "Use double precision floating numbers.", default = false, type = "boolean"})
+
+    on_install("macosx", "linux", "windows", "mingw", "android", "iphoneos", function (package)
+        local kind = package:config("shared") and "shared" or "static"
+        io.writefile("xmake.lua", string.format([[
+            add_rules("mode.debug", "mode.release")
+            target("tinyobjloader")
+                set_kind("%s")
+                %s
+                add_files("tiny_obj_loader.cc")
+                add_headerfiles("tiny_obj_loader.h")
+        ]], kind, (package:config("double") and "add_defines(\"TINYOBJLOADER_USE_DOUBLE\")" or "")))
+        import("package.tools.xmake").install(package)
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <vector>
+            void test() {
+                tinyobj::attrib_t attrib;
+                std::vector<tinyobj::shape_t> shapes;
+                std::vector<tinyobj::material_t> materials;
+            }
+        ]]}, {configs = {languages = "c++11"}, includes = "tiny_obj_loader.h"}))
+    end)