xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("xmlto")
  2. set_kind("binary")
  3. set_homepage("https://pagure.io/xmlto")
  4. set_description("Convert XML to another format (based on XSL or other tools)")
  5. set_license("GPL-2.0")
  6. add_urls("https://releases.pagure.org/xmlto/xmlto-$(version).tar.bz2",
  7. "https://pagure.io/xmlto.git")
  8. add_versions("0.0.28", "1130df3a7957eb9f6f0d29e4aa1c75732a7dfb6d639be013859b5c7ec5421276")
  9. add_deps("flex", {kind = "binary"})
  10. add_deps("util-linux")
  11. on_install("macosx", "linux", function (package)
  12. import("package.tools.autoconf")
  13. io.replace("xmlif/xmlif.l",[[static ifsense;]],[[static int ifsense;]],{plain = true})
  14. io.replace("xmlif/xmlif.l",[[main(int argc, char *argv[])]],[[int main(int argc, char *argv[])]],{plain = true})
  15. local envs = autoconf.buildenvs(package)
  16. local getopt = package:dep("util-linux"):fetch()
  17. for _, dir in ipairs(getopt.linkdirs) do
  18. local prefix = path.directory(dir)
  19. local opt_path = path.join(prefix, "bin", "getopt")
  20. if os.isfile(opt_path) then
  21. envs.GETOPT = opt_path
  22. end
  23. end
  24. local config = {"--disable-dependency-tracking"}
  25. autoconf.install(package, config, {envs = envs})
  26. end)
  27. on_test(function (package)
  28. os.vrun("xmlto --version")
  29. end)