# Maintainer: ImperatorS79 <fevrier.simon@gmail.com>

_realname=stb
pkgbase="mingw-w64-${_realname}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=r2216.f1c79c0
pkgrel=1
_commit='f1c79c02822848a9bed4315b12c8c8f3761e1296'
pkgdesc="single-file public domain (or MIT licensed) libraries for C/C++"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://github.com/nothings/stb"
msys2_references=(
  "cpe: cpe:/a:stb_project:stb"
  "cpe: cpe:/a:stb_vorbis_project:stb_vorbis"
)
license=('spdx:Unlicense' 'spdx:MIT')
makedepends=('git')
source=("git+https://github.com/nothings/${_realname}#commit=${_commit}")
sha256sums=('55ffc884e4185eb0e409edce23ae8bcda8b73321abaf5c695904470c3e65ef49')

pkgver() {
  cd stb
  printf "r%s.%s" "$(git rev-list --count $_commit)" "$(git rev-parse --short $_commit)"
}

package() {
  install -Dm 644 stb/*.{c,h} -t "${pkgdir}${MINGW_PREFIX}"/include/stb/
  install -Dm 644 stb/LICENSE -t "${pkgdir}${MINGW_PREFIX}"/share/licenses/stb/
}
