Changeset View
Standalone View
Mk/Uses/python.mk
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | |||||
# ${PREFIX}/bin | # ${PREFIX}/bin | ||||
# ${PREFIX}/sbin | # ${PREFIX}/sbin | ||||
# ${PREFIX}/libexec | # ${PREFIX}/libexec | ||||
# | # | ||||
# are linked from the prefixed version to the | # are linked from the prefixed version to the | ||||
# prefix-less original name, e.g. | # prefix-less original name, e.g. | ||||
# bin/foo-2.7 --> bin/foo. | # bin/foo-2.7 --> bin/foo. | ||||
# | # | ||||
# distutils - Use distutils as do-configure, do-build and | # distutils - Use distutils as do-configure, do-build and | ||||
FreeBSD_ShaneWare.Biz: cython_run should also be here. | |||||
# do-install targets. | # do-install targets. | ||||
# | # | ||||
# autoplist - Automatically generates the packaging list for a | # autoplist - Automatically generates the packaging list for a | ||||
# port that uses distutils when defined. | # port that uses distutils when defined. | ||||
# requires: distutils | # requires: distutils | ||||
# | # | ||||
# py3kplist - Automatically generates Python 3.x compatible | # py3kplist - Automatically generates Python 3.x compatible | ||||
# __pycache__ entries from a Python 2.x packaging list | # __pycache__ entries from a Python 2.x packaging list | ||||
▲ Show 20 Lines • Show All 219 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 | |||||
.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" | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | |||||
# | # | ||||
# PYTHON_VERSION will hold whatever is passed down the dependency chain. | # PYTHON_VERSION will hold whatever is passed down the dependency chain. | ||||
# If a user runs `make PYTHON_VERSION=python3.3, PYTHON_VERSION will be | # If a user runs `make PYTHON_VERSION=python3.3, PYTHON_VERSION will be | ||||
# set to 'python3.3'. A port however may require a different version, | # set to 'python3.3'. A port however may require a different version, | ||||
# which is stored (above) in _PYTHON_VERSION. | # which is stored (above) in _PYTHON_VERSION. | ||||
# Every python bit below hence should use python${_PYTHON_VERSION}, since | # Every python bit below hence should use python${_PYTHON_VERSION}, since | ||||
# this is the value, the _port_ requires | # this is the value, the _port_ requires | ||||
# | # | ||||
Done Inline ActionsSo I think we need FLAVORS to be py27 py34 py35 py36, etc. Right now I only see 'python3' when there's really 3 flavors of python3. This brings the most benefit of flavors by providing all possible python packages. bdrewery: So I think we need FLAVORS to be py27 py34 py35 py36, etc. Right now I only see 'python3' when… | |||||
Done Inline ActionsI disagree. If someone wants to have a non default python 3, then one can change DEFAULT_VERSIONS+=python3=3.4. I really do not see what this adds. Except about 10k packages to (re)build. Changing like you say makes it impossible for a port to say "I am using python3, I don't care which flavor, and I do not want to be poluted with flavors." mat: I disagree. If someone wants to have a non default python 3, then one can change… | |||||
Done Inline ActionsI thune i don't want 4 versions of python ports, there is already default_versions += python3= antoine: I thune i don't want 4 versions of python ports, there is already default_versions += python3= | |||||
# Got the correct python version, set some publicly accessible variables | # Got the correct python version, set some publicly accessible variables | ||||
PYTHON_VER= ${_PYTHON_VERSION} | PYTHON_VER= ${_PYTHON_VERSION} | ||||
PYTHON_SUFFIX= ${_PYTHON_VERSION:S/.//g} | PYTHON_SUFFIX= ${_PYTHON_VERSION:S/.//g} | ||||
PYTHON_MAJOR_VER= ${PYTHON_VER:R} | PYTHON_MAJOR_VER= ${PYTHON_VER:R} | ||||
PYTHON_REL= # empty | PYTHON_REL= # empty | ||||
PYTHON_ABIVER= # empty | PYTHON_ABIVER= # empty | ||||
PYTHON_PORTSDIR= ${_PYTHON_RELPORTDIR}${PYTHON_SUFFIX} | PYTHON_PORTSDIR= ${_PYTHON_RELPORTDIR}${PYTHON_SUFFIX} | ||||
# Protect partial checkouts from Mk/Scripts/functions.sh:export_ports_env(). | # Protect partial checkouts from Mk/Scripts/functions.sh:export_ports_env(). | ||||
.if !defined(_PORTS_ENV_CHECK) || exists(${PORTSDIR}/${PYTHON_PORTSDIR}) | .if !defined(_PORTS_ENV_CHECK) || exists(${PORTSDIR}/${PYTHON_PORTSDIR}) | ||||
.include "${PORTSDIR}/${PYTHON_PORTSDIR}/Makefile.version" | .include "${PORTSDIR}/${PYTHON_PORTSDIR}/Makefile.version" | ||||
.endif | .endif | ||||
# Create a 4 integer version string, prefixing 0 to the last token if | # Create a 4 integer version string, prefixing 0 to the last token if | ||||
# it's a single character. Only use the the first 3 tokens of | # it's a single character. Only use the the first 3 tokens of | ||||
# PORTVERSION to support pre-release versions (rc3, alpha4, etc) of | # PORTVERSION to support pre-release versions (rc3, alpha4, etc) of | ||||
Not Done Inline ActionsEXTRA_PYTHON_FLAVORS feels funky. Can't we just append to FLAVORS if it already has a value? bdrewery: EXTRA_PYTHON_FLAVORS feels funky. Can't we just append to FLAVORS if it already has a value?
At… | |||||
Not Done Inline ActionsWell, no, you can't really append to flavors, the "automatic" FLAVORS generation is only done if FLAVORS is empty, as to not clobber something more interesting done by the porter. Maybe it could be part of USE_PYTHON, say: USE_PYTHON= extraflavor=py34,py35 mat: Well, no, you can't really append to flavors, the "automatic" FLAVORS generation is only done… | |||||
Not Done Inline ActionsThinking about it, I could simply add a: USE_PYTHON= allflavors to get all the possible versions, it would make things a bit easier. mat: Thinking about it, I could simply add a:
USE_PYTHON= allflavors
to get all the possible… | |||||
# any Python port (lang/pythonXY) | # any Python port (lang/pythonXY) | ||||
PYTHON_REL= ${PYTHON_PORTVERSION:C/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/:C/\.([0-9]+)$/.0\1/:C/\.0?([0-9][0-9])$/.\1/:S/.//g} | PYTHON_REL= ${PYTHON_PORTVERSION:C/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/:C/\.([0-9]+)$/.0\1/:C/\.0?([0-9][0-9])$/.\1/:S/.//g} | ||||
# Might be overridden by calling ports | # Might be overridden by calling ports | ||||
PYTHON_CMD?= ${_PYTHON_BASECMD}${_PYTHON_VERSION} | PYTHON_CMD?= ${_PYTHON_BASECMD}${_PYTHON_VERSION} | ||||
.if ${PYTHON_VER} != 2.7 | .if ${PYTHON_VER} != 2.7 | ||||
.if exists(${PYTHON_CMD}-config) | .if exists(${PYTHON_CMD}-config) | ||||
PYTHON_ABIVER!= ${PYTHON_CMD}-config --abiflags | PYTHON_ABIVER!= ${PYTHON_CMD}-config --abiflags | ||||
▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines |
cython_run should also be here.