# Maintainer: Sarah Ottinger <schalaalexiazeal@gmail.com>

pkgbase=python-tabulate
pkgname=("python-tabulate")
pkgver=0.9.0
pkgrel=1
pkgdesc='Pretty-print tabular data in Python, a library and a command-line utility. (mingw-w64)'
arch=('any')
msys2_references=(
  'purl: pkg:pypi/tabulate'
)
url="https://github.com/astanin/python-tabulate"
license=('spdx:MIT')
options=(!strip)
depends=("python")
makedepends=("python-build"
             "python-installer"
             "python-setuptools"
             "python-setuptools-scm")
optdepends=("python-wcwidth: wide-character support")
source=("https://pypi.org/packages/source/t/tabulate/tabulate-${pkgver}.tar.gz")
sha256sums=('0095b12bf5966de529c0feb1fa08671671b3368eec77d7ef7ab114be2c068b3c')

prepare() {
  rm -rf python-build-${MSYSTEM} | true
  cp -r "tabulate-$pkgver" "python-build-${MSYSTEM}"
}

build() {
  msg "Python build for ${MSYSTEM}"
  cd "${srcdir}/python-build-${MSYSTEM}"
  python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd "${srcdir}/python-build-${MSYSTEM}"
  
  python -m installer --destdir="${pkgdir}" dist/*.whl

  install -Dm644 LICENSE "${pkgdir}usr/share/licenses/python-tabulate/LICENSE"
  install -vDm 644 README.md -t "${pkgdir}usr/share/doc/python-tabulate/"
}
