From owner-svn-ports-all@freebsd.org Tue Dec 5 15:00:05 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 954A4E6CA98; Tue, 5 Dec 2017 15:00:05 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EF197DF4C; Tue, 5 Dec 2017 15:00:05 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB5F04GA051082; Tue, 5 Dec 2017 15:00:04 GMT (envelope-from lifanov@FreeBSD.org) Received: (from lifanov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB5F04CR051076; Tue, 5 Dec 2017 15:00:04 GMT (envelope-from lifanov@FreeBSD.org) Message-Id: <201712051500.vB5F04CR051076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lifanov set sender to lifanov@FreeBSD.org using -f From: Nikolai Lifanov Date: Tue, 5 Dec 2017 15:00:04 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r455585 - in head: devel devel/py-backports devel/py-backports.functools_lru_cache devel/py-backports.shutil_get_terminal_size security/py-backports.ssl_match_hostname X-SVN-Group: ports-head X-SVN-Commit-Author: lifanov X-SVN-Commit-Paths: in head: devel devel/py-backports devel/py-backports.functools_lru_cache devel/py-backports.shutil_get_terminal_size security/py-backports.ssl_match_hostname X-SVN-Commit-Revision: 455585 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2017 15:00:05 -0000 Author: lifanov Date: Tue Dec 5 15:00:03 2017 New Revision: 455585 URL: https://svnweb.freebsd.org/changeset/ports/455585 Log: add devel/py-backports - namespace shim for Python backports Currently, all py-backports.* ports conflict with each other over a file that has the same contents. This creates a port that installs the shared file and py-backports.* ports should depend on this one and remove the shared file from their own pkg-plist. It's the same approach as the one taken by OpenBSD. Some ports are already converted as an example: - security/py-backports.ssl_match_hostname - devel/py-backports.functools_lru_cache - devel/py-backports.shutil_get_terminal_size The last two conversions and the fix to work with FLAVORS were submitted by antoine. Thank you! Reviewed by: antoine Approved by: portmgr (antoine) Differential Revision: https://reviews.freebsd.org/D11095 Added: head/devel/py-backports/ head/devel/py-backports/Makefile (contents, props changed) head/devel/py-backports/pkg-descr (contents, props changed) Modified: head/devel/Makefile head/devel/py-backports.functools_lru_cache/Makefile head/devel/py-backports.shutil_get_terminal_size/Makefile head/security/py-backports.ssl_match_hostname/Makefile Modified: head/devel/Makefile ============================================================================== --- head/devel/Makefile Tue Dec 5 14:01:12 2017 (r455584) +++ head/devel/Makefile Tue Dec 5 15:00:03 2017 (r455585) @@ -4263,6 +4263,7 @@ SUBDIR += py-avro SUBDIR += py-babel SUBDIR += py-babelfish + SUBDIR += py-backports SUBDIR += py-backports.csv SUBDIR += py-backports.functools_lru_cache SUBDIR += py-backports.shutil_get_terminal_size Modified: head/devel/py-backports.functools_lru_cache/Makefile ============================================================================== --- head/devel/py-backports.functools_lru_cache/Makefile Tue Dec 5 14:01:12 2017 (r455584) +++ head/devel/py-backports.functools_lru_cache/Makefile Tue Dec 5 15:00:03 2017 (r455585) @@ -2,6 +2,7 @@ PORTNAME= backports.functools_lru_cache PORTVERSION= 1.4 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -12,9 +13,20 @@ COMMENT= Backport of functools.lru_cache from Python 3 LICENSE= MIT BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools_scm>=1.15.0:devel/py-setuptools_scm@${FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}backports>0:devel/py-backports@${FLAVOR} NO_ARCH= yes USE_PYTHON= autoplist distutils USES= python:2.7 + +POST_PLIST= trim-backports-namespace + +post-install: + @${RM} ${STAGEDIR}${PYTHON_SITELIBDIR}/backports/__init__.py* + @${RM} -r ${STAGEDIR}${PYTHON_SITELIBDIR}/backports/__pycache__ + +trim-backports-namespace: + @${REINPLACE_CMD} '/backports\/__init__.py*/d' ${TMPPLIST} + @${REINPLACE_CMD} '/backports\/__pycache__*/d' ${TMPPLIST} .include Modified: head/devel/py-backports.shutil_get_terminal_size/Makefile ============================================================================== --- head/devel/py-backports.shutil_get_terminal_size/Makefile Tue Dec 5 14:01:12 2017 (r455584) +++ head/devel/py-backports.shutil_get_terminal_size/Makefile Tue Dec 5 15:00:03 2017 (r455585) @@ -2,6 +2,7 @@ PORTNAME= backports.shutil_get_terminal_size PORTVERSION= 1.0.0 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -11,7 +12,19 @@ COMMENT= Backport of the get_terminal_size function fr LICENSE= PSFL +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}backports>0:devel/py-backports@${FLAVOR} + USES= python USE_PYTHON= autoplist distutils + +POST_PLIST= trim-backports-namespace + +post-install: + @${RM} ${STAGEDIR}${PYTHON_SITELIBDIR}/backports/__init__.py* + @${RM} -r ${STAGEDIR}${PYTHON_SITELIBDIR}/backports/__pycache__ + +trim-backports-namespace: + @${REINPLACE_CMD} '/backports\/__init__.py*/d' ${TMPPLIST} + @${REINPLACE_CMD} '/backports\/__pycache__*/d' ${TMPPLIST} .include Added: head/devel/py-backports/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/py-backports/Makefile Tue Dec 5 15:00:03 2017 (r455585) @@ -0,0 +1,38 @@ +# $FreeBSD$ + +PORTNAME= backports +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +PORTVERSION= 1 +CATEGORIES= devel python +DISTFILES= + +MAINTAINER= lifanov@FreeBSD.org +COMMENT= Shared namespace shim for py-backports.* ports + +LICENSE= MIT + +NO_FETCH= yes +NO_BUILD= yes +NO_ARCH= yes +USES= python +USE_PYTHON= flavors + +.include + +.if ${PYTHON_MAJOR_VER} == 2 +PLIST_FILES= ${PYTHON_SITELIBDIR}/backports/__init__.py \ + ${PYTHON_SITELIBDIR}/backports/__init__.pyc \ + ${PYTHON_SITELIBDIR}/backports/__init__.${PYTHON_PYOEXTENSION} +.else +PLIST_FILES= ${PYTHON_SITELIBDIR}/backports/__init__.py \ + ${PYTHON_SITELIBDIR}/backports/__pycache__/__init__.cpython-${PYTHON_SUFFIX}.pyc \ + ${PYTHON_SITELIBDIR}/backports/__pycache__/__init__.cpython-${PYTHON_SUFFIX}.${PYTHON_PYOEXTENSION} +.endif + +do-install: + ${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/backports + ${ECHO_CMD} "__path__ = __import__('pkgutil').extend_path(__path__, __name__)" > ${STAGEDIR}${PYTHON_SITELIBDIR}/backports/__init__.py + ${PYTHON_CMD} -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} + ${PYTHON_CMD} -O -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} + +.include Added: head/devel/py-backports/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/py-backports/pkg-descr Tue Dec 5 15:00:03 2017 (r455585) @@ -0,0 +1,4 @@ +shared namespace shim for py-backports.* ports + +py-backports provides a common backports/__init__.py, +which is shared among all py-backports.* ports. Modified: head/security/py-backports.ssl_match_hostname/Makefile ============================================================================== --- head/security/py-backports.ssl_match_hostname/Makefile Tue Dec 5 14:01:12 2017 (r455584) +++ head/security/py-backports.ssl_match_hostname/Makefile Tue Dec 5 15:00:03 2017 (r455585) @@ -2,6 +2,7 @@ PORTNAME= backports.ssl_match_hostname PORTVERSION= 3.5.0.1 +PORTREVISION= 1 CATEGORIES= security python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -11,7 +12,19 @@ COMMENT= Backport of the ssl_match_hostname function f LICENSE= PSFL +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}backports>0:devel/py-backports@${FLAVOR} + USES= python:-3.4 USE_PYTHON= autoplist distutils + +POST_PLIST= trim-backports-namespace + +post-install: + @${RM} ${STAGEDIR}${PYTHON_SITELIBDIR}/backports/__init__.py* + @${RM} -r ${STAGEDIR}${PYTHON_SITELIBDIR}/backports/__pycache__ + +trim-backports-namespace: + @${REINPLACE_CMD} '/backports\/__init__.py*/d' ${TMPPLIST} + @${REINPLACE_CMD} '/backports\/__pycache__*/d' ${TMPPLIST} .include