# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Balló György <ballogyor+arch at gmail dot com>

pkgname=gupnp-dlna
pkgver=0.10.5+4+gc947eed
pkgrel=2
pkgdesc="Library to ease DLNA-related bits for applications using gupnp"
arch=(x86_64)
url="https://wiki.gnome.org/Projects/GUPnP"
license=(LGPL)
depends=(gst-plugins-base-libs)
makedepends=(gobject-introspection gtk-doc vala git autoconf-archive)
_commit=c947eed68559152ac95bdab207b206794ee9a5c2  # master
source=("git+https://gitlab.gnome.org/GNOME/gupnp-dlna.git#commit=$_commit")
sha256sums=('SKIP')

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

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
              --disable-static --disable-Werror --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  make -j1 DESTDIR="$pkgdir" install
}
