add libsais (#1547)

pull/1551/head
ruki 2 years ago committed by GitHub
parent c0e86e23af
commit 2e7576efff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      packages/l/libsais/xmake.lua
  2. 1
      scripts/new.lua

@ -0,0 +1,27 @@
package("libsais")
set_homepage("https://github.com/IlyaGrebnov/libsais")
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.")
set_license("Apache-2.0")
add_urls("https://github.com/IlyaGrebnov/libsais/archive/refs/tags/$(version).tar.gz",
"https://github.com/IlyaGrebnov/libsais.git")
add_versions("v2.7.1", "5f459ad90cd007c30aaefb7d122bba2a4307ea02915c56381be4b331cca92545")
on_install(function (package)
local configs = {}
io.writefile("xmake.lua", [[
add_rules("mode.release", "mode.debug")
target("libsais")
set_kind("$(kind)")
add_files("src/*.c")
add_headerfiles("src/(*.h)")
]])
if package:config("shared") then
configs.kind = "shared"
end
import("package.tools.xmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("libsais_create_ctx", {includes = "libsais.h"}))
end)

@ -155,6 +155,7 @@ function _generate_package_from_github(reponame)
file:print(' target("%s")', packagename) file:print(' target("%s")', packagename)
file:write(' set_kind("$(kind)")\n') file:write(' set_kind("$(kind)")\n')
file:print(' add_files("src/*.c")') file:print(' add_files("src/*.c")')
file:print(' add_headerfiles("src/(*.h)")')
file:print(' ]])') file:print(' ]])')
file:print(' if package:config("shared") then') file:print(' if package:config("shared") then')
file:print(' configs.kind = "shared"') file:print(' configs.kind = "shared"')

Loading…
Cancel
Save