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

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

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"
}
