Skip to content

Commit

Permalink
ci: use rockspec template to fix build on windows (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb authored Mar 8, 2024
1 parent bda587a commit e457e9b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/luarocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
detailed_description: |
A Lua port of fzy's fuzzy string matching algorithm.
This includes both a pure Lua implementation and a compiled C implementation with a Lua wrapper.
fzy tries to find the result the user wants by favoring consecutive
matches, and matches at the beginnings of words.
copy_directories: |
docs
test_interpreters: "lua"
template: ".github/workflows/rockspec.template"
46 changes: 46 additions & 0 deletions .github/workflows/rockspec.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
local git_ref = '$git_ref'
local modrev = '$modrev'
local specrev = '$specrev'

local repo_url = '$repo_url'

rockspec_format = '3.0'
package = '$package'
version = modrev ..'-'.. specrev

description = {
summary = '$summary',
detailed = $detailed_description,
labels = $labels,
homepage = '$homepage',
$license
}

dependencies = $dependencies

test_dependencies = $test_dependencies

source = {
url = repo_url .. '/archive/' .. git_ref .. '.zip',
dir = '$repo_name-' .. '$archive_dir_suffix',
}

if modrev == 'scm' or modrev == 'dev' then
source = {
url = repo_url:gsub('https', 'git')
}
end

build = {
type = "builtin",
modules = {
fzy = "src/fzy.lua",
fzy_lua = "src/fzy_lua.lua",
fzy_native = {
sources = { "src/fzy_native.c", "src/match.c" },
defines = { "LUA_COMPAT_5_1" }
}
},

copy_directories = $copy_directories,
}

0 comments on commit e457e9b

Please sign in to comment.