# Template file for 'libva'
pkgname=libva
version=2.6.0
revision=2
build_style=meson
configure_args="-Dwith_glx=no $(vopt_if wayland -Dwith_wayland=yes)
 -Dwith_egl=yes"
hostmakedepends="pkg-config $(vopt_if wayland wayland-devel)"
makedepends="libXfixes-devel libXext-devel libdrm-devel
 $(vopt_if wayland wayland-devel)"
short_desc="Video Acceleration (VA) API"
maintainer="Juan RP <xtraeme@gmail.com>"
license="MIT"
homepage="https://01.org/linuxmedia"
changelog="https://raw.githubusercontent.com/intel/libva/master/NEWS"
distfiles="https://github.com/intel/libva/archive/${version}.tar.gz"
checksum=5566755739503ef53beafad7fd7e155e68039e9af78e051e27f1715a420a0952

build_options="wayland"
build_options_default="wayland"

case "$XBPS_TARGET_MACHINE" in
	i686*) configure_args+=" -Ddriverdir=/usr/lib32/dri";;
esac

post_install() {
	vlicense COPYING
}

libva-devel_package() {
	depends="$(vopt_if wayland wayland-devel) ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
	}
}
