# Maintainer: PktSurf <smlinux@pktsurf.in>
app=htop
version=3.2.2
build=2sml
homepage="https://htop.dev/"
download="https://github.com/$app-dev/$app/archive/refs/tags/$version.tar.gz"
desc="ncurses-based interactive process viewer written in C"
requires="netbsd-curses libcap lm-sensors"

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

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

build() {

# enabling unicode causes this error: 
# Meter.c:415:54: error: 'cchar_t' {aka 'const struct <anonymous>'} has no member named 'attr'
  ./configure \
    --prefix= \
    --bindir=/bin \
    --disable-unicode \
    --enable-sensors \
    --enable-capabilities

  make
  make install DESTDIR=$pkg

  cp COPYING $pkgdocs/

  mkfinalpkg
}

sha512sums="
ffe7566c048d82d56e5cc57d96d8fd3fe78c8e7e04815690dfe8ebeb1197f3ebff31d76176c96b671b5d71c659dc305c2ac11137bf6c2013ce85dbdcdd7b53e8  htop-3.2.2.tar.lz
"
