# Packager = Tuxcore <dev@tuxcore.org> 
pkgbase=libqmi
pkgname=(
  libqmi
  libqmi-docs
)
pkgver=1.34.0
pkgrel=2
pkgdesc="QMI modem protocol helper library"
url="https://www.freedesktop.org/wiki/Software/libqmi/"
arch=(x86_64)
license=(GPL-2.0-or-later)
depends=(
  bash
  gcc-libs
  glib2
  glibc
  libgudev
  libmbim
  libqrtr-glib
)
makedepends=(
  bash-completion
  git
  gobject-introspection
  gtk-doc
  help2man
  meson
)
source=("git+https://gitlab.freedesktop.org/mobile-broadband/libqmi.git?signed#tag=${pkgver/[a-z]/-&}")
b2sums=('4f86ffd67bd969440db12a2f15eb562fe5b54e2e403f1e8c717a45fe4cf1814d4d78350d9bb2cb0eeaf6c356638e34cf0e4aa844bddb7bf2b8b424feac91e87b')
validpgpkeys=(
  A814D09B9C5BC01945A64308AECE0239C6606AD5 # Aleksander Morgado <aleksandermj@chromium.org>
)

prepare() {
  cd libqmi
}

build() {
  local meson_options=(
    -D gtk_doc=true
  )

  arch-meson libqmi build "${meson_options[@]}"
  meson compile -C build
}

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

package_libqmi() {
  provides=(libqmi-glib.so)

  meson install -C build --destdir "$pkgdir" --no-rebuild

  mkdir -p doc/usr/share
  mv {"$pkgdir",doc}/usr/share/gtk-doc
}

package_libqmi-docs() {
  pkgdesc+=" (documentation)"
  depends=()

  mv doc/* "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
