2
0

xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("fcgi")
  2. set_homepage("https://fastcgi-archives.github.io")
  3. set_description("Protocol for interfacing interactive programs with a web server")
  4. set_license("OML")
  5. set_urls("https://github.com/FastCGI-Archives/fcgi2/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/FastCGI-Archives/fcgi2.git")
  7. add_versions("2.4.6", "39af4fb21a6d695a5f0b1c4fa95776d2725f6bc6c77680943a2ab314acd505c1")
  8. if is_plat("windows", "mingw") and is_arch("x64", "x86_64") then
  9. add_patches("*", "patches/windows_type.patch", "921143191bc0f2c33773d35a7a0352ab04c95963e03073c3f9dc3ec5c7751340")
  10. end
  11. add_links("fcgi++", "fcgi")
  12. if is_plat("windows", "mingw") then
  13. add_syslinks("ws2_32")
  14. elseif is_plat("linux", "bsd") then
  15. add_syslinks("m")
  16. end
  17. on_install(function (package)
  18. if package:is_plat("windows") and not package:config("shared") then
  19. package:add("defines", "DLLAPI=")
  20. end
  21. os.cp(path.join(package:scriptdir(), "port", "fcgi_config.h.in"), "fcgi_config.h.in")
  22. os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
  23. import("package.tools.xmake").install(package, {ver = package:version_str()})
  24. end)
  25. on_test(function (package)
  26. assert(package:has_cfuncs("FCGI_Accept", {includes = "fcgi_stdio.h"}))
  27. end)