# Template file for 'kf6-kxmlgui'
# group=kde-frameworks
pkgname=kf6-kxmlgui
version=6.28.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=e40b86ebb9f1be00255cd4835ab0b0ac8650c47d0eb17a47d9df7d4b5658df58

# stage builds
makedepends+=" kf6-base"
shlib_requires="KDE_Frameworks.${version}"

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}

case "$XBPS_TARGET_MACHINE" in
	arm*) configure_args+=" -DSHIBOKEN_GENERATOR_EXTRA_FLAGS=--clang-option=-mfloat-abi=hard" ;;
esac

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"
	}
}
