2022-04-25 22:50:04 +02:00
|
|
|
# Maintainer: Jef Roosens
|
|
|
|
|
|
|
|
pkgname=vieter-vls
|
2022-04-26 16:58:41 +02:00
|
|
|
pkgver=latest.r0.g5fbfe67
|
2022-04-25 22:50:04 +02:00
|
|
|
pkgrel=1
|
|
|
|
pkgdesc="Language server for the V programming language; synced with the vieter-v compiler."
|
|
|
|
arch=("x86_64" "aarch64")
|
|
|
|
|
|
|
|
url="https://github.com/vlang/vls"
|
|
|
|
license=("MIT")
|
|
|
|
|
2022-04-26 16:58:41 +02:00
|
|
|
depends=("glibc" "vieter-v" "gc")
|
2022-04-25 22:50:04 +02:00
|
|
|
makedepends=("git" "gcc")
|
|
|
|
|
|
|
|
source=("$pkgname::git+https://github.com/vlang/vls")
|
|
|
|
md5sums=("SKIP")
|
|
|
|
|
|
|
|
pkgver() {
|
|
|
|
git -C "$pkgname" describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "$pkgname"
|
|
|
|
|
2022-04-26 16:58:41 +02:00
|
|
|
msg "Building vls..."
|
2022-04-25 22:50:04 +02:00
|
|
|
v run build.vsh gcc
|
2022-04-26 16:58:41 +02:00
|
|
|
|
|
|
|
msg "Building treesitter grammar..."
|
|
|
|
# Patch the language server files & build the shared library
|
|
|
|
# Neovim wants all functions in the grammar library to correctly use the
|
|
|
|
# filetype, which in this case is vlang. However, the standard codebase
|
|
|
|
# uses v as the name.
|
|
|
|
mv tree_sitter_v tree_sitter_vlang
|
|
|
|
|
|
|
|
find tree_sitter_vlang \
|
|
|
|
-\( -iname '*.v' -or -iname '*.c' -or -iname '*.h' -\) \
|
|
|
|
-exec sed -i 's/tree_sitter_v/tree_sitter_vlang/' "{}" \;
|
|
|
|
|
|
|
|
# Building with -prod is required because otherwise, the binary contains
|
|
|
|
# tcc symbols which isn't usually installed on the user's system.
|
|
|
|
v -shared -prod tree_sitter_vlang
|
2022-04-25 22:50:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2022-04-26 16:58:41 +02:00
|
|
|
# Install vls
|
2022-04-25 22:50:04 +02:00
|
|
|
install -dm755 "$pkgdir/usr/bin"
|
|
|
|
install -Dm755 "$pkgname/bin/vls" "$pkgdir/usr/bin/vls"
|
|
|
|
install -Dm644 "$pkgname/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname"
|
2022-04-26 16:58:41 +02:00
|
|
|
|
|
|
|
# Install treesitter grammar
|
|
|
|
# This package installs the parser & queries for Neovim in its runtimepath
|
|
|
|
install -dm755 "$pkgdir/usr/share/nvim/runtime/parser"
|
|
|
|
install -dm755 "$pkgdir/usr/share/nvim/runtime/queries/vlang"
|
|
|
|
install -Dm755 "$pkgname/tree_sitter_vlang/tree_sitter_vlang.so" "$pkgdir/usr/share/nvim/runtime/parser/vlang.so"
|
|
|
|
install -m644 "$pkgname/tree_sitter_vlang/queries"/* "$pkgdir/usr/share/nvim/runtime/queries/vlang"
|
|
|
|
|
2022-04-25 22:50:04 +02:00
|
|
|
}
|