SUMMARY="Qt Quick Controls 2"
DESCRIPTION="The Qt Quick Controls 2 module delivers the next generation user \
interface controls based on Qt Quick. In comparison to the desktop-oriented \
Qt Quick Controls 1, Qt Quick Controls 2 are an order of magnitude simpler, \
lighter and faster, and are primarily targeted towards embedded and mobile platforms."
HOMEPAGE="https://github.com/qt/qtquickcontrols2"
COPYRIGHT="2015-2020 The Qt Company Ltd."
LICENSE="GNU LGPL v2.1
	GNU LGPL v3
	FDL"
REVISION="1"
SOURCE_URI="https://github.com/qt/qtquickcontrols2/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="d905d14ccab0ecd5661c6a3a18b9d68099a8f5d8dc71934de8584ba83eeef6d9"
SOURCE_DIR="qtquickcontrols2-$portVersion"

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

PROVIDES="
	qtquickcontrols2$secondaryArchSuffix = $portVersion
	lib:libQt5QuickControls2$secondaryArchSuffix = $portVersion
	lib:libQt5QuickTemplates2$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Network$secondaryArchSuffix
	lib:libQt5Qml$secondaryArchSuffix
	lib:libQt5Quick$secondaryArchSuffix
	"

PROVIDES_devel="
	qtquickcontrols2${secondaryArchSuffix}_devel = $portVersion
	devel:libQt5QuickControls2$secondaryArchSuffix = $portVersion
	devel:libQt5QuickTemplates2$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	qtquickcontrols2$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libGL$secondaryArchSuffix
	devel:libQt5Core$secondaryArchSuffix
	devel:libQt5Gui$secondaryArchSuffix
	devel:libQt5Network$secondaryArchSuffix
	devel:libQt5Qml$secondaryArchSuffix
	devel:libQt5Quick$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:qmake >= 5
	"

BUILD()
{
	qmake
	make $jobArgs
}

INSTALL()
{
	make INSTALL_ROOT=$prefix install

	mv $prefix/boot/system/* $prefix
	rm -rf $libDir/*.la
	rm -rf $prefix/boot

	prepareInstalledDevelLibs libQt5QuickControls2 libQt5QuickTemplates2
	fixPkgconfig

	packageEntries devel \
		$developDir \
		$libDir/cmake
}
