# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=ocl-icd
pkgver=2.3.2
pkgrel=1
pkgdesc="OpenCL ICD Bindings"
arch=('x86_64')
url="https://github.com/OCL-dev/ocl-icd"
license=('BSD')
depends=('glibc')
makedepends=('ruby' 'mesa' 'xmlto' 'asciidoc' 'opencl-headers>=2.1')
checkdepends=()
provides=('opencl-icd-loader')
conflicts=('libcl')
replaces=('libcl')
optdepends=('opencl-driver: packaged opencl driver')
source=("ocl-icd-${pkgver}.tar.gz::https://github.com/OCL-dev/${pkgname}/archive/v${pkgver}.tar.gz")
sha256sums=('ec47d7dcd961ea06695b067e8b7edb82e420ddce03e0081a908c62fd0b8535c5')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"
  autoreconf -fiv
}

build() {
  cd "$srcdir/$pkgname-$pkgver"
  CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
  ./configure --prefix=/usr
  make
}

check() {
  cd "$srcdir/$pkgname-$pkgver"
  make -k check
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install

  install -m755 -d "$pkgdir/usr/share/licenses/ocl-icd"
  install -m644 "$srcdir/$pkgname-$pkgver/COPYING" "${pkgdir}/usr/share/licenses/ocl-icd/"
}

# vim:set ts=2 sw=2 et:
