# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gst-python
pkgver=1.18.5
pkgrel=1
pkgdesc="Multimedia graph framework - python bindings"
url="https://gstreamer.freedesktop.org/"
arch=(x86_64)
license=(LGPL)
depends=(python-gobject gst-plugins-base-libs)
makedepends=(git meson)
_commit=3d75c6b1eefc1a4190f58ac8d4610535f1acca3f  # tags/1.18.5^0
source=("git+https://gitlab.freedesktop.org/gstreamer/gst-python.git#commit=$_commit")
sha256sums=('SKIP')

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

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

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

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

  export PYTHONHASHSEED=0
  python -m compileall -d /usr/lib "$pkgdir/usr/lib"
  python -O -m compileall -d /usr/lib "$pkgdir/usr/lib"
}
