# Contributor: Dmitry Zakharchenko <dmitz@disroot.org>
# Maintainer:
pkgname=xkb-switch
pkgver=1.8.5
pkgrel=1
pkgdesc="query and change the XKB layout state"
url="https://github.com/grwlf/xkb-switch"
arch="all"
license="GPL-3.0-or-later"
options="!check"
makedepends="cmake libx11-dev libxkbfile-dev samurai"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/grwlf/xkb-switch/archive/$pkgver.tar.gz"

prepare() {
	default_prepare
	# Let the abuild handle man page compression
	sed -i 's/gzip//' CMakeLists.txt
}

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

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

sha512sums="
bc71b668e56fae3c1ce1ce306dea062ade4a58a53c52b27d1353c4444e6c56fc8fbb57ac7920fb5cf0ac6baf9263de86194f277721e37913b8198b9726d084cd  xkb-switch-1.8.5.tar.gz
"
