

_realname=OpenGL-Registry
_name=gles-headers
_specver=3.2
pkgbase=mingw-w64-${_name}
pkgname="${MINGW_PACKAGE_PREFIX}-${_name}"
pkgver=3.2.r1065.7fc154c
pkgrel=1
_commit=7fc154cefa5a57702ff401ce2f9256178c7525dd
pkgdesc="OpenGL|ES header files (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://www.khronos.org/opengles"
msys2_repository_url="https://github.com/KhronosGroup/OpenGL-Registry"
license=('spdx:MIT')
depends=()
makedepends=("git")
source=("git+https://github.com/KhronosGroup/OpenGL-Registry.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd ${_realname}
  printf "${_specver}.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

package() {
  targetdir="${pkgdir}"${MINGW_PREFIX}/include

  rm -rf "${targetdir}"
  mkdir -p "${targetdir}"

  for api in 'GLES' 'GLES2' 'GLES3'
  do
    cp -R "${srcdir}/${_realname}/api/${api}" "${targetdir}"
  done
}
