# Haikuporter does not want the summary to start with "Tidy". How nice.
SUMMARY="(stupid) Tidy the layout and correct errors in HTML and XML documents"
DESCRIPTION="Tidy tidies HTML and XML. It can tidy your documents by itself, \
and developers can easily integrate its features into even more powerful tools."
HOMEPAGE="http://www.html-tidy.org/"
SOURCE_URI="https://github.com/htacg/tidy-html5/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="be81e967537984fbd207b4b19d02e7be73cbf201f07bf55aa5560c9b1d19b106"
SOURCE_DIR="tidy-html5-$portVersion"
PATCHES="tidy-$portVersion.patchset"
REVISION="2"
LICENSE="MIT"
COPYRIGHT="1998-2015 World Wide Web Consortium"
ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	tidy$secondaryArchSuffix = $portVersion
	cmd:tidy$secondaryArchSuffix
	lib:libtidy$secondaryArchSuffix = 5.1.25 compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"
PROVIDES_devel="
	devel:libtidy$secondaryArchSuffix = 5.1.25 compat >= 5
	devel:libtidys$secondaryArchSuffix
	"
REQUIRES_devel="
	tidy$secondaryArchSuffix == $portVersion base
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:cmake
	cmd:make
	"

BUILD()
{
	cd build/cmake
	cmake ../.. $cmakeDirArgs -DINCLUDE_INSTALL_DIR=develop/headers
	make $jobArgs
}
INSTALL()
{
	cd build/cmake
	make install
	prepareInstalledDevelLibs libtidy libtidys
	packageEntries devel $developDir
}
TEST()
{
	cd test
	sh testall.sh
}
