summaryrefslogtreecommitdiff
path: root/user/libxkbcommon/APKBUILD
blob: a667c3ab77c45b68cee4bafbceb64a32ca93e099 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Contributor: Ariadne Conill <ariadne@dereferenced.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=libxkbcommon
pkgver=1.8.1
pkgrel=0
pkgdesc="Keyboard handling library"
url="https://xkbcommon.org/"
arch="all"
license="MIT AND X11"
options="checkx11"
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://github.com/xkbcommon/libxkbcommon/archive/refs/tags/xkbcommon-$pkgver.tar.gz"
builddir="$srcdir/libxkbcommon-xkbcommon-$pkgver"

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="a11b8563b11bd085b909753fa99e5b2129343363a05d4fac44a46b334b644dbdd57c356021926e9fdcc2bf6855b90283af93e74c471c3d5677c2ed1bf19427c2  xkbcommon-1.8.1.tar.gz"