xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. package("libcap-ng")
  2. set_homepage("https://github.com/stevegrubb/libcap-ng")
  3. set_description("Libcap-ng is a library for Linux that makes using posix capabilities easy.")
  4. add_urls("https://github.com/stevegrubb/libcap-ng/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/stevegrubb/libcap-ng.git")
  6. add_versions("v0.8.5", "e4be07fdd234f10b866433f224d183626003c65634ed0552b02e654a380244c2")
  7. add_configs("utils", {description = "Build utilities.", default = true, type = "boolean"})
  8. add_deps("autotools")
  9. on_install("linux", function (package)
  10. local configs = {
  11. "--disable-dependency-tracking",
  12. "--without-python3"
  13. }
  14. table.insert(configs, "--with-debug=" .. (package:is_debug() and "yes" or "no"))
  15. local subdirs = {"src", "m4"}
  16. if package:config("utils") then
  17. table.insert(subdirs, "utils")
  18. end
  19. io.replace("Makefile.am", "SUBDIRS = src utils m4 docs", "SUBDIRS = " .. table.concat(subdirs, " "), {plain = true})
  20. io.replace("src/Makefile.am", "SUBDIRS = test", "SUBDIRS =", {plain = true})
  21. import("package.tools.autoconf").install(package, configs)
  22. end)
  23. on_test(function (package)
  24. assert(package:has_cfuncs("capng_setpid", {includes = "cap-ng.h"}))
  25. end)