# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: György Balló <ballogy@freestart.hu>

pkgname=gupnp
pkgver=1.2.7
pkgrel=1
epoch=1
pkgdesc="An object-oriented UPNP framework"
url="https://wiki.gnome.org/Projects/GUPnP"
arch=(x86_64)
license=(LGPL)
depends=(glib2 gssdp util-linux libxml2)
makedepends=(gobject-introspection gtk-doc vala meson git)
optdepends=('python: gupnp-binding-tool')
_commit=91f5c741ac9ff026df16111833719ce2e07ef11a  # tags/gupnp-1.2.7^0
source=("git+https://gitlab.gnome.org/GNOME/gupnp.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^gupnp-//;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build -D gtk_doc=true
  meson compile -C build
}

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

package() {
  depends+=(libg{lib,object,io,module}-2.0.so libgssdp-1.2.so libsoup-2.4.so
            libuuid.so)
  provides+=(libgupnp-1.2.so)

  meson install -C build --destdir "$pkgdir"
}
