Browse Source

Add xmlto (#822)

Kelvin Zhang 3 years ago
parent
commit
cf0e226403
1 changed files with 31 additions and 0 deletions
  1. 31 0
      packages/x/xmlto/xmake.lua

+ 31 - 0
packages/x/xmlto/xmake.lua

@@ -0,0 +1,31 @@
+package("xmlto")
+
+    set_kind("binary")
+    set_homepage("https://pagure.io/xmlto")
+    set_description("Convert XML to another format (based on XSL or other tools)")
+    set_license("GPL-2.0")
+
+    add_urls("https://releases.pagure.org/xmlto/xmlto-$(version).tar.bz2",
+             "https://pagure.io/xmlto.git")
+    add_versions("0.0.28", "1130df3a7957eb9f6f0d29e4aa1c75732a7dfb6d639be013859b5c7ec5421276")
+
+    add_deps("util-linux")
+
+    on_install("macosx", "linux", function (package)
+        import("package.tools.autoconf")
+        local envs = autoconf.buildenvs(package)
+        local getopt = package:dep("util-linux"):fetch()
+        for _, dir in ipairs(getopt.linkdirs) do
+            local prefix = path.directory(dir)
+            local opt_path = path.join(prefix, "bin", "getopt")
+            if os.isfile(opt_path) then
+                envs.GETOPT = opt_path
+            end
+        end
+        local config = {"--disable-dependency-tracking"}
+        autoconf.install(package, config, {envs = envs})
+    end)
+
+    on_test(function (package)
+        os.vrun("xmlto --version")
+    end)