# Description: CLI tool for tree-sitter
# URL: https://github.com/tree-sitter/tree-sitter
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: rust tree-sitter
# Optional: nodejs

name=tree-sitter-cli
version=0.22.5
release=1
source=(https://github.com/tree-sitter/tree-sitter/archive/v$version/tree-sitter-$version-$release.tar.gz)

build() {
  cd tree-sitter-$version/cli
  prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
  [[ ! -e $PKGMK_SOURCE_DIR/rust ]] && mkdir $PKGMK_SOURCE_DIR/rust

  cargo build --release

  install -Dt $PKG/usr/bin ../target/release/tree-sitter
}
