Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 May 2020 18:31:40 +0000 (UTC)
From:      Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r536495 - head/Mk/Uses
Message-ID:  <202005251831.04PIVeZn054395@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@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



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