SUMMARY="A plugin which allows clang to understand Qt semantics"
DESCRIPTION="clazy is a compiler plugin which allows clang to understand Qt \
semantics. You get more than 50 Qt related compiler warnings, ranging from \
unneeded memory allocations to misusage of API, including fix-its for \
automatic refactoring."
HOMEPAGE="https://www.kdab.com"
COPYRIGHT="2016-2019 Sérgio Martins"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://download.kde.org/stable/clazy/$portVersion/src/clazy-$portVersion.tar.xz"
CHECKSUM_SHA256="806d1befaddba82316f4ea34f1cba38bcc7545d0981007e3527c1ff1576dd0de"

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

PROVIDES="
	clazy$secondaryArchSuffix = $portVersion
	cmd:clazy
	cmd:clazy_standalone
	lib:ClangLazy = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libLLVM_9$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libLLVM_9$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:clang_9
	cmd:cmake
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	mkdir -p build
	cd build
	cmake -DCMAKE_INSTALL_PREFIX=$prefix \
		-DSHARE_INSTALL_DIR:STRING=$docDir \
		-DCMAKE_BUILD_TYPE=Release ..

	make $jobArgs
}

INSTALL()
{
	cd build
	make install

	rm -rf $prefix/share
}

TEST()
{
	cd build
	make check
}
