# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=opencl-headers
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=2.2.20200327
pkgrel=1
epoch=2
pkgdesc='OpenCL (Open Computing Language) header files'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url='https://www.khronos.org/registry/cl/'
license=('Apache 2.0')
makedepends=(git
             "${MINGW_PACKAGE_PREFIX}-python")
source=('git+https://github.com/KhronosGroup/OpenCL-Headers.git#commit=35deb75'
        'git+https://github.com/KhronosGroup/OpenCL-CLHPP.git#commit=3871748')
sha256sums=('SKIP'
            'SKIP')

package() {
  cd "${srcdir}"/OpenCL-Headers/CL

  install -dm755 "${pkgdir}${MINGW_PREFIX}/include/CL"

  for h in *.h; do
    install -m 644 ${h} "${pkgdir}${MINGW_PREFIX}/include/CL/"
  done

  cd "${srcdir}"/OpenCL-CLHPP/include/CL
  for h in *.hpp; do
    install -m 644 ${h} "${pkgdir}${MINGW_PREFIX}/include/CL/"
  done

  #python gen_cl_hpp.py -i input_cl.hpp -o cl.hpp
  #install -m 644 cl.hpp "${pkgdir}${MINGW_PREFIX}/include/CL/"
  #install -m 644 input_cl2.hpp "${pkgdir}${MINGW_PREFIX}/include/CL/cl2.hpp"

  install -D -m644 "${srcdir}"/OpenCL-Headers/LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}
