git: 46a71ea3bf00 - main - python.mk: introduce PY_SETUPTOOLS

From: Charlie Li <vishwin_at_FreeBSD.org>
Date: Thu, 09 Mar 2023 17:37:29 UTC
The branch main has been updated by vishwin:

URL: https://cgit.FreeBSD.org/ports/commit/?id=46a71ea3bf0004075ed438ebf49af255fe942b89

commit 46a71ea3bf0004075ed438ebf49af255fe942b89
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2023-03-09 17:33:37 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2023-03-09 17:35:49 +0000

    python.mk: introduce PY_SETUPTOOLS
    
    Selects the correct setuptools port based on USE_PYTHON=distutils
    or not. devel/py-setuptools58 case currently commented out.
---
 Mk/Uses/python.mk | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Mk/Uses/python.mk b/Mk/Uses/python.mk
index 5e3e2e1add4c..edf56e387102 100644
--- a/Mk/Uses/python.mk
+++ b/Mk/Uses/python.mk
@@ -286,6 +286,7 @@
 #
 # Dependency lines of selected Python modules:
 #
+# PY_SETUPTOOLS			- setuptools port based on USE_PYTHON=distutils
 # PYGAME			- pygame port
 # PYNUMPY			- NumPy port
 # PY_MERCURIAL			- mercurial port, PKGNAME varies based on default
@@ -778,6 +779,17 @@ CMAKE_ARGS+=	-DPython_ADDITIONAL_VERSIONS=${PYTHON_VER}
 PYGAME=		${PYTHON_PKGNAMEPREFIX}game>0:devel/py-game@${PY_FLAVOR}
 PYNUMPY=	${PYTHON_PKGNAMEPREFIX}numpy>=1.16,1<1.25,1:math/py-numpy@${PY_FLAVOR}
 
+.  if defined(_PYTHON_FEATURE_DISTUTILS)
+.    if ${PYTHON_MAJOR_VER} < 3
+PY_SETUPTOOLS=	${PYTHON_PKGNAMEPREFIX}setuptools44>0:devel/py-setuptools44@${PY_FLAVOR}
+.    else
+#PY_SETUPTOOLS=	${PYTHON_PKGNAMEPREFIX}setuptools58>0:devel/py-setuptools58@${PY_FLAVOR}
+PY_SETUPTOOLS=	${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR}
+.    endif
+.  else
+PY_SETUPTOOLS=	${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR}
+.  endif
+
 # Common Python modules that can be needed but only for some versions of Python.
 .  if ${PYTHON_REL} < 30500
 .  else