aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authormva <mva@FreeBSD.org>2013-10-03 17:25:37 +0800
committermva <mva@FreeBSD.org>2013-10-03 17:25:37 +0800
commit4c7de5ab73eac916156cb8a129737a7d84412f30 (patch)
treef6108b36a0b605e46d231587ba0beeef930daa84 /Mk
parentb1aec2842742a9d37b6c2e85f1d24aaee5174971 (diff)
downloadfreebsd-ports-graphics-4c7de5ab73eac916156cb8a129737a7d84412f30.tar.gz
freebsd-ports-graphics-4c7de5ab73eac916156cb8a129737a7d84412f30.tar.zst
freebsd-ports-graphics-4c7de5ab73eac916156cb8a129737a7d84412f30.zip
The default versions of lang/python* have been changed to support the
new DEFAULT_VERSIONS variable. PYTHON_DEFAULT_VERSION, PYTHON2_DEFAULT_VERSION and PYTHON3_DEFAULT_VERSION are deprecated. If you have set them in your make.conf, you should change them something like DEFAULT_VERSIONS=python=2.7 python2=2.7 python3=3.3
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.default-versions.mk3
-rw-r--r--Mk/bsd.python.mk56
2 files changed, 35 insertions, 24 deletions
diff --git a/Mk/bsd.default-versions.mk b/Mk/bsd.default-versions.mk
index e041cc57421..f5b5fa44f71 100644
--- a/Mk/bsd.default-versions.mk
+++ b/Mk/bsd.default-versions.mk
@@ -20,5 +20,8 @@ ${_l:U}_DEFAULT= ${lang:C/.*=//g}
PERL5_DEFAULT?= 5.14
RUBY_DEFAULT?= 1.9
TCLTK_DEFAULT?= 8.6
+PYTHON_DEFAULT?= 2.7
+PYTHON2_DEFAULT?= 2.7
+PYTHON3_DEFAULT?= 3.3
.endif
diff --git a/Mk/bsd.python.mk b/Mk/bsd.python.mk
index ede686db462..b32671b7952 100644
--- a/Mk/bsd.python.mk
+++ b/Mk/bsd.python.mk
@@ -87,25 +87,15 @@ Python_Include_MAINTAINER= python@FreeBSD.org
#
# PYTHON_DEFAULT_VERSION
# - Version of the default python binary in your ${PATH}, in
-# the format "python2.7". Set this in your /etc/make.conf
-# in case you want to use a specific version as a default.
-# default: python2.7
+# the format "python2.7".
#
# PYTHON2_DEFAULT_VERSION
# - Version of the default python2 binary in your ${PATH}, in
-# the format "python2.7". Set this in your /etc/make.conf
-# in case you want to use a specific version as a default.
-# Note that PYTHON_DEFAULT_VERSION always will have
-# precedence before this value, if it matches "python2*"
-# default: python2.7
+# the format "python2.7".
#
# PYTHON3_DEFAULT_VERSION
# - Version of the default python3 binary in your ${PATH}, in
-# the format "python3.2". Set this in your /etc/make.conf
-# in case you want to use a specific version as a default.
-# Note that PYTHON_DEFAULT_VERSION always will have
-# precedence before this value, if it matches "python3*"
-# default: python3.3
+# the format "python3.2".
#
# PYTHON_MAJOR_VER - Python version major number. 2 for python-2.x,
# 3 for python-3.x and so on.
@@ -227,27 +217,45 @@ _PYTHON_PORTBRANCH= 2.7
_PYTHON_ALLBRANCHES= 2.7 2.6 3.3 3.2 3.1 # preferred first
# Determine version number of Python to use
-.if !defined(PYTHON_DEFAULT_VERSION)
-. if exists(${LOCALBASE}/bin/python)
+.include "${PORTSDIR}/Mk/bsd.default-versions.mk"
+
+.if defined(PYTHON_DEFAULT_VERSION)
+WARNING+= "PYTHON_DEFAULT_VERSION is defined, consider using DEFAULT_VERSIONS=python=${PYTHON_DEFAULT_VERSION:S/^python//} instead"
+.endif
+.if defined(PYTHON2_DEFAULT_VERSION)
+WARNING+= "PYTHON2_DEFAULT_VERSION is defined, consider using DEFAULT_VERSIONS=python2=${PYTHON2_DEFAULT_VERSION:S/^python//} instead"
+.endif
+.if defined(PYTHON3_DEFAULT_VERSION)
+WARNING+= "PYTHON3_DEFAULT_VERSION is defined, consider using DEFAULT_VERSIONS=python3=${PYTHON3_DEFAULT_VERSION:S/^python//} instead"
+.endif
+
+.if exists(${LOCALBASE}/bin/python)
_PYTHON_DEFAULT_VERSION!= (${LOCALBASE}/bin/python -c \
'import sys; print(sys.version[:3])' 2> /dev/null \
|| ${ECHO_CMD} ${_PYTHON_PORTBRANCH}) | ${TAIL} -1
-. else
-_PYTHON_DEFAULT_VERSION= ${_PYTHON_PORTBRANCH}
-. endif
-PYTHON_DEFAULT_VERSION= python${_PYTHON_DEFAULT_VERSION}
+.if defined(PYTHON_DEFAULT) && (${PYTHON_DEFAULT} != ${_PYTHON_DEFAULT_VERSION})
+WARNING+= "Your requested default python version ${PYTHON_DEFAULT} is different from the installed default python interpreter version ${_PYTHON_DEFAULT_VERSION}"
.endif
+PYTHON_DEFAULT_VERSION= python${_PYTHON_DEFAULT_VERSION}
+.else
+PYTHON_DEFAULT_VERSION= python${PYTHON_DEFAULT}
+.endif # exists(${LOCALBASE}/bin/python)
-.if ${PYTHON_DEFAULT_VERSION:R} == "python2"
+# Is only a meta-port version defined?
+.if ${PYTHON_DEFAULT_VERSION} == "python2"
+PYTHON2_DEFAULT_VERSION?= python${PYTHON2_DEFAULT}
+.elif ${PYTHON_DEFAULT_VERSION:R} == "python2"
PYTHON2_DEFAULT_VERSION= ${PYTHON_DEFAULT_VERSION}
.else
-PYTHON2_DEFAULT_VERSION?= python2.7
+PYTHON2_DEFAULT_VERSION?= python${PYTHON2_DEFAULT}
.endif
-.if ${PYTHON_DEFAULT_VERSION:R} == "python3"
-PYTHON3_DEFAULT_VERSION= ${PYTHON_DEFAULT_VERSION}
+.if ${PYTHON_DEFAULT_VERSION} == "python3"
+PYTHON3_DEFAULT_VERSION?= python${PYTHON3_DEFAULT}
+.elif ${PYTHON_DEFAULT_VERSION:R} == "python3"
+ PYTHON3_DEFAULT_VERSION= ${PYTHON_DEFAULT_VERSION}
.else
-PYTHON3_DEFAULT_VERSION?= python3.3
+PYTHON3_DEFAULT_VERSION?= python${PYTHON3_DEFAULT}
.endif
.if defined(PYTHON_VERSION)