SUMMARY="Qt API for storing passwords securely"
DESCRIPTION="QtKeychain is a Qt API to store passwords \
and other secret data securely. \
How the data is stored depends on the platform."
HOMEPAGE="https://github.com/frankosterfeld/qtkeychain"
COPYRIGHT="2011-2016 Frank Osterfeld, Mathias Hasselmann"
LICENSE="BSD (2-clause)" #XXX: modified
REVISION="1"
SOURCE_URI="https://github.com/frankosterfeld/qtkeychain/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="cc547d58c1402f6724d3ff89e4ca83389d9e2bdcfd9ae3d695fcdffa50a625a8"
SOURCE_DIR="qtkeychain-$portVersion"

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

PROVIDES="
	qtkeychain${secondaryArchSuffix} = $portVersion
	lib:libqt5keychain$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku${secondaryArchSuffix}
	lib:libQt5Core$secondaryArchSuffix
	"

PROVIDES_devel="
	qtkeychain${secondaryArchSuffix}_devel = $portVersion
	devel:libqt5keychain$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	qtkeychain${secondaryArchSuffix} == $portVersion base
	devel:libQt5Core$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libQt5Core$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++${secondaryArchSuffix}
	cmd:linguist$secondaryArchSuffix >= 5
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	cmake -B build \
		$cmakeDirArgs \
		-DCMAKE_BUILD_TYPE=Release \
		-DINTERFACE_INCLUDE_SUFFIX=$relativeIncludeDir \
		-DECM_MKSPECS_INSTALL_DIR=$dataDir/Qt5/mkspecs \
		-DQTKEYCHAIN_TRANSLATIONS_DIR=$dataDir/Qt5/translations \
		-DBUILD_TEST_APPLICATION=OFF \
		-Wno-dev
	cmake --build build
}

INSTALL()
{
	cmake --install build

	prepareInstalledDevelLib \
		libqt5keychain

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