# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=kdsoap-ws-discovery-client
pkgver=0.4.0
pkgrel=0
pkgdesc="Library for finding WS-Discovery devices in the network using Qt and KDSoap"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://invent.kde.org/libraries/kdsoap-ws-discovery-client"
license="GPL-3.0-or-later"
makedepends="
	doxygen
	extra-cmake-modules
	graphviz
	qt6-qtbase-dev
	qt6-qttools-dev
	kdsoap-qt6-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-doc"
_repo_url="https://invent.kde.org/libraries/kdsoap-ws-discovery-client.git"
source="https://download.kde.org/stable/kdsoap-ws-discovery-client/kdsoap-ws-discovery-client-$pkgver.tar.xz"

build() {
	cmake -B build -DBUILD_WITH_QT6=ON -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure -E "test_wsdiscoveryclient"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
485e0319d986743183e82dd3a7576f0fc473122867e5e820a57f63b2fa2fde0721d8a7ee30d4399c01b11b51634db452174841a887b6685db9ab33e310866dda  kdsoap-ws-discovery-client-0.4.0.tar.xz
"
