# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=libgusb
pkgver=0.3.0
pkgrel=0
pkgdesc="GLib wrapper around libusb"
url="https://github.com/hughsie/libgusb"
arch="all"
license="LGPL"
# disabled due to: gusb-self-test FAIL
options="!check"
makedepends="glib-dev libusb-dev gtk-doc vala eudev-dev gobject-introspection-dev meson"
checkdepends="python3-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/hughsie/$pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	default_prepare
	cd "$builddir"
	mkdir -p output
}

build() {
	cd "$builddir"
	meson . ./output --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	ninja -C output/
}

package() {
	cd "$builddir"
	DESTDIR="$pkgdir" ninja -C output/ install
}

sha512sums="1e55c1c9234287f9eda9babf194f573487fa6ce2da10e0fd89e1f7c6244f709933c1b980667d7eef38dba3c7f87d3272df71fedc9b6f36753f2b0b513ce995ca  libgusb-0.3.0.tar.gz"
