svn commit: r356921 - in head: . Mk

Marcus von Appen mva at FreeBSD.org
Sat Jun 7 16:13:12 UTC 2014


Author: mva
Date: Sat Jun  7 16:13:11 2014
New Revision: 356921
URL: http://svnweb.freebsd.org/changeset/ports/356921
QAT: https://qat.redports.org/buildarchive/r356921/

Log:
  Introduce a new PYTHON_CONCURRENT_INSTALL knob to support the parallel
  installation of ports for different python versions.
  
  If set to yes, the knob indicates that the port can be installed for different
  python versions at the same time. The port will use a unique prefix for
  certain directories using USES=uniquefiles:dirs (see the uniquefiles.mk Uses
  for details about the directories). Binaries receive an additional suffix,
  based on ${PYTHON_VER}.
  
  With hat:	python@

Modified:
  head/CHANGES
  head/Mk/bsd.python.mk

Modified: head/CHANGES
==============================================================================
--- head/CHANGES	Sat Jun  7 16:06:11 2014	(r356920)
+++ head/CHANGES	Sat Jun  7 16:13:11 2014	(r356921)
@@ -10,6 +10,33 @@ in the release notes and/or placed into 
 
 All ports committers are allowed to commit to this file.
 
+20140607:
+AUTHOR: mva at FreeBSD.org
+
+  New PYTHON_CONCURRENT_INSTALL knob to support the parallel installation
+  of ports for different python versions.
+
+  If set to yes, the knob indicates that the port can be installed for
+  different python versions at the same time. The port will use a unique
+  prefix for certain directories using USES=uniquefiles:dirs (see the
+  uniquefiles.mk Uses for details about the directories). Binaries
+  receive an additional suffix, based on ${PYTHON_VER}.
+
+  The values for the uniquefiles USES are set as follows:
+
+    UNIQUE_PREFIX=  ${PYTHON_PKGNAMEPREFIX}
+    UNIQUE_SUFFIX=  -${PYTHON_VER}
+
+  If the port is installed for the current default python version, scripts and
+  binaries in
+
+    ${PREFIX}/bin
+    ${PREFIX}/sbin
+    ${PREFIX}/libexec
+
+  are linked from the prefixed version to the prefix-less original name,
+  e.g. bin/foo-2.7 --> bin/foo.
+
 20140529:
 AUTHOR: miwi at FreeBSD.org
 

Modified: head/Mk/bsd.python.mk
==============================================================================
--- head/Mk/bsd.python.mk	Sat Jun  7 16:06:11 2014	(r356920)
+++ head/Mk/bsd.python.mk	Sat Jun  7 16:13:11 2014	(r356921)
@@ -122,6 +122,29 @@ Python_Include_MAINTAINER=	python at FreeBS
 # PYXML				- Dependency line for the XML extension. As of Python-2.0,
 #					  this extension is in the base distribution.
 #
+# PYTHON_CONCURRENT_INSTALL
+#					- Indicates that the port can be installed for different
+#					  python versions at the same time. The port is supposed
+#					  to use a unique prefix for certain directories using
+#					  USES=uniquefiles:dirs (see the uniquefiles.mk Uses for
+#					  details about the directories), if set to yes. Binaries
+#					  receive an additional suffix, based on PYTHON_VER.
+#
+#					  The values for the uniquefiles USES are set as follows:
+#
+#						UNIQUE_PREFIX=  ${PYTHON_PKGNAMEPREFIX}
+#						UNIQUE_SUFFIX=  -${PYTHON_VER}
+#
+#					  If the port is installed for the current default
+#					  python version, scripts and binaries in
+#
+#						${PREFIX}/bin
+#						${PREFIX}/sbin
+#						${PREFIX}/libexec
+#
+#					  are linked from the prefixed version to the prefix-less
+#					  original name, e.g. bin/foo-2.7 --> bin/foo.
+#
 # USE_PYTHON_PREFIX	- Says that the port installs in ${PYTHONBASE}.
 #
 # USE_PYDISTUTILS	- Use distutils as do-configure, do-build and do-install
@@ -414,6 +437,46 @@ PYTHONPREFIX_INCLUDEDIR=	${PYTHON_INCLUD
 PYTHONPREFIX_LIBDIR=		${PYTHON_LIBDIR:S;${PYTHONBASE};${PREFIX};}
 PYTHONPREFIX_SITELIBDIR=	${PYTHON_SITELIBDIR:S;${PYTHONBASE};${PREFIX};}
 
+# Used for recording the installed files.
+_PYTHONPKGLIST=	${WRKDIR}/.PLIST.pymodtmp
+
+# Ports bound to a certain python version SHOULD
+# - use the PYTHON_PKGNAMEPREFIX
+# - use directories using the PYTHON_PKGNAMEPREFIX
+# - install binaries using the required PYTHON_VER, with
+#   the default python version creating a symlink to the original binary
+#   name (for staging-aware ports).
+#
+# What makes a port 'bound' to a certain python version?
+# - it installs data into PYTHON_SITELIBDIR, PYTHON_INCLUDEDIR, ...
+# - it links against libpython*.so
+# - it uses USE_PYDISTUTILS
+#
+PYTHON_CONCURRENT_INSTALL?=	no
+.if defined(NO_STAGE) && ${PYTHON_CONCURRENT_INSTALL} == "yes"
+BROKEN=		PYTHON_CONCURRENT_INSTALL uses USES=uniquefiles, which is not stage-safe
+.endif
+
+.if ${PYTHON_CONCURRENT_INSTALL} == "yes"
+_USES_POST+=			uniquefiles:dirs
+.if ${PYTHON_VERSION} == ${PYTHON_DEFAULT_VERSION}
+UNIQUE_DEFAULT_LINKS=	yes
+.else
+UNIQUE_DEFAULT_LINKS=	no
+.endif
+UNIQUE_PREFIX=			${PYTHON_PKGNAMEPREFIX}
+UNIQUE_SUFFIX=			-${PYTHON_VER}
+
+.if defined(PYDISTUTILS_AUTOPLIST)
+UNIQUE_FIND_SUFFIX_FILES=	\
+	${SED} -e 's|^${PREFIX}/||' ${_PYTHONPKGLIST} ${TMPPLIST} | \
+	${GREP} -e '^bin/.*$$\|^sbin/.*$$\|^libexec/.*$$'
+.else
+UNIQUE_FIND_SUFFIX_FILES=	\
+	${GREP} -he '^bin/.*$$\|^sbin/.*$$\|^libexec/.*$$' ${TMPPLIST} 2>/dev/null
+.endif
+.endif # ${PYTHON_CONCURRENT_INSTALL} == "yes"
+
 _CURRENTPORT:=	${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}
 .if defined(USE_PYDISTUTILS) && ${_CURRENTPORT:S/${PYTHON_SUFFIX}$//} != ${PYTHON_PKGNAMEPREFIX}setuptools
 BUILD_DEPENDS+=		${PYTHON_PKGNAMEPREFIX}setuptools${PYTHON_SUFFIX}>0:${PORTSDIR}/devel/py-setuptools${PYTHON_SUFFIX}
@@ -497,7 +560,6 @@ PYDISTUTILS_INSTALLARGS+=	--single-versi
 PYDISTUTILS_INSTALLARGS+=	--root=${STAGEDIR}
 . endif
 .endif
-_PYTHONPKGLIST=				${WRKDIR}/.PLIST.pymodtmp
 PYDISTUTILS_INSTALLARGS:=	--record ${_PYTHONPKGLIST} \
 		${PYDISTUTILS_INSTALLARGS}
 


More information about the svn-ports-head mailing list