-
Notifications
You must be signed in to change notification settings - Fork 0
/
python-flask.cygport
158 lines (144 loc) · 4.68 KB
/
python-flask.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
inherit python3
inherit python-wheel
NAME=python-flask
VERSION=3.0.0
RELEASE=1
CATEGORY=Python
SUMMARY='The Python micro framework for building web applications'
DESCRIPTION='Flask is a lightweight WSGI web application framework. It is
designed to make getting started quick and easy, with the ability to scale up
to complex applications.'
HOMEPAGE=https://flask.palletsprojects.com
LICENSE=BSD-3-Clause
SRC_URI="https://github.com/pallets/flask/archive/refs/tags/${PV}.tar.gz"
ARCH=noarch
extend_var () {
local -n var
var="$1"
shift
var="${var:+$var }$*"
}
handle_version () {
local version pkgversion contents_var
local majver minver
version="$1"
pkgversion="${version/.}"
majver="${version%%.*}"
minver="${version#${minver}.}"
contents_var="python${pkgversion}_flask_CONTENTS"
extend_var "$contents_var" "usr/bin/flask$version"
if [[ "$version" = "$PYTHON3_VERSION" ]]; then
extend_var "$contents_var" usr/bin/flask
fi
# Notes on dependencies:
#
# Jinja2>=3.1.2: a project dependency in pyproject.toml and a testenv
# dependency in tox.ini; available in Cygwin.
#
# Pallets-Sphinx-Themes: in requirements/docs.in; not currently
# available in Cygwin and probably not worth making available if it can
# be generated in the packaging process.
#
# Sphinx: in requirements/docs.in; available in Cygwin.
#
# Werkzeug>=3.0.0: a project dependency in pyproject.toml a testenv
# dependency in tox.ini; not currently available in Cygwin.
#
# asgiref>=3.2: an optional project dependency for async in
# pyproject.toml, and in requirements/tests.in; not currently available
# in Cygwin.
#
# blinker>=1.6.2: a project dependency in pyproject.toml; not currently
# available in Cygwin.
#
# build: in requirements/build.in; not currently available in Cygwin
# but also quite possibly not actually used by flask at all anyway.
#
# click>=8.1.3: a project dependency in pyproject.toml and a testenv
# dependency in tox.ini; not currently available in Cygwin.
#
# coverage: a tool in pyproject.toml; not currently available in
# Cygwin.
#
# cryptography: in requirements/typing.in; not currently available in
# Cygwin.
#
# flit: a tool in pyproject.toml; not currently available in Cygwin.
#
# flit_core<4: a build system dependency in pyproject.toml; not
# currently available in Cygwin.
#
# greenlet if python_version < 3.11: in requirements/tests.in; not
# currently available in Cygwin.
#
# importlib-metadata>=3.6.0 if python_version < 3.10: a project
# dependency in pyproject.toml; available in Cygwin.
#
# itsdangerous>=2.1.2: a project dependency in pyproject.toml and a
# testenv dependency in tox.ini; not currently available in Cygwin.
#
# markupsafe: a testenv dependency in tox.ini; available in Cygwin.
#
# mypy: a tool in pyproject.toml, and in requirements/typing.in; not
# currently available in Cygwin.
#
# pip-compile-multi: in requirements/dev.in; not currently available in
# Cygwin but might not be necessary just for building.
#
# pre-commit: a style testenv dependency in tox.ini and also in
# requirements/dev.in; not currently available in Cygwin.
#
# pytest: a tool in pyproject.toml and in requirements/tests.in;
# available in Cygwin.
#
# python-dotenv: an optional dependency for dotenv in pyproject.toml,
# and in requirements/tests.in; not currently available in Cygwin.
#
# sphinx-issues: in requirements/docs.in; not currently available in
# Cygwin.
#
# sphinx-tabs: in requirements/docs.in; not currently available in
# Cygwin.
#
# sphinxcontrib-log-cabinet: in requirements/docs.in; not currently
# available in Cygwin.
#
# tox: implied by existence of tox.ini, and in requirements/dev.in;
# available in Cygwin.
#
# types-contextvars: in requirements/typing.in; not currently available
# in Cygwin.
#
# types-dataclasses: in requirements/typing.in; not currently available
# in Cygwin.
extend_var BUILD_REQUIRES \
"python${pkgversion}-jinja2" \
"python${pkgversion}-markupsafe" \
"python${pkgversion}-pytest" \
"python${pkgversion}-sphinx" \
"python${pkgversion}-tox"
if (( (majver < 3) || (majver == 3 && minver < 10) )); then
extend_var BUILD_REQUIRES "python${pkgversion}-importlib-metadata"
fi
}
for v in ${PYTHON_WHEEL_VERSIONS//:/ }; do
handle_version "$v"
done
src_test () {
cd "$B"
# Some tests fail because of how they resolve the symlinks. To avoid
# that, make the tests directory be a straightforward copy rather than
# a set of symlinks.
rm -r tests
cp -r "$S"/tests ./tests
tox
}
src_install () {
cd "$B"
python_wheel_install
cd "$D"/usr/bin
sed -ri '1{/^#!/{s/\.exe//;s/python3\.[0-9]+/python3/}}' flask
for v in ${PYTHON_WHEEL_VERSIONS//:/ }; do
sed -r '1{/^#!/{s/python3/python'"$v"'/}}' flask >"flask$v"
done
}