Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Mar 2023 04:19:17 GMT
From:      Charlie Li <vishwin@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 43ae3588e62e - main - python.mk: use PYTHON_MAJOR_VER for Python 2/3 conditionals
Message-ID:  <202303090419.3294JHvc014262@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by vishwin:

URL: https://cgit.FreeBSD.org/ports/commit/?id=43ae3588e62e8349474181c1ebb1f32e4d249fc8

commit 43ae3588e62e8349474181c1ebb1f32e4d249fc8
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2023-03-09 04:17:52 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2023-03-09 04:17:52 +0000

    python.mk: use PYTHON_MAJOR_VER for Python 2/3 conditionals
---
 Mk/Uses/python.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Mk/Uses/python.mk b/Mk/Uses/python.mk
index 0c118de3058c..1ed76079cbc9 100644
--- a/Mk/Uses/python.mk
+++ b/Mk/Uses/python.mk
@@ -525,7 +525,7 @@ PYTHON_REL=	${PYTHON_DISTVERSION: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 ${PYTHON_MAJOR_VER} > 2
 .    if exists(${PYTHON_CMD}-config)
 PYTHON_ABIVER!=		${PYTHON_CMD}-config --abiflags
 .    elif ${PYTHON_REL} < 30800
@@ -540,7 +540,7 @@ PYTHON_EXT_SUFFIX=	.cpython-${PYTHON_SUFFIX}
 PYTHON_EXT_SUFFIX=	# empty
 .  endif
 
-.  if ${PYTHON_MAJOR_VER} == 2
+.  if ${PYTHON_MAJOR_VER} < 3
 DEPRECATED?=	Uses Python 2.7 which is EOLed upstream
 .  endif
 
@@ -629,7 +629,7 @@ RUN_DEPENDS+=		${PYTHON_PKGNAMEPREFIX}setuptools>=63.1.0:devel/py-setuptools@${P
 .  endif
 
 .  if defined(_PYTHON_FEATURE_PEP517)
-.    if ${PYTHON_VER} == 2.7
+.    if ${PYTHON_MAJOR_VER} < 3
 DEV_ERROR+=		"USES=python:2.7 is incompatible with USE_PYTHON=pep517"
 .    endif
 .    if defined(_PYTHON_FEATURE_DISTUTILS)
@@ -817,7 +817,7 @@ PLIST_SUB+=	PYTHON_INCLUDEDIR=${PYTHONPREFIX_INCLUDEDIR:S;${PREFIX}/;;} \
 		PYTHON_EXT_SUFFIX=${PYTHON_EXT_SUFFIX} \
 		PYTHON_VER=${PYTHON_VER} \
 		PYTHON_VERSION=${PYTHON_VERSION}
-.  if ${PYTHON_REL} < 30000
+.  if ${PYTHON_MAJOR_VER} < 3
 SUB_LIST+=	PYTHON2="" PYTHON3="@comment "
 PLIST_SUB+=	PYTHON2="" PYTHON3="@comment "
 .  else



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202303090419.3294JHvc014262>