# Template file for 'kf6-kguiaddons'
pkgname=kf6-kguiaddons
version=6.25.0
revision=1
build_style=cmake
_llvmver=21
configure_args="-DKDE_INSTALL_QMLDIR=lib/qt6/qml
 $(vopt_bool python BUILD_PYTHON_BINDINGS)"
hostmakedepends="extra-cmake-modules qt6-tools qt6-base
 $(vopt_if python "shiboken6 python3-build python3-setuptools llvm${_llvmver}")
 wayland-devel pkg-config qt6-declarative-host-tools"
makedepends="plasma-wayland-protocols wayland-devel
 qt6-declarative-devel qt6-base-private-devel
 $(vopt_if python 'libshiboken6-devel libpyside6-devel python3-devel')"
depends="kf6-kguiaddons-geo-uri-handler"
short_desc="Addons to QtGui"
maintainer="John <me@johnnynator.dev>"
license="LGPL-2.1-or-later"
homepage="https://invent.kde.org/frameworks/kguiaddons"
distfiles="${KDE_SITE}/frameworks/${version%.*}/${pkgname#kf6-}-${version}.tar.xz"
checksum=38850963cb91978d08e781d81b147c7b66f78f4204ad820631e42ab1ef5ef76b

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}

kf6-kguiaddons-geo-uri-handler_package() {
	short_desc+=" - Geo URI handler"
	pkg_install() {
		vmove usr/share/applications
		vmove usr/bin/kde-geo-uri-handler
	}
}

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