# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
# Contributor: Zachary Lee Andrews <zcrayfish@gmail.com>
pkgname=lxqt-globalkeys
pkgver=2.1.0
pkgrel=1
pkgdesc="Daemon used to register global keyboard shortcuts"
url="https://github.com/lxqt/lxqt-globalkeys"
arch="all !armhf" # armhf blocked by liblxqt and kwindowsystem
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai lxqt-build-tools liblxqt-dev perl
	qt6-qttools-dev kwindowsystem-dev
	"
subpackages="$pkgname-dev"
options="!check" # No testsuite
source="https://github.com/lxqt/lxqt-globalkeys/releases/download/$pkgver/lxqt-globalkeys-$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
}

sha512sums="
71619e070f06db0640c0a81675dd743401c41037c400efc6d4e6c5ebe10c2b93c6a3f38503467771599077c3fbdc1458cb16a2952e2c85e30f6a72baaa4f372a  lxqt-globalkeys-2.1.0.tar.xz
"
