svn commit: r536495 - head/Mk/Uses
Sunpoet Po-Chuan Hsieh
sunpoet at FreeBSD.org
Mon May 25 18:31:43 UTC 2020
Author: sunpoet
Date: Mon May 25 18:31:40 2020
New Revision: 536495
URL: https://svnweb.freebsd.org/changeset/ports/536495
Log:
Add Python flavor support
USES=scons:python2 usage is a temporary solution for ports using Python 2.
It will be removed when all consumers moved to Python 3.
Or it will go away with Python 2 removal by December 31, 2020.
Modified:
head/Mk/Uses/scons.mk
Modified: head/Mk/Uses/scons.mk
==============================================================================
--- head/Mk/Uses/scons.mk Mon May 25 18:31:34 2020 (r536494)
+++ head/Mk/Uses/scons.mk Mon May 25 18:31:40 2020 (r536495)
@@ -3,22 +3,36 @@
# Provide support to use the scons
#
# Feature: scons
-# Usage: USES=scons
+# Usage: USES=scons[:ARGS]
+# Valid ARGS: python2 python3
#
+# python2: Use default python 2.x to run scons
+# python3: Use default python 3.x to run scons (default)
+#
# MAINTAINER: python at FreeBSD.org
.if !defined(_INCLUDE_USES_SCONS_MK)
_INCLUDE_USES_SCONS_MK= yes
-.if !empty(scons_ARGS)
-IGNORE= Incorrect 'USES+= scons:${scons_ARGS}' scons takes no arguments
+.if empty(scons_ARGS)
+scons_ARGS= python3
.endif
-SCONS= ${LOCALBASE}/bin/scons
+.if ${scons_ARGS} == python3
+_SCONS_PYTHON_VER= ${PYTHON3_DEFAULT}
+.elif ${scons_ARGS} == python2
+_SCONS_PYTHON_VER= ${PYTHON2_DEFAULT}
+.else
+IGNORE= Incorrect 'USES+= scons:${scons_ARGS}' usage
+.endif
-BUILD_DEPENDS+= ${SCONS}:devel/scons
+_SCONS_PYTHON_FLAVOR= py${_SCONS_PYTHON_VER:S|.||}
-ALL_TARGET= #
+SCONS= ${LOCALBASE}/bin/scons-${_SCONS_PYTHON_VER}
+
+BUILD_DEPENDS+= ${SCONS}:devel/scons@${_SCONS_PYTHON_FLAVOR}
+
+ALL_TARGET?= #
CCFLAGS?= ${CFLAGS}
CPPPATH?= ${LOCALBASE}/include
LIBPATH?= ${LOCALBASE}/lib
More information about the svn-ports-head
mailing list