# Description: A configurable statusbar plugin for zellij
# URL: https://github.com/dj95/zjstatus
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: rust-wasm zellij

name=zjstatus
version=0.23.0
release=1
source=(https://github.com/dj95/zjstatus/archive/v$version/$name-$version.tar.gz)

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

  cd $name-$version

  CARGO_TARGET_WASM32_WASIP1_LINKER=wasm-ld \
  cargo build --release

  install -Dt $PKG/usr/bin target/wasm32-wasip1/release/$name.wasm
  install -Dt $PKG/usr/bin target/wasm32-wasip1/release/zjframes.wasm
}
