blob: bb1ba3f26a0b6ca6fb13131f96da2b188e9c853b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# Maintainer: Luis Martinez <luis dot martinez at disroot dot org>
# Contributor: Andrew Chen <xor.tux@gmail.com>
pkgname=python-cstruct
pkgver=3.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"
'exclude-tests.patch')
sha256sums=('edfa9dd96b2512a4d7cd24842b9234ba32a60a65e15e08f7dbfca35836ea81e3'
'50c62f343cdb71381bf5f5e9e71fe75bab9f5b1a4d810855265f3a4c35036569')
prepare() {
patch -p1 -d "$pkgname-$pkgver" < exclude-tests.patch
}
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/"
}
|