xmake.lua 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package("stfl")
  2. set_homepage("https://github.com/newsboat/stfl")
  3. set_description("stfl with Newsboat-related bugfixes")
  4. set_license("LGPL-3.0")
  5. add_urls("https://github.com/newsboat/stfl.git")
  6. add_versions("2024.12.24", "bbb2404580e845df2556560112c8aefa27494d66")
  7. if is_plat("linux", "bsd") then
  8. add_syslinks("pthread")
  9. elseif is_plat("macosx") then
  10. add_syslinks("iconv")
  11. end
  12. add_deps("ncurses")
  13. on_check("android", function (package)
  14. local ndk = package:toolchain("ndk")
  15. local ndkver = ndk:config("ndkver")
  16. local ndk_sdkver = ndk:config("ndk_sdkver")
  17. if ndkver and tonumber(ndkver) == 27 then
  18. assert(ndk_sdkver and tonumber(ndk_sdkver) > 21, "package(stfl) require ndk api level > 21")
  19. end
  20. end)
  21. on_install("!wasm and !iphoneos and !mingw and @!windows", function (package)
  22. io.writefile("xmake.lua", [[
  23. add_rules("mode.release", "mode.debug")
  24. add_requires("ncurses")
  25. target("stfl")
  26. set_kind("$(kind)")
  27. add_files("*.c|example.c")
  28. add_files("widgets/*.c")
  29. add_includedirs(".")
  30. add_defines("_XOPEN_SOURCE=700", "_GNU_SOURCE")
  31. add_headerfiles("stfl.h")
  32. if is_plat("linux", "bsd") then
  33. add_syslinks("pthread")
  34. elseif is_plat("macosx") then
  35. add_syslinks("iconv")
  36. end
  37. add_packages("ncurses")
  38. ]])
  39. import("package.tools.xmake").install(package)
  40. end)
  41. on_test(function (package)
  42. assert(package:has_cfuncs("stfl_create", {includes = "stfl.h"}))
  43. end)