# Template file for 'KDSoap'
pkgname=KDSoap
version=2.3.0
revision=1
build_style=cmake
configure_args="-DKDSoap_QT6=TRUE
 -DECM_MKSPECS_INSTALL_DIR=/usr/lib/qt6/mkspecs/modules"
hostmakedepends="qt6-base"
makedepends="qt6-base-devel"
short_desc="Qt-based client-side and server-side SOAP component"
maintainer="John <me@johnnynator.dev>"
license="GPL-3.0-or-later"
homepage="https://www.kdab.com/development-resources/qt-tools/kd-soap/"
distfiles="https://github.com/KDAB/KDSoap/releases/download/kdsoap-${version}/kdsoap-${version}.tar.gz"
checksum=d2184951145cb768cc30376a10701be13869a164c1272d09f831ba2d195f02de

if [ "$CROSS_BUILD" ]; then
	hostmakedepends+=" KDSoap"
	configure_args+=" -DKDSOAP_KDWSDL2CPP_COMPILER=/usr/bin/kdwsdl2cpp-qt6"
fi

post_install() {
	sed -i '/kdwsdl2cpp-qt6/s,[$]{_IMPORT_PREFIX},/usr,' \
		"$DESTDIR/usr/lib/cmake/KDSoap-qt6/"KDSoapTargets-*.cmake
}

KDSoap-devel_package() {
	depends="${sourcepkg}>=${version}_${revision} ${makedepends}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/cmake
		vmove "usr/lib/*.so"
		vmove usr/lib/qt6/mkspecs
	}
}
