# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: David Moore <davidm@sjsoft.com>

pkgname=python-simplejson
_name="${pkgname#python-}"
pkgver=3.19.2
pkgrel=4
pkgdesc='Simple, fast and extensible JSON decoder/encoder'
license=(MIT)
arch=(x86_64 aarch64)
url='https://github.com/simplejson/simplejson'
depends=(
  glibc
  python
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
source=($pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz)
b2sums=('3458629073fb0c09aefa3d0ed4b9a32040a7f2f32f0ae3701843511b3a25a5a7e41cc4221169cea441e1d072f17a6af4b903c1d5cfd2fe17dcd00d66c7cae116')

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

check() {
  cd $_name-$pkgver
  python -m unittest discover -v
}

package_python-simplejson() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
}
