# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libva-intel-driver
pkgver=2.4.1
pkgrel=1
pkgdesc="VA-API implementation for Intel GMA chipsets and Intel HD Graphics"
url="https://freedesktop.org/wiki/Software/vaapi"
arch="x86 x86_64"
license="MIT"
makedepends="libdrm-dev libva-dev wayland-dev meson"
install_if="libva xf86-video-intel"
source="$pkgname-$pkgver.tar.gz::https://github.com/intel/intel-vaapi-driver/archive/$pkgver.tar.gz
	make_wl_drm_optional.patch" # https://github.com/intel/intel-vaapi-driver/pull/566

builddir="$srcdir"/intel-vaapi-driver-$pkgver

build() {
	abuild-meson \
		-Dwith_wayland=yes \
		-Dwith_x11=yes \
		output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
6bdf2ab8d8cf5ae7d0d67e42d9faac405f4f4020e7b5f9a4e6695f39ac6f8951c770bf6b79494ebf241372b5d015a1571039e143d1e9075dc208322b0cebebf3  libva-intel-driver-2.4.1.tar.gz
2e0f1b5b7e2f78ac99d3a2e789fb7225b951df91a1a21fe12b76894e6f40bbc32b723a74c15f7795928957c17f1f3f295bc637d06590dea408be2368afad1636  make_wl_drm_optional.patch
"
