# Description: GUI for neovim, without any web bloat
# URL: https://github.com/vhakulinen/gnvim
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: gtk4 neovim rust
# Optional: webkitgtk

name=gnvim
version=0.3.1
release=1
source=(https://github.com/vhakulinen/gnvim/archive/v$version/$name-$version.tar.gz)

build() {
  prt-get isinst sccache && export RUSTC_WRAPPER='/usr/bin/sccache'
  mkdir "$PKGMK_SOURCE_DIR/rust" || true
  export CARGO_HOME="$PKGMK_SOURCE_DIR/rust"

  prt-get isinst webkitgtk || PKGMK_GNVIM+=' --no-default-features'

  sed -e 's|/usr/local/share/gnvim/runtime|/usr/share/gnvim/runtime|' \
    -i $name-$version/ui/src/arguments.rs
  make -C $name-$version build
  make -C $name-$version PREFIX=/usr DESTDIR=$PKG install
}
