# Maintainer: Butui Hu <hot123tea123@gmail.com>
# Contributor: Martino Pilia <martino.pilia@gmail.com>

_pkgname=pynrrd
pkgname=python-pynrrd
pkgver=1.1.3
pkgrel=2
pkgdesc='Simple pure-python module for reading and writing nrrd files'
arch=('any')
url='https://github.com/mhe/pynrrd'
license=('MIT')
depends=(
  python-numpy
  python-typing_extensions
)
makedepends=(
  python-build
  python-setuptools
  python-installer
  python-wheel
)
source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/mhe/pynrrd/archive/v${pkgver}.tar.gz")
sha256sums=('10ce743d69ecf54b41ecab56b74dc8a5f806d299c45fcc1ef07d7d8aef5949ea')

build() {
  cd "${_pkgname}-${pkgver}"
  python -m build --wheel --no-isolation
}

package() {
  cd "${_pkgname}-${pkgver}"
  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  rm -rfv ${pkgdir}${site_packages}/docs
}
# vim:set ts=2 sw=2 et:
