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

pkgname=python-setuptools-rust
pkgver=1.11.1
pkgrel=1
pkgdesc="Compile and distribute Python extensions written in rust as easily as if they were written in C."
arch=('any')
license=('spdx:MIT')
url="https://github.com/PyO3/setuptools-rust"
msys2_references=(
  'archlinux: python-setuptools-rust'
  'purl: pkg:pypi/setuptools-rust'
)
depends=(
  'rust'
  'python-setuptools'
  'python-semantic-version'
)
makedepends=('python-build' 'python-installer' 'python-setuptools-scm')
source=(""https://github.com/PyO3/setuptools-rust/archive/refs/tags/v$pkgver.tar.gz"")
sha256sums=('7891482400f8511739f727f4045dcd72b41bf689e4e5b90c97ff98daee5dbe85')

build() {
  cd "setuptools-rust-$pkgver"

  python -m build --wheel --skip-dependency-check --no-isolation
}

package() {
  cd "setuptools-rust-$pkgver"

  python -m installer --destdir="${pkgdir}" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
