# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Contributor: 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
pkgver=3.20.2
pkgrel=1
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=("$url/archive/v$pkgver/$pkgname-v$pkgver..tar.gz")
b2sums=('5d917cba3f2c12ee78e73cfe24c44ce093bc77bf6008c8653fd725290282912d16b9e4aa30d6916ecdedd544c05bd6f285451888911df0883c1de44d630340ca')

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

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

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