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

_realname=butler
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=15.21.0
pkgrel=1
pkgdesc='Command-line itch.io helper (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64')
url="https://github.com/itchio/butler"
license=('MIT')
makedepends=("${MINGW_PACKAGE_PREFIX}-go")
source=("https://github.com/itchio/butler/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('390c75e1a03d2667383df9b8ca5e01f44ee21cecc7d18e165d7439b73c3df447')

build() {
  msg "Build for ${CARCH}"  
  cd "${srcdir}/${_realname}-$pkgver"
  ${MINGW_PREFIX}/bin/go build
}

package() {
  cd "${srcdir}/${_realname}-$pkgver"
  install -Dm755 butler.exe "${pkgdir}${MINGW_PREFIX}/bin/butler.exe"
  install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}
