# Description: A library to handle keyboard descriptions.
# URL: https://xkbcommon.org/
# Maintainer: CRUX System Team, core-ports at crux dot nu
# Depends on: libxml2
# Optional: bash-completion wayland-protocols xkeyboard-config

name=libxkbcommon
version=1.7.0
release=1
source=(https://github.com/xkbcommon/libxkbcommon/archive/xkbcommon-$version.tar.gz)

build() {
	prt-get isinst wayland-protocols || PKGMK_XKBCOMMON+=' -D enable-wayland=false'
	prt-get isinst xkeyboard-config || PKGMK_XKBCOMMON+=' -D enable-x11=false'
	prt-get isinst bash-completion  || PKGMK_XKBCOMMON+=' -D enable-bash-completion=false'

	meson setup build libxkbcommon-xkbcommon-$version $PKGMK_XKBCOMMON \
		--prefix=/usr \
		--libexecdir=/usr/lib \
		--wrap-mode nodownload \
		-D b_lto=true \
		-D b_pie=true \
		-D enable-docs=false

	meson compile -C build -j ${JOBS:-1}
	DESTDIR=$PKG meson install -C build
}
