SUMMARY="Dates for holidays and other special events"
DESCRIPTION="This library provides a C++ API that determines holiday and \
other special events for a geographical region."
HOMEPAGE="https://github.com/KDE/kholidays/"
COPYRIGHT="2010-2021 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/kholidays/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="f56598873c97c67929e8d2a22dbb539b3b312a5654a1316e148f892c85cef738"

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

PROVIDES="
	kholidays$secondaryArchSuffix = $portVersion
	lib:libkf5holidays$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libbz2$secondaryArchSuffix
	lib:liblzma$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libbz2$secondaryArchSuffix
	devel:liblzma$secondaryArchSuffix
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:lrelease$secondaryArchSuffix >= 5
	cmd:make
	"

BUILD()
{
	mkdir -p build
	cd build

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

INSTALL()
{
	cd build
	make install

	prepareInstalledDevelLibs \
		libKF5Holidays

	fixPkgconfig

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

TEST()
{
	cd build
	make test
}
