SUMMARY="Lightweight user interface framework for mobile and convergent applications"
DESCRIPTION="Kirigami is KDE's powerful but lightweight user interface framework for \
mobile and convergent applications. It allows Qt developers to easily create applications \
that run on most major mobile and desktop platforms without modification (though adapted \
user interfaces for different form-factors are supported and recommended for optimal user \
experience). It extends the touch-friendly Qt Quick Controls 2 with larger application \
building blocks, following the design philosophy laid out in the KDE Human Interface Guidelines."
HOMEPAGE="https://techbase.kde.org/Kirigami"
COPYRIGHT="2010-2022 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kirigami/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="6f09333f93d1a1e2f0faaf1c4ac6ac2260d8ed5423f0dc7215829befe58ae7f7"

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

PROVIDES="
	kirigami$secondaryArchSuffix = $portVersion
	lib:libKF5Kirigami2$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	"

PROVIDES_devel="
	kirigami${secondaryArchSuffix}_devel = $portVersion
	devel:libKF5Kirigami2$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES_devel="
	kirigami$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libQt5Core$secondaryArchSuffix >= 5.15
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:lrelease$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	sed -e '/ecm_find_qmlmodule/ s/^#*/#/' -i CMakeLists.txt

	mkdir -p build
	cd build

	cmake .. $cmakeDirArgs \
		-DCMAKE_BUILD_TYPE=Release \
		-DKDE_INSTALL_QMLDIR=$dataDir/Qt5/qml \
		-DECM_MKSPECS_INSTALL_DIR=$dataDir/Qt5/mkspecs \
		-DECM_DIR=/system/data/cmake/Modules/ECM/cmake \
		-DBUILD_EXAMPLES=OFF \
		-DDISABLE_DBUS=ON
	make $jobArgs
}

INSTALL()
{
	cd build
	make install

	prepareInstalledDevelLibs \
		libKF5Kirigami2

	packageEntries devel \
		$libDir/cmake \
		$dataDir/Qt5/mkspecs \
		$developDir
}

TEST()
{
	cd build
	make test
}
