# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=opencl-icd-loader
_pkgreal=ocl-icd
pkgver=2.2.12
pkgrel=0
pkgdesc="Generic OpenCL ICD Loader"
url="https://forge.imag.fr/projects/ocl-icd/"
arch="all"
license="custom"
depends_dev="$pkgname"
makedepends="ruby"
subpackages="$pkgname-doc $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://forge.imag.fr/frs/download.php/716/$_pkgreal-$pkgver.tar.gz"
builddir="$srcdir/$_pkgreal-2.2.9"  # error in archive name

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	install -D -m644 COPYING "$pkgdir"/usr/share/doc/ocl-icd/LICENSE
}

sha512sums="d0b1531812feb493bdc27fd4a141796c2ecd14efd79cfa00af47c7c6edc1a7b323cd2d3b7254117a1cfa1c55e24494f662034041a0976b6ee5a6154626eb2d65  opencl-icd-loader-2.2.12.tar.gz"
