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

_realname=butler
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=15.24.0
pkgrel=1
pkgdesc='Command-line itch.io helper (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64')
url="https://github.com/itchio/butler"
msys2_references=(
  'aur: butler'
)
license=('spdx:MIT')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-go" "git")
source=("https://github.com/itchio/butler/archive/v$pkgver/${_realname}-${pkgver}.tar.gz")
sha256sums=('c229ce788365ca254fb92748b055ce7946703470147382c4dff66ef7f9e7fb04')

build() {
  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"
}
