# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=xva-img
pkgver=1.4
pkgrel=1
pkgdesc="tool for converting XVA images"
url="https://github.com/eriklax/xva-img"
arch="all"
license="GPL"
depends=""
depends_dev="libressl-dev"
makedepends="$depends_dev cmake"
install=""
subpackages=""
source="xva-img-${pkgver}.tar.gz::https://github.com/eriklax/xva-img/archive/${pkgver}.tar.gz"

_srcroot="${srcdir}/${pkgname}-${pkgver}"
_builddir="${srcdir}/build"
prepare() {
	local i
	mkdir "$_builddir"
	cd "$_srcroot"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	cmake -DCMAKE_INSTALL_PREFIX=/usr -DPREFIX=/usr "$_srcroot"
	make || return 1
}

package() {
	cd "$_builddir"
	install -d -m755 "$pkgdir"/usr/bin
	install -c -m755 "$_builddir"/xva-img "$pkgdir"/usr/bin/xva-img
}

sha512sums="b6e619ae52beaa7bd8fecfc46e8c6d3420ef61667643566f4cc4e610953eb7214ba9e08d00c9e8b96aee21dd8cc3c72b4df2e3fff7ac39b74a26e5fed25f01bc  xva-img-1.4.tar.gz"
