浏览代码

inja: fix header only kind (#4844)

* inja: fix header only kind

* limit plat

* fix test.lua
star9029 1 年之前
父节点
当前提交
56c462fa87
共有 2 个文件被更改,包括 12 次插入9 次删除
  1. 12 6
      packages/i/inja/xmake.lua
  2. 0 3
      scripts/test.lua

+ 12 - 6
packages/i/inja/xmake.lua

@@ -1,19 +1,25 @@
 package("inja")
 package("inja")
-
+    set_kind("library", {headeronly = true})
     set_homepage("https://pantor.github.io/inja/")
     set_homepage("https://pantor.github.io/inja/")
     set_description("A Template Engine for Modern C++")
     set_description("A Template Engine for Modern C++")
     set_license("MIT")
     set_license("MIT")
 
 
-    add_urls("https://github.com/pantor/inja/archive/$(version).tar.gz",
+    add_urls("https://github.com/pantor/inja/archive/refs/tags/$(version).tar.gz",
              "https://github.com/pantor/inja.git")
              "https://github.com/pantor/inja.git")
 
 
-    add_versions("v2.1.0", "038ecde8f6dbad5d3cedb6ceb0853fd0e488d5dc57593a869633ecb30b0dfa6e")
     add_versions("v3.4.0", "7155f944553ca6064b26e88e6cae8b71f8be764832c9c7c6d5998e0d5fd60c55")
     add_versions("v3.4.0", "7155f944553ca6064b26e88e6cae8b71f8be764832c9c7c6d5998e0d5fd60c55")
+    add_versions("v2.1.0", "038ecde8f6dbad5d3cedb6ceb0853fd0e488d5dc57593a869633ecb30b0dfa6e")
 
 
-    add_deps("nlohmann_json")
+    add_deps("cmake")
+    add_deps("nlohmann_json", {configs = {cmake = true}})
 
 
-    on_install(function (package)
-        os.cp("single_include/inja", package:installdir("include"))
+    on_install("!wasm", function (package)
+        import("package.tools.cmake").install(package, {
+            "-DINJA_INSTALL=ON",
+            "-DINJA_USE_EMBEDDED_JSON=OFF",
+            "-DBUILD_TESTING=OFF",
+            "-DBUILD_BENCHMARK=OFF"
+        })
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)

+ 0 - 3
scripts/test.lua

@@ -235,9 +235,6 @@ function get_modified_packages()
             if #packages > 0 and version then
             if #packages > 0 and version then
                 local lastpackage = packages[#packages]
                 local lastpackage = packages[#packages]
                 local splitinfo = lastpackage:split("%s+")
                 local splitinfo = lastpackage:split("%s+")
-                if #splitinfo == 1 then
-                    table.remove(packages)
-                end
                 table.insert(packages, splitinfo[1] .. " " .. version)
                 table.insert(packages, splitinfo[1] .. " " .. version)
             end
             end
         end
         end