# Maintainer: Oscar Fuentes <ofv@wanadoo.es>

_realname=ducible
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.2.1
pkgrel=2
pkgdesc="A tool to make Windows builds reproducible. (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://github.com/jasonwhite/ducible"
license=("spdx:MIT")
depends=("${MINGW_PACKAGE_PREFIX}-cc-libs")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
             "${MINGW_PACKAGE_PREFIX}-python"
             "git")
source=("${_realname}"::"git+https://github.com/jasonwhite/ducible.git#tag=v${pkgver}"
        "0001-missing-include.patch")
sha256sums=('SKIP'
            'd9c7b6b29de5545e17399829ed95af241cdac3a351de895d5d32062c3115a713')

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

  patch -Np1 -i ../0001-missing-include.patch
}

build() {
  cd "$srcdir/${_realname}"
  make
}

package() {
  cd "${srcdir}/${_realname}"
  mkdir -p "$pkgdir"${MINGW_PREFIX}/bin
  cp ducible.exe "$pkgdir"${MINGW_PREFIX}/bin
}
