xmake.lua 999 B

12345678910111213141516171819202122232425
  1. package("popt")
  2. set_homepage("http://ftp.rpm.org/popt/")
  3. set_description("C library for parsing command line parameters")
  4. set_license("MIT")
  5. add_urls("http://ftp.rpm.org/popt/releases/popt-1.x/popt-$(version).tar.gz",
  6. "https://ftp.osuosl.org/pub/rpm/popt/releases/popt-1.x/popt-$(version).tar.gz")
  7. add_versions("1.19", "c25a4838fc8e4c1c8aacb8bd620edb3084a3d63bf8987fdad3ca2758c63240f9")
  8. if is_plat("macosx") then
  9. add_deps("libintl")
  10. add_deps("libiconv", {system = true})
  11. end
  12. on_install("linux", "macosx", function (package)
  13. local configs = {}
  14. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  15. table.insert(configs, package:is_debug() and "--enable-debug" or "--disable-debug")
  16. import("package.tools.autoconf").install(package, configs)
  17. end)
  18. on_test(function (package)
  19. assert(package:has_cfuncs("poptGetContext", {includes = "popt.h"}))
  20. end)