# Template file for 'kf6-kxmlgui'
pkgname=kf6-kxmlgui
version=6.25.0
revision=1
_llvmver=21
build_style=cmake
configure_args="$(vopt_bool python BUILD_PYTHON_BINDINGS)"
hostmakedepends="extra-cmake-modules qt6-tools qt6-base gettext kf6-kconfig
 $(vopt_if python "python3-build python3-setuptools shiboken6 llvm${_llvmver}")"
makedepends="kf6-kconfig-devel kf6-kconfigwidgets-devel qt6-base-private-devel
 kf6-kitemviews-devel kf6-kiconthemes-devel kf6-kglobalaccel-devel
 kf6-kguiaddons-devel kf6-kcoreaddons-devel kf6-ki18n-devel
 kf6-kwidgetsaddons-devel
 $(vopt_if python 'libshiboken6-devel libpyside6-devel python3-devel')"
short_desc="KDE Framework for managing menu and toolbar actions"
maintainer="John <me@johnnynator.dev>"
license="LGPL-2.1-or-later"
homepage="https://invent.kde.org/frameworks/kxmlgui"
distfiles="${KDE_SITE}/frameworks/${version%.*}/${pkgname#kf6-}-${version}.tar.xz"
checksum=02d97c24ec0bc102c299f3429056b45025e24d59ec31464317a3062cc1fc2021

build_options="python"
build_options_default="python"

if [ "$CROSS_BUILD" ]; then
	configure_args+=" -DECM_SHIBOKEN_ARCH=$XBPS_CROSS_RUST_TARGET"
	configure_args+=" -DSYSROOT_INCLUDE_DIRS=$XBPS_CROSS_BASE/usr/include"
fi
export LLVM_INSTALL_DIR=/usr/lib/llvm/${_llvmver}

do_check() {
	cd build
	# disable failing test
	ctest -E "ktoolbar_unittest|kxmlgui_unittest"
}

kf6-kxmlgui-devel_package() {
	depends="${sourcepkg}>=${version}_${revision} qt6-base-devel
	 kf6-kconfig-devel kf6-kconfigwidgets-devel kf6-kguiaddons-devel"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/cmake
		vmove "usr/lib/*.so"
	}
}
