# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libva
pkgver=2.22.0
pkgrel=1
pkgdesc='Video Acceleration (VA) API for Linux'
arch=(x86_64)
url=https://01.org/linuxmedia/vaapi
license=(MIT)
depends=(
  libdrm
  libgl
  libx11
  libxext
  libxfixes
  wayland
)
makedepends=(
  git
  libglvnd
  mesa
  meson
)
optdepends=(
  'intel-media-driver: backend for Intel GPUs (>= Broadwell)'
  'libva-intel-driver: backend for Intel GPUs (<= Haswell)'
  'libva-mesa-driver: backend for AMD and NVIDIA GPUs'
)
provides=(
  libva-drm.so
  libva-glx.so
  libva-wayland.so
  libva-x11.so
  libva.so
)
backup=(etc/libva.conf)
_tag=217da1c28336d6a7e9c0c4cb8f1c303968a675f1
source=(git+https://github.com/intel/libva.git#tag=${_tag})
b2sums=('91289a53ca253fab3cfafaa45e42bff58a9cc84a2deb2db040ce693c6f64785eeddceea41018ce0e0e35a3447cac9582f8a68499432a7e384f95ef98e118d7e9')

pkgver() {
  cd libva
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

build() {
  CFLAGS+=" -DENABLE_VA_MESSAGING" # Option missing
  arch-meson libva build
  meson compile -C build
}

package() {
  meson install -C build --destdir "${pkgdir}"
  install -Dm 644 libva/COPYING -t "${pkgdir}"/usr/share/licenses/${pkgname}
  install -Dm 644 /dev/stdin "${pkgdir}"/etc/libva.conf <<END
LIBVA_MESSAGING_LEVEL=1
END
}

# vim:set sw=2 sts=-1 et:
