pkgname=loki
pkgver=0.1.0
pkgrel=1
pkgdesc="Really really minimal-dependency coding agent"
arch=('any')
url="https://friendly-machines.com/git/loki.git"
license=('MIT')
# OBS extracts dependencies with line-based parsing (obs-build Build/Arch.pm)
# that stops at the first line which is not a variable assignment: no case
# statements, no conditionals, no environment-dependent selection. All
# dependencies must therefore stay static. The wheel is built with CPython
# tooling and installed for the distribution PyPy. Derivatives without a
# suitable pypy3 must edit depends and the package() interpreter by hand.
depends=('pypy3>=8.0.1')
makedepends=('python-build' 'python-flit-core' 'python-installer' 'python-packaging' 'python-wheel')
source=("$pkgname-$pkgver.tar.gz" 'install-wheels.py')
# OBS produces this archive from the Git revision selected in _service.
# set_version resets this assignment to one SKIP; append the local helper's
# checksum separately so its rewrite preserves one checksum per source.
# The += append form is understood by the OBS parser.
sha256sums=('SKIP')
sha256sums+=('SKIP')

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

package() {
  cd "$pkgname-$pkgver"
  python "$srcdir/install-wheels.py" --python=/usr/bin/pypy3 \
    --destdir="$pkgdir" dist/*.whl
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
