Skip to content

Commit

Permalink
Handle multiple Python versions
Browse files Browse the repository at this point in the history
This code _very_ loosely based on the code in the python-tox cygport
file, but set to dynamically handle whatever Python versions the
python-wheel cygclass might decide are the defaults in future.
  • Loading branch information
me-and committed Nov 3, 2023
1 parent cb6be2f commit 9b7ad57
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion python-flask.cygport
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
inherit python3
inherit python-wheel

NAME=python-flask
Expand All @@ -12,6 +13,25 @@ HOMEPAGE=https://flask.palletsprojects.com
LICENSE=BSD-3-Clause

SRC_URI="https://github.com/pallets/flask/archive/refs/tags/${PV}.tar.gz"
BUILD_REQUIRES='python38-wheel python39-wheel'

ARCH=noarch

append_to_var () {
local -n varname="$1"
varname+="$2"
}

for v in ${PYTHON_WHEEL_VERSIONS//:/ }; do
append_to_var "python${v/.}_flask_CONTENTS" " usr/bin/flask$v"
append_to_var BUILD_REQUIRES " python${v/.}-wheel"
done
append_to_var "python${PYTHON3_VERSION/.}_flask_CONTENTS" usr/bin/flask

src_install () {
cd "${B}"
python_wheel_install

for v in ${PYTHON_WHEEL_VERSIONS//:/ }; do
cp usr/bin/flask usr/bin/flask"$v"
done
}

0 comments on commit 9b7ad57

Please sign in to comment.