Page MenuHomeFreeBSD
Paste P428

Command-Line Input
ActivePublic

Authored by swills on Sep 22 2020, 2:55 PM.
Tags
None
Referenced Files
F9110874: Command-Line Input
Sep 22 2020, 2:55 PM
Subscribers
None
diff --git Mk/Uses/python.mk Mk/Uses/python.mk
index 3bc138a67962..a5a27a9ea752 100644
--- Mk/Uses/python.mk
+++ Mk/Uses/python.mk
@@ -18,7 +18,6 @@
#
# Examples:
#
-# USES=python:2.7 # Supports Python 2.7 Only
# USES=python:3.5+ # Supports Python 3.5 or later
# USES=python:3.5-3.8 # Supports Python 3.5 to 3.8
# USES=python:-3.6 # Supports Python up to 3.6
@@ -31,7 +30,7 @@
#
# Not specifying a <version-spec> should only be used when a more specific
# <version-spec> cannot be specified due to syntax limitations, for
-# example: 2.7,3.4-3.6, but even in this case, X.Y+ (2.7+), or -X.Y (-3.6)
+# example: 3.4-3.6, but even in this case, X.Y+ (3.4+), or -X.Y (-3.6)
# is preferred and likely more correct.
#
# patch Python is needed at patch time. Adds dependency to PATCH_DEPENDS.
@@ -52,7 +51,7 @@
# Exported variables:
#
# PYTHON_VERSION - The chosen Python interpreter including the version,
-# e.g. python2.7, python3.5, etc.
+# e.g. python3.5, python3.6, etc.
#
# Variables, which can be set by the port:
#
@@ -82,7 +81,7 @@
#
# are linked from the prefixed version to the
# prefix-less original name, e.g.
-# bin/foo-2.7 --> bin/foo.
+# bin/foo-3.5 --> bin/foo.
#
# cython - Depend on lang/cython at build-time.
#
@@ -186,7 +185,7 @@
# interpreter, e.g. 2, 3, ...
#
# PYTHON_VER - The major-minor release version of the chosen Python
-# interpreter, e.g. 2.7, 3.6, ...
+# interpreter, e.g. 3.5, 3.6, ...
#
# PYTHON_ABIVER - Additional ABI flags set by the chosen Python
# interpreter, e.g. md
@@ -234,11 +233,6 @@
# PYTHON_VER=${PYTHON_VER}
# PYTHON_VERSION=${PYTHON_VERSION}
#
-# and PYTHON2 and PYTHON3 will be set according to the Python version:
-#
-# PYTHON2="" PYTHON3="@comment " for Python 2.x
-# PYTHON2="@comment " PYTHON3="" for Python 3.x
-#
# PYDISTUTILS_INSTALLNOSINGLE
# - Deprecated without replacement
#
@@ -250,8 +244,8 @@ _INCLUDE_USES_PYTHON_MK= yes
# What Python version and what Python interpreters are currently supported?
# When adding a version, please keep the comment in
# Mk/bsd.default-versions.mk in sync.
-_PYTHON_VERSIONS= 2.7 3.7 3.8 3.6 # preferred first
-_PYTHON_PORTBRANCH= 2.7 # ${_PYTHON_VERSIONS:[1]}
+_PYTHON_VERSIONS= 3.7 3.8 3.6 # preferred first
+_PYTHON_PORTBRANCH= 3.7 # ${_PYTHON_VERSIONS:[1]}
_PYTHON_BASECMD= ${LOCALBASE}/bin/python
_PYTHON_RELPORTDIR= lang/python
@@ -320,8 +314,8 @@ _PYTHON_RUN_DEP= yes
_PYTHON_TEST_DEP= yes
.endif
-.if ${PYTHON2_DEFAULT} != ${PYTHON_DEFAULT} && ${PYTHON3_DEFAULT} != ${PYTHON_DEFAULT}
-WARNING+= "PYTHON_DEFAULT must be a version present in PYTHON2_DEFAULT or PYTHON3_DEFAULT, if you want more Python flavors, set BUILD_ALL_PYTHON_FLAVORS in your make.conf"
+.if ${PYTHON3_DEFAULT} != ${PYTHON_DEFAULT}
+WARNING+= "PYTHON_DEFAULT must be a version present in PYTHON3_DEFAULT, if you want more Python flavors, set BUILD_ALL_PYTHON_FLAVORS in your make.conf"
.endif
.if ${_PYTHON_ARGS} == 2.7
@@ -358,7 +352,7 @@ _PYTHON_VERSION_NONSUPPORTED= ${_PYTHON_VERSION_MAXIMUM} at most
# If we have an unsupported version of Python, try another.
.if defined(_PYTHON_VERSION_NONSUPPORTED)
.undef _PYTHON_VERSION
-.for ver in ${PYTHON2_DEFAULT} ${PYTHON3_DEFAULT} ${_PYTHON_VERSIONS}
+.for ver in ${PYTHON3_DEFAULT} ${_PYTHON_VERSIONS}
__VER= ${ver}
.if !defined(_PYTHON_VERSION) && \
!(!empty(_PYTHON_VERSION_MINIMUM) && ( \
@@ -376,7 +370,7 @@ IGNORE= needs an unsupported version of Python
# Automatically generates FLAVORS if empty
.if empty(FLAVORS) && defined(_PYTHON_FEATURE_FLAVORS)
. undef _VALID_PYTHON_VERSIONS
-. for ver in ${PYTHON_DEFAULT} ${PYTHON2_DEFAULT} ${PYTHON3_DEFAULT} ${_PYTHON_VERSIONS}
+. for ver in ${PYTHON_DEFAULT} ${PYTHON3_DEFAULT} ${_PYTHON_VERSIONS}
__VER= ${ver}
. if !(!empty(_PYTHON_VERSION_MINIMUM) && ( \
${__VER} < ${_PYTHON_VERSION_MINIMUM})) && \
@@ -398,7 +392,7 @@ _ALL_PYTHON_FLAVORS= ${_PYTHON_VERSIONS:S/.//:S/^/py/}
. if defined(BUILD_ALL_PYTHON_FLAVORS) || defined(_PYTHON_FEATURE_ALLFLAVORS)
FLAVORS= ${_ALL_PYTHON_FLAVORS}
. else
-. for _v in ${PYTHON_DEFAULT} ${PYTHON2_DEFAULT} ${PYTHON3_DEFAULT}
+. for _v in ${PYTHON_DEFAULT} ${PYTHON3_DEFAULT}
_f= py${_v:S/.//}
. if ${_ALL_PYTHON_FLAVORS:M${_f}} && !${FLAVORS:M${_f}}
.if !empty(FLAVORS)
@@ -454,18 +448,17 @@ PYTHON_REL= ${PYTHON_PORTVERSION:C/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/:C/\.([0-9]+)$
# Might be overridden by calling ports
PYTHON_CMD?= ${_PYTHON_BASECMD}${_PYTHON_VERSION}
-.if ${PYTHON_VER} != 2.7
.if exists(${PYTHON_CMD}-config)
PYTHON_ABIVER!= ${PYTHON_CMD}-config --abiflags
.elif ${PYTHON_REL} < 3800
# Default ABI flags for lang/python3[67] ports
PYTHON_ABIVER= m
.endif
-.endif
.if ${PYTHON_MAJOR_VER} == 2
DEPRECATED?= Uses Python 2.7 which is EOLed upstream
EXPIRATION_DATE?= 2020-12-31
+BROKEN= Requires removed version of python
.endif
.if !defined(PYTHONBASE)
@@ -700,11 +693,7 @@ PLIST_SUB+= PYTHON_INCLUDEDIR=${PYTHONPREFIX_INCLUDEDIR:S;${PREFIX}/;;} \
PYTHON_SUFFIX=${PYTHON_SUFFIX} \
PYTHON_VER=${PYTHON_VER} \
PYTHON_VERSION=${PYTHON_VERSION}
-.if ${PYTHON_REL} < 3000
-PLIST_SUB+= PYTHON2="" PYTHON3="@comment "
-.else
PLIST_SUB+= PYTHON2="@comment " PYTHON3=""
-.endif
_USES_POST+= python
.endif # _INCLUDE_USES_PYTHON_MK
diff --git Mk/bsd.default-versions.mk Mk/bsd.default-versions.mk
index 33cc3359e3b7..bfb926f7ecb5 100644
--- Mk/bsd.default-versions.mk
+++ Mk/bsd.default-versions.mk
@@ -20,7 +20,7 @@ _INCLUDE_BSD_DEFAULT_VERSIONS_MK= yes
LOCALBASE?= /usr/local
.for lang in APACHE BDB COROSYNC EMACS FIREBIRD FORTRAN FPC GCC GHOSTSCRIPT \
- JAVA JULIA LAZARUS LINUX LLVM LUA MYSQL PERL5 PGSQL PHP PYTHON PYTHON2 \
+ JAVA JULIA LAZARUS LINUX LLVM LUA MYSQL PERL5 PGSQL PHP PYTHON \
PYTHON3 RUBY RUST SAMBA SSL TCLTK VARNISH
.if defined(${lang}_DEFAULT)
ERROR+= "The variable ${lang}_DEFAULT is set and it should only be defined through DEFAULT_VERSIONS+=${lang:tl}=${${lang}_DEFAULT} in /etc/make.conf"
@@ -90,10 +90,8 @@ PERL5_DEFAULT:= ${_PERL5_FROM_BIN:R}
PGSQL_DEFAULT?= 12
# Possible values: 7.2, 7.3, 7.4
PHP_DEFAULT?= 7.4
-# Possible values: 2.7, 3.6, 3.7, 3.8
+# Possible values: 3.6, 3.7, 3.8
PYTHON_DEFAULT?= 3.7
-# Possible values: 2.7
-PYTHON2_DEFAULT?= 2.7
# Possible values: 3.6, 3.7, 3.8
PYTHON3_DEFAULT?= 3.7
# Possible values: 2.5, 2.6, 2.7