# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Robert Emil Berge <filoktetes@linuxophic.org>
# Contributor: Mateusz Herych <heniekk@gmail.com>

pkgname=gavl
pkgver=2.0.1
pkgrel=2
pkgdesc='Low level library, upon which multimedia APIs can be built'
arch=(x86_64 aarch64)
url='https://github.com/bplaum/gavl'
license=(GPL-2.0-or-later)
depends=(glibc nettle gnutls libdrm libgl libva)
makedepends=(git doxygen libpng)
source=("git+https://github.com/bplaum/gavl.git#tag=v$pkgver")
b2sums=('c47fa36b64bcf97f6453ec8cdb95a36eda04c2850afb8cd465db0d1c17e3905abe5f5a36e6a00ac5546daedd754238cec1841a09e91aed99ae4209fa0935003c')

prepare() {
  cd $pkgname
  git cherry-pick -n 5b776fe265810ff98f3a4e918d2afb0d337aa965 # support nettle 4
  autoreconf -fi
}

build() {
  cd $pkgname
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --with-cpuflags=none
  make
}

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