# Template file for 'ansible-language-server'
pkgname=ansible-language-server
version=1.2.1
revision=1
hostmakedepends="nodejs"
depends="nodejs"
short_desc="Ansible Language Server"
maintainer="John <me@johnnynator.dev>"
license="MIT"
homepage="https://als.rtfd.io/"
distfiles="https://github.com/ansible/ansible-language-server/archive/refs/tags/v${version}.tar.gz"
checksum=63974a183cc405cec4798e41853fa221851b19e8de06a8cad1493621e3f6a9bf

do_build() {
	npm install
	npm run compile
	rm -r node_modules
	npm install --omit=dev --ignore-scripts
}

do_install() {
	vlicense LICENSE

	vmkdir usr/bin
	vmkdir usr/lib/ansible-language-server
	vcopy bin/ usr/lib/ansible-language-server
	vcopy out/ usr/lib/ansible-language-server
	vcopy node_modules/ usr/lib/ansible-language-server

	ln -sf /usr/lib/ansible-language-server/bin/ansible-language-server \
		${DESTDIR}/usr/bin/ansible-language-server
}
