2
0

xmake.lua 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package("exosip")
  2. set_homepage("https://savannah.nongnu.org/projects/exosip")
  3. set_description("eXosip is a library that hides the complexity of using the SIP protocol for mutlimedia session establishement")
  4. set_license("GPL-2.0")
  5. add_urls("https://git.savannah.nongnu.org/cgit/exosip.git/snapshot/exosip-$(version).tar.gz",
  6. "git://git.savannah.gnu.org/exosip.git")
  7. add_versions("5.3.0", "66c2b2ddcfdc8807054fa31f72a6068ef66d98bedd9aedb25b9031718b9906a2")
  8. add_deps("autoconf", "m4", "libtool", "automake", "osip", "openssl3")
  9. add_links("eXosip2", "osip2", "osipparser2")
  10. if is_plat("macosx") then
  11. add_syslinks("resolv")
  12. add_frameworks("CoreFoundation")
  13. add_deps("pkg-config")
  14. elseif is_plat("linux") then
  15. add_syslinks("pthread", "resolv")
  16. end
  17. on_check("macosx", function (package)
  18. assert(package:check_cxxsnippets({test = [[
  19. #include "TargetConditionals.h"
  20. #include <CoreFoundation/CoreFoundation.h>
  21. #include <CoreServices/CoreServices.h>
  22. #include <Security/Security.h>
  23. void test() {
  24. SInt32 osx_version = 0;
  25. OSErr res = Gestalt(gestaltSystemVersion, &osx_version);
  26. }
  27. ]]}))
  28. end)
  29. on_install("macosx", "linux", function (package)
  30. local configs = {"--disable-trace", "--enable-pthread=force"}
  31. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  32. table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
  33. if not package:debug() then
  34. table.insert(configs, "--disable-debug")
  35. end
  36. import("package.tools.autoconf").install(package, configs)
  37. end)
  38. on_test(function (package)
  39. assert(package:has_cfuncs("eXosip_lock", {includes = "eXosip2/eXosip.h", "eXosip2.h"}))
  40. end)