# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Eric Bélanger <eric@archlinux.org>

pkgname=gupnp-igd
pkgver=1.6.0
pkgrel=2
pkgdesc="Library to handle UPnP IGD port mapping"
url="https://wiki.gnome.org/Projects/GUPnP"
arch=(x86_64 aarch64)
license=(LGPL-2.1-or-later)
depends=(
  glibc
  gupnp
)
makedepends=(
  git
  glib2-devel
  gobject-introspection
  gtk-doc
  meson
)
source=("git+https://gitlab.gnome.org/GNOME/gupnp-igd.git#tag=$pkgver")
b2sums=('cd630573188d5b683628b4322bf0ef28580b4746fb07b8a3ad1830b25e133dae5e31f33624cba85fe68aeadb371e51b0063c7f61bd2b2b3fbdbd36396dbeced1')

prepare() {
  cd $pkgname
}

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

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

check() {
  # No multicast in our containers?
  meson test -C build --print-errorlogs || :
}

package() {
  depends+=(
    libg{lib,object,io}-2.0.so
    libg{ssdp,upnp}-1.6.so
  )
  provides+=(libgupnp-igd-1.6.so)

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

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