SUMMARY="Installation and loading of additional content as packages"
DESCRIPTION="The KPackage framework lets the user install and load packages \
of non binary content such as scripted extensions or graphic assets, as if \
they were traditional plugins."
HOMEPAGE="https://github.com/KDE/kpackage/"
COPYRIGHT="2010-2021 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kpackage/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="41c06f881eb9ba250b4a03103953f8768dae7558469e9a96152ccd2323931582"

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

PROVIDES="
	kpackage$secondaryArchSuffix = $portVersion
	cmd:kpackagetool5$secondaryArchSuffix = $portVersion
	lib:libKF5Package$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libKF5Archive$secondaryArchSuffix
	lib:libKF5CoreAddons$secondaryArchSuffix
	lib:libKF5I18n$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libKF5Archive$secondaryArchSuffix == $portVersion
	devel:libKF5CoreAddons$secondaryArchSuffix == $portVersion
	devel:libKF5I18n$secondaryArchSuffix == $portVersion
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:lrelease$secondaryArchSuffix >= 5
	cmd:make
	cmd:python2
	"

BUILD()
{
	mkdir -p build
	cd build

	cmake .. $cmakeDirArgs \
		-DCMAKE_BUILD_TYPE=Release \
		-DECM_DIR=/system/data/cmake/Modules/ECM/cmake
	make $jobArgs
}

INSTALL()
{
	cd build
	make install

	prepareInstalledDevelLibs \
		libKF5Package

	packageEntries devel \
		$libDir/cmake \
		$developDir
}

TEST()
{
	cd build
	make test
}
