Explorar o código

step20: add new package (#7360)

* step20: add package

* re

* fixup
Saikari hai 2 meses
pai
achega
0e4efa814d
Modificáronse 1 ficheiros con 33 adicións e 0 borrados
  1. 33 0
      packages/s/step20/xmake.lua

+ 33 - 0
packages/s/step20/xmake.lua

@@ -0,0 +1,33 @@
+package("step20")
+    set_kind("library", {headeronly = true})
+    set_homepage("https://github.com/storm-ptr/step20")
+    set_description("Step20 is a C++20, header-only library of STL-like algorithms and data structures")
+    set_license("MIT")
+
+    add_urls("https://github.com/storm-ptr/step20.git")
+    add_versions("2023.08.21", "4b163b99f05da6de96fe67879c200d80055adc87")
+
+    if on_check then
+        on_check("android", function (package)
+            local ndk = package:toolchain("ndk")
+            local ndkver = ndk:config("ndkver")
+            assert(ndkver and tonumber(ndkver) > 22, "package(step20) require ndk version > 22")
+        end)
+    end
+
+    on_install(function (package)
+        os.cp("*.hpp", package:installdir("include/step20"))
+        os.cp("detail/*.hpp", package:installdir("include/step20/detail"))
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <step20/to.hpp>
+            #include <array>
+            #include <vector>
+            void test() {
+                std::array arr{1, 2, 3, 4, 5};
+                auto vec = step20::to<std::vector<int>>(arr);
+            }
+        ]]}, {configs = {languages = "c++20"}}))
+    end)