# Contributor: Liu Pak Hin <wl@m-labs.hk>

_realname=bscan-spi-bitstreams
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.0
pkgrel=1
pkgdesc="JTAG-SPI proxy bitstreams to be used with the OpenOCD jtagspi flash driver (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://github.com/quartiq/bscan_spi_bitstreams"
license=('spdx:MIT')
depends=("${MINGW_PACKAGE_PREFIX}-openocd")
source=("${_realname}.zip::https://github.com/quartiq/bscan_spi_bitstreams/archive/bee624dda0b8b44a31a527be14bc9a0c65d589a4.zip")
sha256sums=('8cdbf549adee9766c591b6fee258a41a93cc2378579e9b3b71073c2a2c3c614f')

package() {
  cd "${srcdir}"/bscan_spi_bitstreams-bee624dda0b8b44a31a527be14bc9a0c65d589a4
  mkdir -p "${pkgdir}${MINGW_PREFIX}/share/bscan-spi-bitstreams"
  install -Dm644 *.bit "${pkgdir}${MINGW_PREFIX}/share/bscan-spi-bitstreams"
  install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}
