SUMMARY="An interactive process viewer for Unix"
DESCRIPTION="This is htop, an interactive process viewer for Unix systems. It \
is a text-mode application (for console or X terminals) and requires ncurses."
HOMEPAGE="http://hisham.hm/htop/"
COPYRIGHT="2004-2016 Hisham Muhammad"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="https://github.com/hishamhm/htop/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="1e93e6743dddad254fac2ad0d83b00a82173c75ecbd6ef6f7d55da690eb64b92"
PATCHES="htop-$portVersion.patchset"

ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	htop$secondaryArchSuffix = $portVersion
	cmd:htop$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libncursesw$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libncursesw$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:python
	"

BUILD()
{
	autogen.sh
	sed -i 's/-lm//g' configure
	CFLAGS=-D_BSD_SOURCE LDFLAGS=-lbsd runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install
}
