Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/python.mk
| Show First 20 Lines • Show All 301 Lines • ▼ Show 20 Lines | |||||
| .if ${PYTHON_DEFAULT_VERSION} == "python3" | .if ${PYTHON_DEFAULT_VERSION} == "python3" | ||||
| PYTHON3_DEFAULT_VERSION?= python${PYTHON3_DEFAULT} | PYTHON3_DEFAULT_VERSION?= python${PYTHON3_DEFAULT} | ||||
| .elif ${PYTHON_DEFAULT_VERSION:R} == "python3" | .elif ${PYTHON_DEFAULT_VERSION:R} == "python3" | ||||
| PYTHON3_DEFAULT_VERSION= ${PYTHON_DEFAULT_VERSION} | PYTHON3_DEFAULT_VERSION= ${PYTHON_DEFAULT_VERSION} | ||||
| .else | .else | ||||
| PYTHON3_DEFAULT_VERSION?= python${PYTHON3_DEFAULT} | PYTHON3_DEFAULT_VERSION?= python${PYTHON3_DEFAULT} | ||||
| .endif | .endif | ||||
| .if ${FLAVOR} == python2 | |||||
| _PYTHON_ARGS= 2 | |||||
| .elif ${FLAVOR} == python3 | |||||
| _PYTHON_ARGS= 3 | |||||
mat: This should probably be ${PYTHON2_DEFAULT} and ${PYTHON3_DEFAULT}. | |||||
Not Done Inline Actionsyeah probably, the python2 was a quick and dirty default example bapt: yeah probably, the python2 was a quick and dirty default example | |||||
| .endif | |||||
| .if ${_PYTHON_ARGS} == "2" | .if ${_PYTHON_ARGS} == "2" | ||||
| _PYTHON_ARGS= ${PYTHON2_DEFAULT_VERSION:S/^python//} | _PYTHON_ARGS= ${PYTHON2_DEFAULT_VERSION:S/^python//} | ||||
| _WANTS_META_PORT= 2 | _WANTS_META_PORT= 2 | ||||
| .elif ${_PYTHON_ARGS} == "3" | .elif ${_PYTHON_ARGS} == "3" | ||||
| _PYTHON_ARGS= ${PYTHON3_DEFAULT_VERSION:S/^python//} | _PYTHON_ARGS= ${PYTHON3_DEFAULT_VERSION:S/^python//} | ||||
| _WANTS_META_PORT= 3 | _WANTS_META_PORT= 3 | ||||
| .endif # ${_PYTHON_ARGS} == "2" | .endif # ${_PYTHON_ARGS} == "2" | ||||
Not Done Inline ActionsSomething I just realized for our conversions, USES= python:* will let us add a FLAVORS= directly in python.mk. Most python ports use of USES defines which python versions it supports. Thus we know which FLAVORS to advertise directly from python.mk. This should speed up the initial conversion tremendously, and hell I'm half-tempted to just do it right now to stop dealing with DEPENDS_ARGS in Poudriere. bdrewery: Something I just realized for our conversions, `USES= python:*` will let us add a `FLAVORS=`… | |||||
Not Done Inline ActionsFLAVOR will be defined too late in that case bapt: FLAVOR will be defined too late in that case | |||||
| .if defined(PYTHON_VERSION) | .if defined(PYTHON_VERSION) | ||||
| # A port/user requests a specific python version for its dependencies via | # A port/user requests a specific python version for its dependencies via | ||||
| # DEPENDS_ARGS, since it requires the specific python version itself. | # DEPENDS_ARGS, since it requires the specific python version itself. | ||||
| # Several things can happen now: | # Several things can happen now: | ||||
| # a) the dependency supports the requested version -> everything's fine | # a) the dependency supports the requested version -> everything's fine | ||||
| # b) the dependency does not support the requested version | # b) the dependency does not support the requested version | ||||
| # 1) the dependency works in a way that the different python | # 1) the dependency works in a way that the different python | ||||
| ▲ Show 20 Lines • Show All 320 Lines • Show Last 20 Lines | |||||
This should probably be ${PYTHON2_DEFAULT} and ${PYTHON3_DEFAULT}.