# Template file for 'libqrtr-glib'
pkgname=libqrtr-glib
version=1.2.2
revision=1
build_style=meson
build_helper="gir qemu"
configure_args="$(vopt_bool gir introspection)"
hostmakedepends="pkg-config gtk-doc"
makedepends="glib-devel"
short_desc="Qualcomm IPC Router protocol helper library"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib"
changelog="https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib/-/raw/main/NEWS"
distfiles="https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib/-/archive/${version}/libqrtr-glib-${version}.tar.gz"
checksum=c5cdf5ea91cbd2cf2758b2896064c7b1dfe7156063267df905f957ac69b6b763

build_options="gir"
build_options_default="gir"

# FIXME: drop gtk-doc generation from cross builds to avoid aarch64-musl & armv6l-musl
# python relocation errors on CI that are not reproducible when building locally
# https://github.com/void-linux/void-packages/runs/8028582126
if [ "$CROSS_BUILD" ]; then
	configure_args+=" -Dgtk_doc=false"
fi

libqrtr-glib-devel_package() {
	depends="${sourcepkg}-${version}_${revision} ${makedepends}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		if [ "$build_option_gir" ]; then
			vmove usr/share/gir-1.0
		fi
		if [ -z "$CROSS_BUILD" ]; then
			vmove usr/share/gtk-doc
		fi
		vmove "usr/lib/*.so"
	}
}
