2
0

xmake.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("libaesgm")
  2. set_homepage("https://github.com/xmake-mirror/libaesgm")
  3. set_description("https://repology.org/project/libaesgm/packages")
  4. add_urls("https://github.com/xmake-mirror/libaesgm/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/xmake-mirror/libaesgm.git")
  6. add_versions("2013.1.1", "102353a486126c91ccab791c3e718d056d8fbb1be488da81b26561bc7ef4f363")
  7. on_install("linux", "macosx", "windows", "mingw", function (package)
  8. if package:is_plat("windows", "mingw") and package:is_arch("arm", "arm64") then
  9. -- Windows is always little endian
  10. io.replace("brg_endian.h", [[
  11. #elif 0 /* **** EDIT HERE IF NECESSARY **** */
  12. # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN]], [[
  13. #elif 1 /* Edited: Windows ARM is little endian */
  14. # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN]], { plain = true })
  15. end
  16. local configs = {}
  17. io.writefile("xmake.lua", [[
  18. add_rules("mode.release", "mode.debug")
  19. target("aesgm")
  20. set_kind("$(kind)")
  21. add_files("*.c")
  22. add_headerfiles("*.h")
  23. ]])
  24. if package:config("shared") then
  25. configs.kind = "shared"
  26. end
  27. import("package.tools.xmake").install(package, configs)
  28. end)
  29. on_test(function (package)
  30. assert(package:has_cfuncs("aes_init", {includes = "aes.h"}))
  31. end)