# Maintainer: Peter Budai <peterbudai@hotmail.com>

_realname=seaborn
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=0.13.0
pkgrel=1
pkgdesc="Statistical data visualization using matplotlib (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32')
url='http://seaborn.pydata.org'
license=('BSD')
depends=("${MINGW_PACKAGE_PREFIX}-python"
         "${MINGW_PACKAGE_PREFIX}-python-pandas"
         "${MINGW_PACKAGE_PREFIX}-python-matplotlib"
         "${MINGW_PACKAGE_PREFIX}-python-numpy")
optdepends=("${MINGW_PACKAGE_PREFIX}-python-statsmodel: for some advanced statistical plots"
            "${MINGW_PACKAGE_PREFIX}-python-scipy")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
             "${MINGW_PACKAGE_PREFIX}-python-installer"
             "${MINGW_PACKAGE_PREFIX}-python-flit-core")
source=("${_realname}-${pkgver}.tar.gz::https://github.com/mwaskom/${_realname}/archive/v${pkgver}.tar.gz")
sha256sums=('afca1c26eaa4481df437c660bba7c5976342809379d0c1809f4b81508dc461bb')

build() {
  cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"

  ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd "${srcdir}/python-build-${MSYSTEM}"

  MSYS2_ARG_CONV_EXCL="--prefix=" \
    ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
    --destdir="${pkgdir}" dist/*.whl

  install -Dm644 LICENSE.md "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}
