local git_ref = '87b170ca43007e4a867d1d46c4e251a421e58294'
local modrev = 'scm'
local specrev = '1'

local repo_url = 'https://github.com/rimeinn/tellenc.nvim'

rockspec_format = '3.0'
package = 'tellenc.nvim'
if modrev:sub(1, 1) == '$' then
  modrev = "scm"
  specrev = "1"
  repo_url = "https://github.com/rimeinn/tellenc.nvim"
  package = repo_url:match("/([^/]+)/?$")
end
version = modrev ..'-'.. specrev

description = {
  summary = 'A neovim plugin to detect the encoding of a text file. neovim 中文输入改进计划',
  detailed = '',
  labels = { 'tellenc', 'neovim' },
  homepage = 'https://tellenc-nvim.readthedocs.io',
  license = 'GPL-3.0',
}

build_dependencies = { "luanativeobjects" }

dependencies = { "lua >= 5.1" }

test_dependencies = {}

source = {
  url = repo_url .. '/archive/' .. git_ref .. '.zip',
  dir = 'tellenc.nvim-' .. '87b170ca43007e4a867d1d46c4e251a421e58294',
}

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

build = {
  type = 'xmake',
  copy_directories = {'scripts', 'plugin'},
  install = {
    conf = {
      ['..'] = 'shell.nix'
    },
  },
}
