xmake.lua 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package("aws-lc")
  2. set_homepage("https://github.com/aws/aws-lc")
  3. set_description("AWS-LC is a general-purpose cryptographic library maintained by the AWS Cryptography team for AWS and their customers. It іs based on code from the Google BoringSSL project and the OpenSSL project.")
  4. add_urls("https://github.com/aws/aws-lc/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/aws/aws-lc.git")
  6. add_versions("v1.41.1", "c81376005466339564c3ca5ad83c52ca350f79391414999d052b5629d008a4d6")
  7. add_versions("v1.40.0", "5397a2fdb60230912dae4d7aeb3847c6b39a2f820504abbf55e376ed6a175a55")
  8. add_versions("v1.39.0", "37f5a379081b97adba3e1316017e09484d6c4ed6dc336d57fae6f0b7b27472fc")
  9. add_versions("v1.37.0", "d5ba1bd922247ce8bdd9139289bf5a021237b121e1f29a323c0ef1730cb1ed07")
  10. add_versions("v1.34.2", "4958ac76edd53ced46d3a064cb58be8bd11e4937bcc3857623d319c2894d0904")
  11. add_versions("v1.32.0", "67fbb78659055c2289c9068bb4ca1c0f1b6ca27700c7f6d34c6bc2f27cd46314")
  12. add_configs("jitter", {description = "Enable FIPS entropy source: CPU Jitter", default = false, type = "boolean"})
  13. add_configs("go", {description = "Enable go", default = false, type = "boolean"})
  14. add_configs("perl", {description = "Enable perl", default = false, type = "boolean"})
  15. add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
  16. add_deps("cmake")
  17. if is_plat("windows", "mingw") or is_host("windows") then
  18. add_deps("nasm")
  19. end
  20. add_links("ssl", "crypto")
  21. if is_plat("windows", "mingw") then
  22. add_syslinks("ws2_32")
  23. elseif is_plat("linux", "bsd") then
  24. add_syslinks("pthread", "dl", "m")
  25. end
  26. on_load(function (package)
  27. if package:config("go") then
  28. package:add("deps", "go")
  29. end
  30. if package:config("perl") and package:is_plat() and (not package:is_precompiled()) then
  31. package:add("deps", "strawberry-perl")
  32. end
  33. end)
  34. on_install("!cross and windows|!arm64", function (package)
  35. if package:config("shared") and package:is_plat("windows") then
  36. package:add("defines", "BORINGSSL_SHARED_LIBRARY")
  37. end
  38. local configs = {
  39. "-DBUILD_TESTING=OFF",
  40. "-DCMAKE_INSTALL_INCLUDEDIR=include",
  41. "-DBUILD_LIBSSL=ON",
  42. }
  43. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  44. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  45. table.insert(configs, "-DENABLE_FIPS_ENTROPY_CPU_JITTER=" .. (package:config("jitter") and "ON" or "OFF"))
  46. table.insert(configs, "-DDISABLE_GO=" .. (package:config("go") and "OFF" or "ON"))
  47. table.insert(configs, "-DDISABLE_PERL=" .. (package:config("perl") and "OFF" or "ON"))
  48. table.insert(configs, "-DBUILD_TOOL=" .. (package:config("tools") and "ON" or "OFF"))
  49. import("package.tools.cmake").install(package, configs)
  50. end)
  51. on_test(function (package)
  52. assert(package:has_cfuncs("SSL_new", {includes = "openssl/ssl.h"}))
  53. end)