From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Jan 20 21:20:00 2014 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 86FB6C24 for ; Mon, 20 Jan 2014 21:20:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5B5F81CA6 for ; Mon, 20 Jan 2014 21:20:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id s0KLK0VF042272 for ; Mon, 20 Jan 2014 21:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id s0KLK0C5042271; Mon, 20 Jan 2014 21:20:00 GMT (envelope-from gnats) Resent-Date: Mon, 20 Jan 2014 21:20:00 GMT Resent-Message-Id: <201401202120.s0KLK0C5042271@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Marcus von Appen Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D28E1B70; Mon, 20 Jan 2014 21:18:17 +0000 (UTC) Received: from smtprelay05.ispgateway.de (smtprelay05.ispgateway.de [80.67.31.98]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 37BBB1C8A; Mon, 20 Jan 2014 21:18:16 +0000 (UTC) Received: from [89.182.113.244] (helo=medusa.sysfault.org) by smtprelay05.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1W5MDu-0006ns-0X; Mon, 20 Jan 2014 22:17:34 +0100 Received: from localhost ([127.0.0.1] helo=medusa.sysfault.org) by medusa.sysfault.org with esmtp (Exim 4.82 (FreeBSD)) (envelope-from ) id 1W5MDr-000CW7-SY; Mon, 20 Jan 2014 22:17:31 +0100 Received: (from marcus@localhost) by medusa.sysfault.org (8.14.7/8.14.7/Submit) id s0KLHVLL048118; Mon, 20 Jan 2014 22:17:31 +0100 (CET) (envelope-from marcus) Message-Id: <201401202117.s0KLHVLL048118@medusa.sysfault.org> Date: Mon, 20 Jan 2014 22:17:31 +0100 (CET) From: Marcus von Appen To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.114 Subject: ports/185947: [exp-run] unique file and package name support for python ports Cc: portmgr@FreeBSD.org X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Marcus von Appen List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jan 2014 21:20:00 -0000 >Number: 185947 >Category: ports >Synopsis: [exp-run] unique file and package name support for python ports >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Jan 20 21:20:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Marcus von Appen >Release: FreeBSD 9.2-STABLE amd64 >Organization: >Environment: System: FreeBSD medusa.sysfault.org 9.2-STABLE FreeBSD 9.2-STABLE #14 r260254: Sat Jan 4 14:59:59 CET 2014 root@medusa.sysfault.org:/usr/obj/usr/src/sys/MEDUSA amd64 >Description: The attached patch enables python ports (modules or packages), which use distutils as primary installation method to install themselves in a collision-free manner for different python versions at the same time. To keep issues with the change at a minimum, an exp-run is needed to detect and fix ports, which are configured in a way that will break them with the patch. >How-To-Repeat: >Fix: --- python_unique_ports_v8.diff begins here --- Index: Mk/bsd.python.mk =================================================================== --- Mk/bsd.python.mk (revision 340230) +++ Mk/bsd.python.mk (working copy) @@ -78,8 +78,8 @@ # for ${PYTHON_PKGNAMEPREFIX}. # # PYTHON_VERSION - Version of the python binary in your ${PATH}, in the -# format "python2.0". Set this in your makefile in case you -# want to build extensions with an older binary. +# format "python2.0". Set this in your makefile in case +# you want to build extensions with an older binary. # default: depends on the version of your python binary # # PYTHON_VER - Version of the python binary in your ${PATH}, in the @@ -86,16 +86,16 @@ # format "2.7". # # PYTHON_DEFAULT_VERSION -# - Version of the default python binary in your ${PATH}, in -# the format "python2.7". +# - Version of the default python binary in your ${PATH}, +# in the format "python2.7". # # PYTHON2_DEFAULT_VERSION -# - Version of the default python2 binary in your ${PATH}, in -# the format "python2.7". +# - Version of the default python2 binary in your ${PATH}, +# in the format "python2.7". # # PYTHON3_DEFAULT_VERSION -# - Version of the default python3 binary in your ${PATH}, in -# the format "python3.2". +# - Version of the default python3 binary in your ${PATH}, +# in the format "python3.2". # # PYTHON_MAJOR_VER - Python version major number. 2 for python-2.x, # 3 for python-3.x and so on. @@ -125,22 +125,41 @@ # USE_PYTHON_PREFIX - Says that the port installs in ${PYTHONBASE}. # # USE_PYDISTUTILS - Use distutils as do-configure, do-build and do-install -# targets. +# targets. Using distutils also will cause the port to +# use a unique prefix for certain directories +# using USES=uniquefiles:dirs (see the +# uniquefiles.mk Uses for details). 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. +# # PYSETUP - Name of the setup script used by the distutils package. # default: setup.py # # PYDISTUTILS_AUTOPLIST -# - Automatically generates the packaging list for a port that uses -# distutils or setuptools (easy_install) when defined. -# requires: USE_PYDISTUTILS +# - Automatically generates the packaging list for a port +# that uses distutils or setuptools (easy_install) when +# defined. +# requires: USE_PYDISTUTILS # # PYTHON_PY3K_PLIST_HACK -# - Automatically generates Python 3.x compatible __pycache__ entries -# from a Python 2.x packaging list when defined. Use this for ports that -# do *not* use standard Python packaging mechanisms such as distutils -# or setuptools, and support *both* Python 2.x and 3.x. Not needed when -# PYDISTUTILS_AUTOPLIST is defined. +# - Automatically generates Python 3.x compatible +# __pycache__ entries from a Python 2.x packaging list +# when defined. Use this for ports that do *not* use +# standard Python packaging mechanisms such as distutils +# or setuptools, and support *both* Python 2.x and 3.x. +# Not needed when PYDISTUTILS_AUTOPLIST is defined. # # PYDISTUTILS_PKGNAME # - Internal name in the distutils for egg-info. @@ -411,6 +430,44 @@ 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 MUST +# - use the PYTHON_PKGNAMEPREFIX +# - use directories using the PYTHON_PKGNAMEPREFIX +# - will install binaries using the required PYTHON_PKGNAMEPREFIX, 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 +# +.if defined(NO_STAGE) && defined(UNIQUE_PYTHON_FILES) +BROKEN= UNIQUE_PYTHON_FILES uses USES=uniquefiles, which is not stage-safe +.endif +.if !defined(NO_STAGE) && (defined(USE_PYDISTUTILS) || defined(UNIQUE_PYTHON_FILES)) +_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/.*$$\|^libexc/.*$$' +.else +UNIQUE_FIND_SUFFIX_FILES= \ + ${GREP} -he '^bin/.*$$\|^sbin/.*$$\|^libexec/.*$$' ${TMPPLIST} 2>/dev/null +.endif +.endif + _CURRENTPORT:= ${PKGNAMEPREFIX}${PORTNAME} .if defined(USE_PYDISTUTILS) && ${_CURRENTPORT} != ${PYTHON_PKGNAMEPREFIX}setuptools BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}setuptools>0:${PORTSDIR}/devel/py-setuptools @@ -494,7 +551,6 @@ PYDISTUTILS_INSTALLARGS+= --root=${STAGEDIR} . endif .endif -_PYTHONPKGLIST= ${WRKDIR}/.PLIST.pymodtmp PYDISTUTILS_INSTALLARGS:= --record ${_PYTHONPKGLIST} \ ${PYDISTUTILS_INSTALLARGS} --- python_unique_ports_v8.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: