# Example pinned to the last published source archive; update pkgver and sha256sums when publishing.
# The hash cannot reference the not-yet-created release containing this exact file without becoming self-referential.
# Maintainer: Miroslav Lavrov <149431165+miroslavrov@users.noreply.github.com>
pkgname=clap-compiler
pkgver=0.78.0
pkgrel=1
pkgdesc='Zero-setup C/C++ compiler frontend'
arch=('any')
url='https://github.com/BRATAN-CORP/clap'
license=('MIT')
depends=('python>=3.11' 'cmake' 'ninja')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
source=("https://github.com/BRATAN-CORP/clap/releases/download/v${pkgver}/clap_compiler-${pkgver}.tar.gz")
sha256sums=('7810a5a00722746febb52527baab47910052ab7b5f1fb2cbc467da51e04b7ffd')

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

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