# Maintainer: Luis Martinez # Contributor: Andrew Chen pkgname=python-cstruct pkgver=5.3 pkgrel=1 pkgdesc="C-style structs for Python" url="https://github.com/andreax79/python-cstruct" arch=('any') license=('MIT') depends=('python') makedepends=('python-setuptools' 'python-build' 'python-installer' 'python-wheel') checkdepends=('python-pytest') changelog=changelog.txt source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz") sha256sums=('499f6a4356eeaf33d662fd9b4deee3b90e186a0ff12bdab2775bc657bdfc5c19') build() { cd "$pkgname-$pkgver" python -m build --wheel --no-isolation } check() { cd "$pkgname-$pkgver" pytest -x } package() { cd "$pkgname-$pkgver" PYTHONHASHSEED=0 python -m installer --destdir="$pkgdir/" dist/*.whl install -Dvm644 README.md -t "$pkgdir/usr/share/doc/$pkgname/" local _site="$(python -c 'import site; print(site.getsitepackages()[0])')" install -dv "$pkgdir/usr/share/licenses/$pkgname/" ln -sv "$_site/cstruct-$pkgver.dist-info/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/" }