# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
#  - drop valgrind makedepend

pkgname=orc
pkgver=0.4.32
pkgrel=1
pkgdesc="Optimized Inner Loop Runtime Compiler"
url="https://gitlab.freedesktop.org/gstreamer/orc"
arch=(x86_64)
license=(custom:BSD)
depends=(glibc)
makedepends=(git gtk-doc meson)
_commit=629864f073ae003e63c026c1de2407fec713cb53  # tags/0.4.32^0
source=("git+https://gitlab.freedesktop.org/gstreamer/orc.git#commit=$_commit")
sha256sums=('SKIP')

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

prepare() {
  cd $pkgname
}

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

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

package() {
  DESTDIR="$pkgdir" meson install -C build
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 $pkgname/COPYING
}