Added installation of treesitter grammar for neovim
parent
bd6cd02946
commit
848f127b19
30
PKGBUILD
30
PKGBUILD
|
@ -1,7 +1,7 @@
|
||||||
# Maintainer: Jef Roosens
|
# Maintainer: Jef Roosens
|
||||||
|
|
||||||
pkgname=vieter-vls
|
pkgname=vieter-vls
|
||||||
pkgver=latest.r1.g5fbfe67
|
pkgver=latest.r0.g5fbfe67
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Language server for the V programming language; synced with the vieter-v compiler."
|
pkgdesc="Language server for the V programming language; synced with the vieter-v compiler."
|
||||||
arch=("x86_64" "aarch64")
|
arch=("x86_64" "aarch64")
|
||||||
|
@ -9,7 +9,7 @@ arch=("x86_64" "aarch64")
|
||||||
url="https://github.com/vlang/vls"
|
url="https://github.com/vlang/vls"
|
||||||
license=("MIT")
|
license=("MIT")
|
||||||
|
|
||||||
depends=("glibc" "vieter-v")
|
depends=("glibc" "vieter-v" "gc")
|
||||||
makedepends=("git" "gcc")
|
makedepends=("git" "gcc")
|
||||||
|
|
||||||
source=("$pkgname::git+https://github.com/vlang/vls")
|
source=("$pkgname::git+https://github.com/vlang/vls")
|
||||||
|
@ -22,12 +22,36 @@ pkgver() {
|
||||||
build() {
|
build() {
|
||||||
cd "$pkgname"
|
cd "$pkgname"
|
||||||
|
|
||||||
|
msg "Building vls..."
|
||||||
v run build.vsh gcc
|
v run build.vsh gcc
|
||||||
|
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
|
# Install vls
|
||||||
install -dm755 "$pkgdir/usr/bin"
|
install -dm755 "$pkgdir/usr/bin"
|
||||||
|
|
||||||
install -Dm755 "$pkgname/bin/vls" "$pkgdir/usr/bin/vls"
|
install -Dm755 "$pkgname/bin/vls" "$pkgdir/usr/bin/vls"
|
||||||
install -Dm644 "$pkgname/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname"
|
install -Dm644 "$pkgname/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname"
|
||||||
|
|
||||||
|
# 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"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue