# Contributor: Alexander Georgievskiy <galeksandrp@gmail.com>
# Contributor: Rafael Kitover <rkitover@gmail.com>

_realname=cccl
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.4
pkgrel=1
pkgdesc="Unix cc compiler to Microsoft's cl compiler wrapper (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('spdx:GPL-3.0-or-later')
makedepends=("${MINGW_PACKAGE_PREFIX}-autotools")
url="https://github.com/swig/${_realname}"
source=("${url}/archive/${_realname}-${pkgver}.tar.gz")
sha256sums=('92a81e7f04d2f2ece8560d479b7df8eb26e779eeef9b50ee683e732e6ee3abac')

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

  ./bootstrap
}

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

  ./configure --prefix=${MINGW_PREFIX}
  make
}

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

  make DESTDIR="${pkgdir}" install
}
