# Maintainer: Developer <dev@opalos.org>
# Maintainer: Developer <dev@opalos.org>

_pyname=pygdbmi
pkgname=python-$_pyname
pkgver=%version%
pkgrel=%release%
pkgdesc='Parse gdb machine interface output with Python'
url='https://github.com/cs01/pygdbmi'
license=(MIT)
arch=(any)
depends=(gdb
         python)
makedepends=(python-build
             python-installer
             python-setuptools
             python-wheel)
checkdepends=(python-pytest)
source=(https://github.com/cs01/pygdbmi/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('5c52a37211d55eeeaf5c06eacc8e8d49e9dacfd36a526d3534b4a5d5f5ee94d9')

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

check() {
  cd $_pyname-$pkgver
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest -v
}
  
package() {
  cd $_pyname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
