new bblfs: dev-util/tree-sitter-cli-0.25.10
This commit is contained in:
40
dev-util/tree-sitter-cli-0.25.10.PKGBUILD
Normal file
40
dev-util/tree-sitter-cli-0.25.10.PKGBUILD
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
pkgname=tree-sitter-cli
|
||||||
|
pkgbase=tree-sitter
|
||||||
|
pkgver=0.25.10
|
||||||
|
pkgdesc="Command-line tool for creating and testing tree-sitter grammars"
|
||||||
|
homepage="https://github.com/tree-sitter/tree-sitter"
|
||||||
|
license=("MIT")
|
||||||
|
depends=("tree-sitter")
|
||||||
|
sources=("${pkgbase}-${pkgver}.tar.gz")
|
||||||
|
urls=("https://github.com/${pkgbase}/${pkgbase}/archive/refs/tags/v${pkgver}.tar.gz")
|
||||||
|
sha512sums=("f0465a2fabe303c1b62f1f55ed08aa57372ac11370d229adcccd99b5e8067be53e92da281cdfbcd034e2ecefb33ac90a119eeac9035670ac8fbaa4242cb87a11")
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
tar -xf ${distdir}/${sources[0]} --strip-components=1
|
||||||
|
pushd cli
|
||||||
|
cargo fetch --locked --target "$(rustc --print host-tuple)"
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
|
src_build() {
|
||||||
|
pushd cli
|
||||||
|
cargo build --release --locked --offline
|
||||||
|
for completion in bash fish zsh; do
|
||||||
|
cargo run --frozen --release -- \
|
||||||
|
complete --shell $completion > $completion-completions
|
||||||
|
done
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
install -Dt "$pkgdir"/usr/bin target/release/$pkgbase
|
||||||
|
install -Dm644 -t "$pkgdir"/usr/share/licenses/${pkgbase}-cli LICENSE
|
||||||
|
|
||||||
|
pushd cli
|
||||||
|
install -Dm644 bash-completions "$pkgdir"/usr/share/bash-completion/completions/$pkgbase
|
||||||
|
install -Dm644 fish-completions "$pkgdir"/usr/share/fish/vendor_completions.d/$pkgbase.fish
|
||||||
|
install -Dm644 zsh-completions "$pkgdir"/usr/share/zsh/site-functions/_$pkgbase
|
||||||
|
popd
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim:ft=sh syn=sh et sw=2:
|
||||||
Reference in New Issue
Block a user