# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=qps
pkgver=2.9.0
pkgrel=0
pkgdesc="LXQt process manager"
url="https://github.com/lxqt/qps"
arch="all !armhf !riscv64" # limited by lxqt-config
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai lxqt-build-tools qt6-qtbase-dev qt6-qttools-dev
	libqtxdg-dev liblxqt-dev kwindowsystem-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
options="!check" # No testsuite
source="https://github.com/lxqt/qps/releases/download/$pkgver/qps-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

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

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/$pkgname/translations
}

sha512sums="
d085f987ce0abbd479704270415502384a17fdce13401c8d70d0d9982b045ef50b20abc347809e3c0c425651440c2c0f8e24b7114251808011990e896e6710fd  qps-2.9.0.tar.xz
"
