summaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorMarcus von Appen <mva@FreeBSD.org>2013-09-15 12:52:28 +0000
committerMarcus von Appen <mva@FreeBSD.org>2013-09-15 12:52:28 +0000
commit1e35ab7368a5a1f3a39a62241480a34719680e9f (patch)
treeff94ebc9e7c79c921019300543c3b38f19ee3fa9 /Mk
parentAdd an explicit dependency on pkgconf (diff)
- Introduce PYTHON2_DEFAULT_VERSION, the version of the default python2
binary in $PATH. It can be set in case the user wants to use a specific python2 version as a default. Its behaviour is similar to the existing PYTHON3_DEFAULT_VERSION and fixes a small issue with package builds for different python versions. - Outline that PYTHON_DEFAULT_VERSION always takes precedence for a specific python major version. - Update lang/python2 to use PYTHON2_DEFAULT_VERSION and bump the PORTREVISION to let the installed port catch up with the change. - Allow PYTHON3_DEFAULT_VERSION to overriden by a user choice, if PYTHON_DEFAULT_VERSION is not set to a python3 port. Reported by: David Demelier <demelier.david@gmail.com> Reviewed by: koobs@, sbz@ With hat on: python@
Notes
Notes: svn path=/head/; revision=327339
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.python.mk34
1 files changed, 25 insertions, 9 deletions
diff --git a/Mk/bsd.python.mk b/Mk/bsd.python.mk
index 19f538101470..e7552e8f3aba 100644
--- a/Mk/bsd.python.mk
+++ b/Mk/bsd.python.mk
@@ -11,11 +11,11 @@ Python_Include_MAINTAINER= python@FreeBSD.org
# This file contains some variable definitions that are supposed to
# make your life easier when dealing with ports related to the Python
-# language. It's automatically included when USE_PYTHON or PYTHON_VERSION
-# is defined in the ports' makefile. Define PYTHON_VERSION to override the
-# defaults that USE_PYTHON would give you. If your port requires only some
-# set of Python versions, you can define USE_PYTHON as [min]-[max] or
-# min+. (eg. 3.1-3.2, 2.7+ or -3.2)
+# language. It's automatically included when USE_PYTHON is defined in
+# the ports' makefile. If your port requires only some set of Python
+# versions, you can define USE_PYTHON as [min]-[max] or min+ or -max
+# or as an explicit version (eg. 3.1-3.2 for [min]-[max],
+# 2.7+ or -3.2 for min+ and -max or 2.6 for an explicit version).
#
# The variables:
#
@@ -87,13 +87,23 @@ 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 an older version as a default.
+# in case you want to use a specific version as a default.
+# default: 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
#
# PYTHON3_DEFAULT_VERSION
-# - Version of the default python binary in your ${PATH}, in
+# - 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 an older version as a default.
+# 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
#
# PYTHON_MAJOR_VER - Python version major number. 2 for python-2.x,
@@ -283,10 +293,16 @@ _PYTHON_DEFAULT_VERSION= ${_PYTHON_PORTBRANCH}
PYTHON_DEFAULT_VERSION= python${_PYTHON_DEFAULT_VERSION}
.endif
+.if ${PYTHON_DEFAULT_VERSION:R} == "python2"
+PYTHON2_DEFAULT_VERSION= ${PYTHON_DEFAULT_VERSION}
+.else
+PYTHON2_DEFAULT_VERSION?= python2.7
+.endif
+
.if ${PYTHON_DEFAULT_VERSION:R} == "python3"
PYTHON3_DEFAULT_VERSION= ${PYTHON_DEFAULT_VERSION}
.else
-PYTHON3_DEFAULT_VERSION= python3.3
+PYTHON3_DEFAULT_VERSION?= python3.3
.endif
.if defined(PYTHON_VERSION)