# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gst-libav
pkgver=1.16.0
pkgrel=1
pkgdesc="GStreamer open-source multimedia framework FFmpeg plugin"
url="https://gstreamer.freedesktop.org/"
arch=(x86_64)
license=(GPL)
depends=(gst-plugins-base-libs bzip2 ffmpeg)
makedepends=(python gtk-doc git yasm meson)
provides=("gst-ffmpeg=$pkgver-$pkgrel")
_commit=d6c61e69b36eaa144a5ef8fdac73a8162f072509  # tags/1.16.0^0
source=("git+https://gitlab.freedesktop.org/gstreamer/gst-libav.git#commit=$_commit")
sha256sums=('SKIP')

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

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build \
    -D package-name="GStreamer FFmpeg Plugin (Arch Linux)" \
    -D package-origin="https://www.archlinux.org/"
  ninja -C build
}

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

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