SUMMARY="A disk usage analyser with a ncurses interface"
DESCRIPTION="Ncdu aims to be fast, simple and easy to use, \
and should be able to run in any minimal POSIX-like environment \
with ncurses installed."
HOMEPAGE="https://dev.yorhel.nl/ncdu"
COPYRIGHT="2007-2019 Yoran Heling"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://dev.yorhel.nl/download/ncdu-$portVersion.tar.gz"
CHECKSUM_SHA256="2b915752a183fae014b5e5b1f0a135b4b408de7488c716e325217c2513980fd4"

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

# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
	commandBinDir=$prefix/bin
fi

PROVIDES="
	ncdu$secondaryArchSuffix = $portVersion
	cmd:ncdu = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libncurses$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libncurses$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	runConfigure --omit-dirs binDir ./configure \
		--bindir=$commandBinDir
	make $jobArgs
}

INSTALL()
{
	make install
}
