xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. package("libmagic")
  2. set_homepage("https://www.darwinsys.com/file/")
  3. set_description("Implementation of the file(1) command")
  4. add_urls("https://astron.com/pub/file/file-$(version).tar.gz")
  5. add_versions("5.40", "167321f43c148a553f68a0ea7f579821ef3b11c27b8cbe158e4df897e4a5dd57")
  6. if is_plat("linux", "bsd") then
  7. add_deps("zlib")
  8. end
  9. on_install("macosx", "linux", "bsd", function (package)
  10. local configs = {"--disable-dependency-tracking",
  11. "--disable-silent-rules",
  12. "--disable-xzlib",
  13. "--disable-bzlib"}
  14. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  15. table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
  16. if package:debug() then
  17. table.insert(configs, "--enable-debug")
  18. end
  19. if package:config("pic") ~= false then
  20. table.insert(configs, "--with-pic")
  21. end
  22. import("package.tools.autoconf").install(package, configs)
  23. end)
  24. on_test(function (package)
  25. assert(package:has_cfuncs("magic_open", {includes = "magic.h"}))
  26. end)