#Maintainer: Biswapriyo Nath <nathbappai@gmail.com>

_realname=xa65
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.3.14
pkgrel=1
pkgdesc="6502/65816 cross assembler"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('GPL2')
url="http://www.floodgap.com/retrotech/xa/"
depends=()
makedepends=("${MINGW_PACKAGE_PREFIX}-cc")
source=("http://www.floodgap.com/retrotech/xa/dists/xa-${pkgver}.tar.gz"
        "0001-make-fix-predefined-variables.patch")
sha256sums=('1b9bbabddbd8d3b9410b852e50a128eea41e681339e6f76c3e8076fa5420f02e'
            'd84911cbc74b65c3892cf564e7a3ace88237e6ff9e2c867f8f2d8c54cd401d54')

prepare() {
  cd "${srcdir}"/xa-${pkgver}
  patch -p1 -i "${srcdir}/0001-make-fix-predefined-variables.patch"
}

build() {
  cd "${srcdir}"/xa-${pkgver}
  make ${MAKEFLAGS}
}

package() {
  cd "${srcdir}"/xa-${pkgver}
  make DESTDIR="${pkgdir}"${MINGW_PREFIX} install
  install -Dm644 "${srcdir}"/xa-${pkgver}/README.1st "${pkgdir}"${MINGW_PREFIX}/share/doc/${_realname}/README
}
