# Maintainer: PktSurf <smlinux@pktsurf.in>
app=vim
version=9.0.1000
build=2sml
homepage="https://www.vim.org/"
download="https://github.com/vim/vim/archive/refs/tags/v$version.tar.gz"
desc="Vi IMproved UNIX text editor"
requires="netbsd-curses"
noautoconfsite=1

prepbuilddir() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions
}

build() {
  LIBS="-lcurses -lterminfo" \
  LDFLAGS="-static" \
  ./configure \
  --prefix="" \
  --sysconfdir=/etc \
  --disable-netbeans --disable-gui \
  --with-x=no --enable-multibyte --with-features=normal \
  --with-compiledby="<smlinux@pktsurf.in>" \
  --enable-terminal

  make
  make -j1 VIMRCLOC="$pkg"/etc install DESTDIR="$pkg" 

  cp *.md $pkgdocs/
  
  (
    cd $pkg/bin
    ln -s vim vi
  )

  mkfinalpkg
}

sha512sums="
487c42382235696aac57d2ad81431a7ad1db684063409c06e1ad73cb3f379e377a22841493e128ff4c4d32b88344b2eed076b8690e0a396f1c64466c26d78c52  vim-9.0.1000.tar.lz
"
