xmake.lua 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package("libressl")
  2. set_homepage("https://www.libressl.org/")
  3. set_description("LibreSSL is a version of the TLS/crypto stack forked from OpenSSL in 2014, with goals of modernizing the codebase, improving security, and applying best practice development processes.")
  4. add_urls("https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$(version).tar.gz")
  5. add_versions("3.4.2", "cb82ca7d547336917352fbd23db2fc483c6c44d35157b32780214ec74197b3ce")
  6. add_versions("3.7.3", "7948c856a90c825bd7268b6f85674a8dcd254bae42e221781b24e3f8dc335db3")
  7. add_versions("3.8.2", "6d4b8d5bbb25a1f8336639e56ec5088052d43a95256697a85c4ce91323c25954")
  8. if is_plat("windows") then
  9. add_deps("cmake")
  10. add_syslinks("ws2_32", "bcrypt")
  11. elseif is_plat("linux") then
  12. add_syslinks("pthread")
  13. end
  14. on_install("windows", function (package)
  15. local configs = {"-DLIBRESSL_TESTS=OFF", "-DLIBRESSL_APPS=OFF"}
  16. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  17. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  18. table.insert(configs, "-DUSE_STATIC_MSVC_RUNTIMES=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
  19. import("package.tools.cmake").install(package, configs)
  20. end)
  21. on_install("macosx", "linux", "bsd", function (package)
  22. local configs = {}
  23. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  24. table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
  25. if package:config("pic") then
  26. table.insert(configs, "--with-pic")
  27. end
  28. import("package.tools.autoconf").install(package, configs)
  29. end)
  30. on_test(function (package)
  31. assert(package:has_cfuncs("SSL_new", {includes = "openssl/ssl.h"}))
  32. end)