# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: William Díaz <wdiaz@archlinux.us>

pkgname=libnice
pkgver=0.1.18
pkgrel=2
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 graphviz)
optdepends=('gstreamer: "nice" GStreamer plugin')
provides=(libnice.so)
_commit=55b71d47f2b427b3baa8812818ed3f059acc748d  # tags/0.1.18^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
  meson compile -C build
}

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

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