From owner-svn-ports-head@freebsd.org Thu Mar 15 19:54:37 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80086F4DFBA; Thu, 15 Mar 2018 19:54:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 318DB74D6D; Thu, 15 Mar 2018 19:54:37 +0000 (UTC) (envelope-from bdrewery@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C8881A6D0; Thu, 15 Mar 2018 19:54:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FJsbpd080051; Thu, 15 Mar 2018 19:54:37 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FJsaj4080049; Thu, 15 Mar 2018 19:54:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201803151954.w2FJsaj4080049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 15 Mar 2018 19:54:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r464627 - in head/devel/py-cov-core: . files X-SVN-Group: ports-head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head/devel/py-cov-core: . files X-SVN-Commit-Revision: 464627 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 19:54:37 -0000 Author: bdrewery Date: Thu Mar 15 19:54:36 2018 New Revision: 464627 URL: https://svnweb.freebsd.org/changeset/ports/464627 Log: Fix installation of init_cov_core.pth to be in the package rather than the build host. Added: head/devel/py-cov-core/files/ head/devel/py-cov-core/files/patch-setup.py (contents, props changed) Modified: head/devel/py-cov-core/Makefile Modified: head/devel/py-cov-core/Makefile ============================================================================== --- head/devel/py-cov-core/Makefile Thu Mar 15 19:47:38 2018 (r464626) +++ head/devel/py-cov-core/Makefile Thu Mar 15 19:54:36 2018 (r464627) @@ -3,6 +3,7 @@ PORTNAME= cov-core PORTVERSION= 1.15.0 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -17,5 +18,10 @@ RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}coverage>=3.6:deve USES= python USE_PYTHON= autoplist distutils + +PLIST_FILES+= ${PYTHON_SITELIBDIR}/init_cov_core.pth +post-install: + ${INSTALL_DATA} ${WRKSRC}/init_cov_core.pth \ + ${STAGEDIR}${PYTHON_SITELIBDIR}/ .include Added: head/devel/py-cov-core/files/patch-setup.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/py-cov-core/files/patch-setup.py Thu Mar 15 19:54:36 2018 (r464627) @@ -0,0 +1,44 @@ +Based on debian patch: + +Author: Barry Warsaw +Patch-Name: pth-installation-path +Subject: Calculate the correct .pth path + + cov-core wants to install the file init_cov_core.pth so that cov_core_init + will be imported and initialized automatically for subprocess coverage, if + the environment variable COV_CORE_SOURCE is set (which e.g. nose does + automatically). However the upstream setup.py tries to install this file + directly into /usr/lib/pythonX.Y/{site,dist}-packages, which clearly doesn't + work when building the package. This patch hard codes the .pth path for a + location within the build directory. dh_python{2,3} does the rest. +Forwarded: not-needed + +--- setup.py ++++ setup.py +@@ -48,23 +48,6 @@ + 'Topic :: Software Development :: Testing']) + + if sys.argv[1] in ('install', 'develop'): +- for path in sys.path: +- if (path.endswith('site-packages')) or (path.endswith('dist-packages') +- and 'local' in path): +- path = os.path.join(path, PTH_FILE_NAME) +- try: +- pth_file = open(path, 'w') +- pth_file.write(PTH_FILE) +- pth_file.close() +- sys.stdout.write('\nWrote pth file for subprocess ' +- 'measurement to %s\n' % path) +- break +- except Exception: +- sys.stdout.write('\nFailed to write pth file for subprocess ' +- 'measurement to %s\n' % path) +- sys.stdout.write(PTH_FILE_FAILURE) +- break +- else: +- sys.stdout.write('\nFailed to find site-packages or dist-packages ' +- 'dir to put pth file in.\n') +- sys.stdout.write(PTH_FILE_FAILURE) ++ pth_path = PTH_FILE_NAME ++ with open(pth_path, 'w') as fp: ++ fp.write(PTH_FILE)