# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libevdev
pkgver=1.5.9
pkgrel=0
pkgdesc="Kernel Evdev Device Wrapper Library"
url="https://www.freedesktop.org/wiki/Software/libevdev"
arch="all"
license="MIT"
options="!check"  # Requires CONFIG_INPUT_UINPUT in kernel
depends=""
makedepends="python3 linux-headers"
checkdepends="check-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="4496ab4d9dc165f416a574c21a7fcee54ae104c21ef4785a4dd0311fff428020cdbb5da7bf3f835e78dae05effdb1a557d189347f6e62dd6be2d8bcdc845850c  libevdev-1.5.9.tar.xz"
