summaryrefslogtreecommitdiff
path: root/python/py-installer/MAKEPKG
blob: bb143e86fece1e4c942bfa917eed402db3b051f1 (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
#!/bin/mkpkg
# description: A library for installing Python wheels.
# url: https://pypi.org/project/installer/

name=py-installer
_name=installer
version=1.0.1
release=1
depends=(python3)
makedeps=(py-flit_core)
source=(https://files.pythonhosted.org/packages/source/i/installer/$_name-$version.tar.gz)

sha256sums=(
    "052c7fc3721d54c696e2dea019be67539d7b144e924f559f54beb3121831c364"
)

build() {
	cd $_name-$version

	# flit_core is installed — build wheel from source normally
	/usr/bin/python3 -m flit_core.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"
	# Bootstrap install: zipfile unpack — py-installer installs itself this once
	/usr/bin/python3 -c "import zipfile,glob; zipfile.ZipFile(glob.glob('dist/*.whl')[0]).extractall('$_sitedir')"

	/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