# Maintainer: Sarah Ottinger <schalaalexiazeal@gmail.com>

_realname=godot_headers
pkgbase=mingw-w64-${_realname}
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
pkgver=3.3
pkgrel=1
pkgdesc='Headers for the Godot API supplied by the GDNative module. (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url="http://www.godotengine.org/"
license=('MIT')
_commit='4bae481fc305639a076a69485bed37679149bd32'
source=("https://github.com/godotengine/godot_headers/archive/${_commit}.tar.gz")
sha256sums=('96ba0b9f2a368276d5e1e7530869331c0807992db1b48d6fb6a6901a493410b9')

prepare() {
  rm -r "${_realname}-${pkgver}" | true
  mv "${_realname//_/-}-${_commit}" "${_realname}-${pkgver}"
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"

  mkdir -p "${pkgdir}${MINGW_PREFIX}/include"
  find . -type f -name '*.h' -exec install -Dm644 {} "${pkgdir}${MINGW_PREFIX}/include/godot/"{} \;
  install -D -m644 LICENSE.md "${pkgdir}${MINGW_PREFIX}/share/licenses/godot_headers/LICENSE.md"
  install -D -m644 api.json "${pkgdir}${MINGW_PREFIX}/share/godot/api.json"
}
