# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>

_realname=dotenv
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=1.0.1
pkgrel=1
pkgdesc="Get and set values in your .env file in local and production servers (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32')
url="https://github.com/theskumar/python-dotenv/"
license=('BSD')
depends=("${MINGW_PACKAGE_PREFIX}-python-click")
options=("!strip")
makedepends=(
  "${MINGW_PACKAGE_PREFIX}-python-build"
  "${MINGW_PACKAGE_PREFIX}-python-installer"
  "${MINGW_PACKAGE_PREFIX}-python-setuptools"
  "${MINGW_PACKAGE_PREFIX}-python-wheel"
)
source=("${_realname}-${pkgver}.tar.gz::https://github.com/theskumar/python-dotenv/archive/v${pkgver}.tar.gz")
sha256sums=('cba4f54853af25e248c37400d4bd16549b52b27ee16839317841bbe388b19d56')

build() {
  cd "python-${_realname}-${pkgver}"

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

package() {
  cd "python-${_realname}-${pkgver}"

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

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