ruki 2 years ago
parent
commit
92ec2cea7e
1 changed files with 24 additions and 0 deletions
  1. 24 0
      packages/o/orangeduck_mpc/xmake.lua

+ 24 - 0
packages/o/orangeduck_mpc/xmake.lua

@@ -0,0 +1,24 @@
+package("orangeduck_mpc")
+
+    set_homepage("https://github.com/orangeduck/mpc")
+    set_description("A Parser Combinator library for C")
+
+    add_urls("https://github.com/orangeduck/mpc/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/orangeduck/mpc.git")
+    add_versions("0.9.0", "da6e798accec57d7b0512ecc38adc151961adefde09811c1c25ee993a653e47c")
+
+    on_install(function (package)
+        io.writefile("xmake.lua", [[
+        add_rules("mode.debug", "mode.release")
+        target("mpc")
+            set_kind("static")
+            add_files("mpc.c")
+            add_headerfiles("mpc.h")
+        ]])
+        local configs = {}
+        import("package.tools.xmake").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:has_cfuncs("mpc_new", {includes = "mpc.h"}))
+    end)