# Template file for 'lua-language-server'
pkgname=lua-language-server
version=3.18.2
revision=1
hostmakedepends="ninja"
short_desc="Lua LSP implementation written in Lua"
maintainer="icp <pangolin@vivaldi.net>"
license="MIT"
homepage="https://luals.github.io"
changelog="https://raw.githubusercontent.com/LuaLS/lua-language-server/master/changelog.md"
distfiles="https://github.com/LuaLS/lua-language-server/releases/download/${version}/lua-language-server-${version}-submodules.zip"
checksum=cfb54fdf1d812e284477cb2e2d68a40de8b1c33e68e9073dd5d9d83165d97b33

do_build() {
	ninja -C 3rd/luamake -f compile/ninja/linux.ninja notest
	./3rd/luamake/luamake -platform ${XBPS_TARGET_MACHINE} rebuild
}

do_install() {
	vinstall main.lua 644 usr/lib/${pkgname}
	vinstall debugger.lua 644 usr/lib/${pkgname}
	vinstall changelog.md 644 usr/lib/${pkgname}
	vinstall bin/main.lua 644 usr/lib/${pkgname}/bin
	vinstall bin/${pkgname} 755 usr/lib/${pkgname}/bin

	vcopy meta usr/lib/${pkgname}
	vcopy locale usr/lib/${pkgname}
	vcopy script usr/lib/${pkgname}

	vbin ${FILESDIR}/lua-language-server
	vlicense LICENSE
}
