

_realname=genromfs
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.5.2
pkgrel=1
pkgdesc="Creates ROMFS images (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://romfs.sourceforge.net/"
msys2_repository_url="https://github.com/chexum/genromfs"
license=("spdx:GPL-2.0-or-later")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc")
source=("https://github.com/chexum/${_realname}/archive/${pkgver}/${_realname}-${pkgver}.tar.gz"
        "0001-build-mingw.patch")
sha256sums=('a96953ff6a2ce96b9c9aca99faaa43fda0e25e0012f3855cd6b988a12895467b'
            '86ace4744dd2cc60b3f4187e3889f8ace48421451c3d754a774f6c946fc63e65')

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

  patch -Np1 -i "${srcdir}/0001-build-mingw.patch"
}

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

package() {
  cd "${srcdir}"/${_realname}-${pkgver}
  make prefix="${MINGW_PREFIX}" PREFIX="${pkgdir}" install
}
