vlang-ls-git/PKGBUILD

54 lines
1.5 KiB
Bash

# Maintainer: Jef Roosens
_pkgname='vls'
pkgbase=vlang-ls-git
pkgname=('vlang-ls-git' 'vlang-ls-git-nvim-ts')
pkgver=r783.66b92a8
pkgrel=1
arch=('x86_64' 'aarch64')
url='https://github.com/vlang/vls'
license=('MIT')
makedepends=('git' 'vlang')
source=("${_pkgname}::git+https://github.com/vlang/vls")
md5sums=('SKIP')
pkgver() {
cd "${_pkgname}"
echo "r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}
build() {
cd "${_pkgname}"
v run build.vsh "${CC:-gcc}"
msg "Building treesitter grammar..."
# Building with -prod is required because otherwise, the binary contains
# tcc symbols which isn't usually installed on the user's system.
v -cc "${CC:-gcc}" -shared -prod tree_sitter_v
}
package_vlang-ls-git() {
pkgdesc='Language server for the V programming language'
depends=('glibc' 'vlang')
install -dm755 "${pkgdir}/usr/bin"
install -Dm755 "${_pkgname}/bin/vls" "${pkgdir}/usr/bin/vls"
install -Dm644 "${_pkgname}/LICENSE" -t "${pkgdir}/usr/share/licenses/${_pkgname}"
}
package_vlang-ls-git-nvim-ts() {
pkgdesc="Treesitter grammar for V for the Neovim treesitter plugin"
depends=('glibc')
install -dm755 "${pkgdir}/usr/share/nvim/runtime/parser"
install -dm755 "${pkgdir}/usr/share/nvim/runtime/queries/v"
install -Dm755 "${_pkgname}/tree_sitter_v/tree_sitter_v.so" "${pkgdir}/usr/share/nvim/runtime/parser/v.so"
install -m644 "${_pkgname}/tree_sitter_v/queries"/* "${pkgdir}/usr/share/nvim/runtime/queries/v"
}