summaryrefslogtreecommitdiff
path: root/python/py-ast_serialize/MAKEPKG
blob: a844b43ea8403d89e5bde098454d95628cfda592 (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
#!/bin/mkpkg
# description: Python bindings for mypy AST serialization
# url: https://github.com/mypyc/ast_serialize

name=py-ast_serialize
_name=ast_serialize
version=0.11.2
release=3
depends=(python3)
makedeps=(py-installer py-maturin rust patchelf)
source=(https://files.pythonhosted.org/packages/source/a/ast-serialize/$_name-$version.tar.gz)

sha256sums=(
    "976a5bd75845d22f4b52905ddf53ab669ef1b14dba7735f5512841a2ef2b5450"
)

build() {
	cd $_name-$version
	
	# Build Rust extension wheel via maturin
	maturin build --release --out dist --interpreter /usr/bin/python3
	
	_pyver=$(/usr/bin/python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
	_sitedir="$PKG/usr/lib/python${_pyver}/site-packages"
	
	install -dm755 "$_sitedir"
	/usr/bin/python3 -m installer --no-compile-bytecode --destdir "$PKG" --prefix /usr dist/*.whl
	
	find "$_sitedir" -type d \( -name tests -o -name test \) -prune -exec rm -rf {} +
	find "$_sitedir" -name "*.exe" -delete
}

signify() {
    untrusted comment: public key
    RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
}

# vim: filetype=sh