xmake.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. package("libsodium")
  2. set_homepage("https://libsodium.org")
  3. set_description("Sodium is a new, easy-to-use software library for encryption, decryption, signatures, password hashing and more.")
  4. set_license("ISC")
  5. set_urls("https://download.libsodium.org/libsodium/releases/libsodium-$(version).tar.gz",
  6. "https://github.com/jedisct1/libsodium/releases/download/$(version)-RELEASE/libsodium-$(version).tar.gz",
  7. "https://github.com/jedisct1/libsodium.git")
  8. add_versions("1.0.20", "ebb65ef6ca439333c2bb41a0c1990587288da07f6c7fd07cb3a18cc18d30ce19")
  9. add_versions("1.0.19", "018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea")
  10. add_versions("1.0.18", "6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1")
  11. if is_plat("linux", "macosx") then
  12. add_deps("autoconf", "automake", "libtool", "pkg-config")
  13. end
  14. on_install(function (package)
  15. if not package:config("shared") then
  16. package:add("defines", "SODIUM_STATIC")
  17. end
  18. if package:is_plat("linux", "macosx") then
  19. import("package.tools.autoconf").install(package)
  20. else
  21. os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
  22. import("package.tools.xmake").install(package)
  23. end
  24. end)
  25. on_test(function (package)
  26. assert(package:has_cfuncs("sodium_init", {includes = "sodium.h"}))
  27. end)