# Maintainer: Christian Hesse <mail@eworm.de>
# Maintainer: Angel Velasquez <angvp@archlinux.org>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=htop
pkgver=2.0.2
pkgrel=2
pkgdesc='Interactive process viewer'
arch=('x86_64')
url='https://hisham.hm/htop/'
license=('GPL')
depends=('ncurses' 'libnl')
makedepends=('python')
optdepends=('lsof: show files opened by a process'
            'strace: attach to a running process')
options=('!emptydirs' debug)
validpgpkeys=('8460980B2B79786DE0C7FCC83FD8F43C2BB3C478') # Hisham Muhammad <h@hisham.hm>
#source=('https://github.com/wbenny/htop/archive/2.0.2-2.tar.gz')
source=('git+https://github.com/wbenny/htop')
sha256sums=(            'SKIP')

Xprepare() {
  cd "$pkgname-$pkgver-$pkgrel"

  patch -Np1 < "${srcdir}"/0001-fix-option-string.patch
}

build() {
  cd "$pkgname-$pkgver-$pkgrel"

#./autogen.sh \
  ./configure \
      --prefix=/usr \
      --sysconfdir=/etc \
      --enable-cgroup \
      --enable-delayacct \
      --enable-openvz \
      --enable-unicode \
      --enable-vserver

  make
}

package() {
  make -C "$pkgname-$pkgver-$pkgrel" DESTDIR="$pkgdir" install
}
