# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: William Díaz <wdiaz@archlinux.us>

pkgname=libnice
pkgver=0.1.16
pkgrel=1
pkgdesc="An implementation of the IETF's draft ICE (for p2p UDP data streams)"
url="https://nice.freedesktop.org"
arch=(x86_64)
license=(LGPL)
depends=(glib2 gnutls gupnp-igd)
makedepends=(gstreamer gtk-doc git meson gobject-introspection)
optdepends=(gstreamer)
_commit=5969b34e3acd9150506ed8d9d109c73665858f3e  # tags/0.1.16^0
source=("git+https://gitlab.freedesktop.org/libnice/libnice.git#commit=$_commit")
sha256sums=('SKIP')

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

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build -D gtk_doc=enabled -D tests=disabled
  ninja -C build
}

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

package() {
  DESTDIR="$pkgdir" meson install -C build
}
