# Template file for 'ModemManager'
pkgname=ModemManager
version=1.24.2
revision=1
build_style=meson
build_helper=gir
configure_args="-Dpolkit=permissive -Dsystemdsystemunitdir=no
 -Ddbus_policy_dir=/usr/share/dbus-1/system.d -Dsystemd_journal=false
 -Dintrospection=true -Dvapi=true -Dudevdir=/usr/lib/udev
 -Dplugin_qcom_soc=enabled"
hostmakedepends="pkg-config $(vopt_if gir vala-devel)
 glib-devel libxslt-devel gettext"
makedepends="libglib-devel libgudev-devel polkit-devel libqmi-devel
 libmbim-devel libxslt-devel ppp $(vopt_if gir vala-devel)
 python3-gobject-devel python3-dbus-devel bash-completion elogind-devel"
depends="hicolor-icon-theme ppp"
checkdepends="dbus"
short_desc="Mobile broadband modem management service"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://www.freedesktop.org/wiki/Software/ModemManager/"
distfiles="https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/archive/${version}/ModemManager-${version}.tar.bz2"
checksum=691aa026aee458d4e92f95be3fc19989c0484bf51b3ba00673c28909ce5b6729

build_options="gir"
build_options_default="gir"

ModemManager-devel_package() {
	depends="libmm-glib>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
		if [ "$build_option_gir" ]; then
			vmove usr/share/gir-1.0
			vmove usr/share/vala
		fi
	}
}

libmm-glib_package() {
	short_desc+=" - GLib library"
	pkg_install() {
		vmove "usr/lib/libmm-glib.so.*"
		if [ "$build_option_gir" ]; then
			vmove usr/lib/girepository-1.0
		fi
	}
}
