# Maintainer: David Macek <david.macek.0@gmail.com>

_realname=nimble
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.13.1
pkgrel=1
pkgdesc='Package manager for the Nim programming language (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url='https://github.com/nim-lang/nimble'
license=('BSD')
depends=("${MINGW_PACKAGE_PREFIX}-openssl")
makedepends=("${MINGW_PACKAGE_PREFIX}-nim")
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/nim-lang/nimble/archive/v${pkgver}.tar.gz")
sha256sums=('e6aa8d9ee4b3ed0321dca329b4a38fa546771b9729984482fb50fe73d3777f5d')

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

  nim c -d:release src/nimble.nim
}

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

  install -Dm 755 "src/nimble.exe" -t "${pkgdir}${MINGW_PREFIX}/bin/"
  install -Dm 644  "license.txt" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}
