summaryrefslogtreecommitdiff
path: root/python/py-yarl/MAKEPKG
blob: cac4fa8ba047655c7c7ed70fce428d0179a510e3 (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: Yet another URL library
# url: https://pypi.org/project/yarl/
name=py-yarl
_name=yarl
version=1.25.1
release=1
depends=(python3 py-propcache py-idna py-multidict)
makedeps=(py-installer py-build py-expandvars py-cython py-wheel py-setuptools)
source=(https://github.com/aio-libs/yarl/archive/v$version.tar.gz)
sha256sums=(
    "9626d015cb3e78e056589ec552e2cd38f87dfcb6e7a15b5a4d4937fb4e1f4639"
)

build() {
	cd $_name-$version
	# Relax Cython version pin in bundled pep517_backend (we have newer Cython)
	sed -i 's/ ~= 3\.[0-9][0-9]*\.[0-9][0-9]*//' packaging/pep517_backend/_backend.py 2>/dev/null || true

	# Build C extension from source — GitHub tarball includes pep517_backend
	/usr/bin/python3 -m build --no-isolation --wheel

	_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 --destdir "$PKG" --prefix /usr dist/*.whl

	/usr/bin/python3 -OO -m compileall -b -q "$_sitedir"
	find "$_sitedir" -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
	find "$_sitedir" -name "*.exe" -delete
}

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

# vim: filetype=sh