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

_realname=stb
pkgbase="mingw-w64-${_realname}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=r2193.31707d1
pkgrel=1
_commit='31707d14fdb75da66b3eed52a2236a70af0d0960'
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=('72c2548ea6cca4016e8265239abfe8638b503fc02da36dd47c246e1c77e8c822')

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/
}
