# Maintainer: FadeMind <fademind@gmail.com>
# Contributor: Alexey D. <lq07829icatm@rambler.ru>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=extra-cmake-modules-git
_pkgname=${pkgname%-git}
pkgver=6.28.0.r6.g7533289
pkgrel=1
epoch=2
pkgdesc="Extra modules and scripts for CMake. (GIT version)"
arch=('any')
url="https://community.kde.org/Frameworks"
license=('LGPL')
groups=('kf6-git')
depends=('cmake')
makedepends=(
	'git'
	'python-sphinx'
	'python-requests'
	'qt6-tools'
	'qt6-base'
	'qt6-declarative'
)
conflicts=("${_pkgname}")
provides=("${_pkgname}")
optdepends=(
	'python-pyxdg: to generate fastlane metadata for Android apps'
	'python-requests: to generate fastlane metadata for Android apps'
	'python-yaml: to generate fastlane metadata for Android apps'
	'clang: for clang support'
)
source=("git+https://invent.kde.org/frameworks/${_pkgname}.git")
sha256sums=('SKIP')

pkgver() {
	cd "${_pkgname}/"
	git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//;s/.rc/rc/'
}

build() {
	cmake -S "${_pkgname}" -B build \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_QTHELP_DOCS=ON \
		-DBUILD_TESTING=ON \
		-DQT_MAJOR_VERSION=6

	cmake --build build
}

package() {
	DESTDIR="${pkgdir}" cmake --install build
}
