-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython-flit.cygport
50 lines (41 loc) · 1.03 KB
/
python-flit.cygport
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
42
43
44
45
46
47
48
49
50
inherit python3
inherit python-wheel
NAME=python-flit
VERSION=3.9.0
RELEASE=1
CATEGORY=Python
SUMMARY='Simplified packaging of Python modules'
DESCRIPTION='Flit is a simple way to put Python packages and modules on PyPI.
It tries to require less thought about packaging and help you avoid common
mistakes.'
HOMEPAGE=https://flit.pypa.io
LICENSE=BSD-3-Clause
ARCH=noarch
extend_var () {
local -n var
var="$1"
shift
var="${var:+$var }$*"
}
handle_version () {
local version pkgversion contents_var
version="$1"
pkgversion="${version/.}"
contents_var="python${pkgversion}_flit_CONTENTS"
extend_var "$contents_var" "usr/bin/flit$version"
if [[ "$version" = "$PYTHON3_VERSION" ]]; then
extend_var "$contents_var" usr/bin/flit
fi
}
for v in ${PYTHON_WHEEL_VERSIONS//:/ }; do
handle_version "$v"
done
src_install () {
cd "$B"
python_wheel_install
cd "$D"/usr/bin
sed -ri '1{/^#!/{s/\.exe//;s/python3\.[0-9]+/python3/}}' flit
for v in ${PYTHON_WHEEL_VERSIONS//:/ }; do
sed -r '1{/^#!/{s/python3/python'"$v"'/}}' flit >"flit$v"
done
}