xmake.lua 1.0 KB

123456789101112131415161718192021222324252627
  1. package("libintl")
  2. set_homepage("https://www.gnu.org/software/gettext/")
  3. set_description("GNU gettext runtime")
  4. add_urls("https://ftp.gnu.org/gnu/gettext/gettext-$(version).tar.xz")
  5. add_versions("0.21", "d20fcbb537e02dcf1383197ba05bd0734ef7bf5db06bdb241eb69b7d16b73192")
  6. if is_plat("windows") then
  7. add_syslinks("advapi32")
  8. end
  9. on_install("windows", "macosx", "android", function (package)
  10. -- on linux libintl is already a part of libc
  11. os.cp(path.join(os.scriptdir(), "port", "xmake.lua"), "xmake.lua")
  12. io.replace("gettext-runtime/config.h.in", "$", "", {plain = true})
  13. io.replace("gettext-runtime/config.h.in", "# ?undef (.-)\n", "${define %1}\n")
  14. import("package.tools.xmake").install(package, {
  15. vers = package:version_str(),
  16. relocatable = true,
  17. installprefix = package:installdir():gsub("\\", "/")
  18. })
  19. end)
  20. on_test(function (package)
  21. assert(package:has_cfuncs("ngettext", {includes = "libintl.h"}))
  22. end)