xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package("libseccomp")
  2. set_homepage("https://github.com/seccomp/libseccomp")
  3. set_description("The libseccomp library provides an easy to use, platform independent, interface to the Linux Kernel's syscall filtering mechanism.")
  4. set_license("LGPL-2.1")
  5. add_urls("https://github.com/seccomp/libseccomp/releases/download/v$(version)/libseccomp-$(version).tar.gz",
  6. "https://github.com/seccomp/libseccomp.git")
  7. add_versions("2.6.0", "83b6085232d1588c379dc9b9cae47bb37407cf262e6e74993c61ba72d2a784dc")
  8. add_configs("tools", {description = "Build tools.", default = false, type = "boolean"})
  9. add_deps("gperf")
  10. on_load(function (package)
  11. if package:gitref() then
  12. package:add("deps", "autotools")
  13. end
  14. end)
  15. on_install("linux", function (package)
  16. local configs = {
  17. "--disable-dependency-tracking",
  18. "--disable-python"
  19. }
  20. local subdirs = {"include", "src"}
  21. if package:config("tools") then
  22. table.insert(subdirs, "tools")
  23. end
  24. io.replace("Makefile.in", "include src tools tests doc", table.concat(subdirs, " "), {plain = true})
  25. import("package.tools.autoconf").install(package, configs)
  26. end)
  27. on_test(function (package)
  28. assert(package:has_cfuncs("seccomp_version", {includes = "seccomp.h"}))
  29. end)