xmake.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. package("libsais")
  2. set_homepage("https://github.com/IlyaGrebnov/libsais")
  3. set_description("libsais is a library for linear time suffix array, longest common prefix array and burrows wheeler transform construction based on induced sorting algorithm.")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/IlyaGrebnov/libsais/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/IlyaGrebnov/libsais.git")
  7. add_versions("v2.8.0", "71f608d1e2a28652e66076f42becc3bbd3e0c8a21ba11a4de226a51459e894a9")
  8. add_versions("v2.7.5", "613c597b64fb096738d4084e0f2eb3b490aded7295cffc7fb23bdccc30097ebf")
  9. add_versions("v2.7.3", "45d37dc12975c4d40db786f322cd6dcfd9f56a8f23741205fcd0fca6ec0bf246")
  10. add_versions("v2.7.1", "5f459ad90cd007c30aaefb7d122bba2a4307ea02915c56381be4b331cca92545")
  11. on_install(function (package)
  12. local configs = {}
  13. io.writefile("xmake.lua", [[
  14. add_rules("mode.release", "mode.debug")
  15. target("libsais")
  16. set_kind("$(kind)")
  17. add_files("src/*.c")
  18. add_includedirs("include")
  19. add_headerfiles("include/(*.h)")
  20. add_headerfiles("src/(*.h)")
  21. ]])
  22. if package:config("shared") then
  23. configs.kind = "shared"
  24. end
  25. import("package.tools.xmake").install(package, configs)
  26. end)
  27. on_test(function (package)
  28. assert(package:has_cfuncs("libsais_create_ctx", {includes = "libsais.h"}))
  29. end)