# xf86-input-libinput - Xorg input driver backed by libinput - without this, X has no keyboard/mouse driver at all
# Generated from manifest.tsv by gen-ports.py. Edit the manifest, not this file,
# unless the package needs something the template cannot express - in which case
# drop a `recipe.local` beside it and it will be preserved.
name=xf86-input-libinput
version=1.5.0
release=2
desc="Xorg input driver backed by libinput - without this, X has no keyboard/mouse driver at all"
url="https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput"
license="MIT"
depend="glibc xorg-server libinput mtdev"
makedepend="meson ninja pkgconf"
source="https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/archive/xf86-input-libinput-1.5.0/xf86-input-libinput-xf86-input-libinput-1.5.0.tar.gz"
sha256="SKIP"

build() {
	cd "xf86-input-libinput-xf86-input-libinput-1.5.0"
	meson setup build \
		--prefix=/usr \
		--libdir=/usr/lib \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--buildtype=release \
		--wrap-mode=nodownload \
		-Db_lto=true
	ninja -C build -j"$JOBS"
}

package() {
	cd "xf86-input-libinput-xf86-input-libinput-1.5.0"
	DESTDIR="$pkgdir" ninja -C build install
	# Upstream's own meson.build never installs this despite it being the
	# public header external consumers (lxqt-config's touchpad/input panel
	# among them) actually include - and their own build already searches
	# /usr/include/xorg for it, matching the usual X.Org driver-headers
	# convention, so that is where it goes rather than plain /usr/include.
	install -Dm644 include/libinput-properties.h "$pkgdir/usr/include/xorg/libinput-properties.h"
}
