# Contributor: Ariadne Conill # Maintainer: A. Wilcox pkgname=libxkbcommon pkgver=1.7.0 pkgrel=0 pkgdesc="Keyboard handling library" url="https://www.xkbcommon.org/" arch="all" license="MIT AND X11" depends="xkeyboard-config" checkdepends="bash xvfb" makedepends="bison doxygen libxcb-dev meson libxml2-dev wayland-dev graphviz wayland-protocols" subpackages="$pkgname-dev $pkgname-doc $pkgname-tools $pkgname-tools-doc:xkbcli_doc $pkgname-tools-bash-completion:bashcomp" source="https://www.xkbcommon.org/download/libxkbcommon-$pkgver.tar.xz" build() { meson setup \ -Dprefix=/usr \ -Denable-docs=true \ build meson compile -C build } check() { meson test -C build } package() { DESTDIR="$pkgdir" meson install -C build } doc() { pkgdesc="Keyboard handling library (documentation)" install_if="docs $pkgname=$pkgver-r$pkgrel" # Library docs are in HTML in /usr/share/doc, while xkbcli # docs are man pages. So we move doc directory to the subpackage... mkdir -p "$subpkgdir"/usr/share mv "$pkgdir"/usr/share/doc "$subpkgdir"/usr/share } tools() { pkgdesc="xkb command-line tool with interactive debugger" mkdir -p "$subpkgdir"/usr/bin mkdir -p "$subpkgdir"/usr/libexec/xkbcommon mv "$pkgdir"/usr/bin/xkbcli "$subpkgdir"/usr/bin/ mv "$pkgdir"/usr/libexec/xkbcommon "$subpkgdir"/usr/libexec/ } xkbcli_doc() { # ...and run default_doc here to let abuild process man pages properly default_doc pkgdesc="xkb command-line tool with interactive debugger (doc)" install_if="docs $pkgname-tools=$pkgver-r$pkgrel" } bashcomp() { pkgdesc="xkb command-line tool with interactive debugger (bash completions)" depends="" install_if="$pkgname-tools=$pkgver-r$pkgrel bash-completion" mkdir -p "$subpkgdir"/usr/share/bash-completion/completions mv "$pkgdir"/usr/share/bash-completion/completions/xkbcli \ "$subpkgdir"/usr/share/bash-completion/completions/ } sha512sums="4b74a9f3f63e2ebc1cbdcaa963c70362e55fa527e1d89b6a1fd30d7a84a8b60c1b3dc99bcfbde85aa31890e0b2f62f0bad3c8ff8340fe6a930ee662b33448ba5 libxkbcommon-1.7.0.tar.xz"