# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=hidrd
pkgver=0.2.0
pkgrel=0
pkgdesc="HID report descriptor I/O library and conversion tool"
url="https://github.com/DIGImend/hidrd"
arch="all"
license="GPL-2.0"
depends=""
makedepends="musl-obstack-dev m4"
install=""
subpackages="$pkgname-dev"
source="https://github.com/DIGImend/hidrd/releases/download/$pkgver/hidrd-$pkgver.tar.gz
	musl-fix-headers.patch"
builddir="$srcdir/hidrd-$pkgver"

prepare() {
	default_prepare
	update_config_sub
}

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

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

sha512sums="b2121904f7327766b17ade631d6862cea6c0010cee060620150480f70ed0fb00cebf06cd2c6623ab509e1579abe2a835920d8c5290c21bca4143b15c6a814e22  hidrd-0.2.0.tar.gz
43651cd05b01867eeba370786c6db06b6d7d31713607ee34c1529377463dcf12c8af4efbcbe9ee27018deef030e63ad324a364d2701fde5c369edd7206427ee1  musl-fix-headers.patch"
