# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Fabian Bornschein <fabiscafe@archlinux.org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgbase=msgraph
pkgname=(
  msgraph
  msgraph-docs
)
pkgver=0.2.3
pkgrel=2
pkgdesc="A shared library for accessing MS Graph API"
url="https://gitlab.gnome.org/GNOME/msgraph"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
license=(LGPL-3.0-or-later)
depends=(
  gcc-libs
  glib2
  glibc
  json-glib
  libgoa
  libsoup3
)
makedepends=(
  gi-docgen
  git
  gobject-introspection
  meson
  uhttpmock
)
source=("git+https://gitlab.gnome.org/GNOME/msgraph.git#tag=$pkgver")
b2sums=('594de2a5b1773c2f6962adb5e66d17caae31110919eb5071b7a9a3d50f37b58534ca1cb5e90cbe1166c74e1c3a99b1687f15460f801cb51d27a1f8365ad74f0a')

prepare() {
  cd msgraph
}

build() {
  arch-meson msgraph build
  meson compile -C build
}

check() {
  meson test -vC build --print-errorlogs
}

package_msgraph() {
  meson install -C build --destdir "$pkgdir"
  
  mkdir -p doc/usr/share
  mv {"$pkgdir",doc}/usr/share/doc
}

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

  mv doc/* "$pkgdir"
}

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