# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=libmbim
pkgver=1.30.0
pkgrel=0
pkgdesc="MBIM modem protocol helper library"
url="https://www.freedesktop.org/wiki/Software/libmbim/"
arch="all"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
makedepends="
	bash-completion-dev
	glib-dev
	gobject-introspection-dev
	help2man
	meson
	py3-gobject3
	python3
	"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-tools
	$pkgname-bash-completion
	"
source="https://gitlab.freedesktop.org/mobile-broadband/libmbim/-/archive/$pkgver/libmbim-$pkgver.tar.gz"

build() {
	abuild-meson \
		-Db_lto=true \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

tools() {
	pkgdesc="Tools for libmbim"

	amove usr/bin usr/libexec
}

sha512sums="
5e2fa011e956ad4cccaf0cddc8d0acdaa8f789f6d37d8951fddb2cdb8d54ecc3cb6b89e247074604ce69fa9b28ea1da1cfd34ce9a001cd3fdd414ed134d132b6  libmbim-1.30.0.tar.gz
"
