# Maintainer: Benjamin Chretien <chretien@lirmm.fr>
# Contributor: Rafal Brzegowy <rafal.brzegowy@yahoo.com>

_realname=cusp
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=0.5.1
pkgrel=2
pkgdesc="A C++ Templated Sparse Matrix Library (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://cusplibrary.github.io/'
msys2_repository_url="https://github.com/cusplibrary/cusplibrary"
license=('spdx:Apache-2.0')
source=("https://github.com/cusplibrary/cusplibrary/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz")
sha256sums=('ea283132caae7a62c96dedb40d0fcff25d3067191411987db9c2d780286a2108')

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

  # Install headers
  install -d "${pkgdir}${MINGW_PREFIX}/include/cusp"
  cp -r "cusp" "${pkgdir}${MINGW_PREFIX}/include"
  install -Dm644 "${srcdir}"/${_realname}library-${pkgver}/LICENSE \
    "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
}
