SUMMARY="A lightweight unit testing framework for C++"
DESCRIPTION="UnitTest++ was designed to do test-driven development on a wide \
variety of platforms. Simplicity, portability, speed, and small footprint \
are all very important aspects of UnitTest++. UnitTest++ is mostly standard \
C++ and makes minimal use of advanced library and language features, which \
means it should be easily portable to just about any platform."
HOMEPAGE="https://unittest-cpp.github.io/"
COPYRIGHT="2006 Noel Llopis and Charles Nicholson"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/unittest-cpp/unittest-cpp/releases/download/v$portVersion/unittest-cpp-$portVersion.tar.gz"
CHECKSUM_SHA256="1d1b118518dc200e6b87bbf3ae7bfd00a0cfc6be708255f98e5e3d627a7c9f98"
SOURCE_DIR="unittest-cpp-$portVersion"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86 x86_gcc2"

libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
	unittest++$secondaryArchSuffix = $portVersion
	lib:libunittest++$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	unittest++${secondaryArchSuffix}_devel = $portVersion
	devel:libunittest++$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES_devel="
	unittest++$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:git
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

defineDebugInfoPackage unittest++$secondaryArchSuffix \
	"$libDir"/libUnitTest++.so.$libVersion

BUILD()
{
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	rm "$libDir"/*.la

	prepareInstalledDevelLibs libUnitTest++
	fixPkgconfig

	packageEntries devel \
		$developDir
}

TEST()
{
	make check
}
