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

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-plasma
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kwayland
pkgver=6.2.4
pkgrel=0
pkgdesc="Qt-style Client and Server library wrapper for the Wayland libraries"
arch="all"
url="https://www.kde.org"
license="LGPL-2.1-only OR LGPL-3.0-only"
depends_dev="
	qt6-qtwayland-dev
	wayland-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	plasma-wayland-protocols
	qt6-qtbase-dev
	qt6-qttools-dev
	wayland-protocols
	samurai
	"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
subpackages="$pkgname-dev $pkgname-doc $pkgname-dbg"
_repo_url="https://invent.kde.org/plasma/kwayland.git"
source="https://download.kde.org/$_rel/plasma/$pkgver/kwayland-$pkgver.tar.xz"
options="!check" # Fails to run

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

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
1b18d4754cf1b8d3dc44470e3f95b1b4b9bee8337bdf8bf2506aa33fec640a09538bb162ce421bf607d2397035c04e11061eeb8473634a8d302976cc7d685128  kwayland-6.2.4.tar.xz
"
