From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5E7F4198005 for ; Thu, 21 Mar 2013 23:39:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ABF21E066A; Thu, 21 Mar 2013 23:39:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2E327E066A for ; Thu, 21 Mar 2013 23:39:15 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1401133BE5C for ; Thu, 21 Mar 2013 23:39:14 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 2098) id 8CCFE2171D; Thu, 21 Mar 2013 23:39:11 +0000 (UTC) From: "Zac Medico (zmedico)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, zmedico@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/portage: portage-9999.ebuild ChangeLog X-VCS-Repository: gentoo-x86 X-VCS-Files: portage-9999.ebuild ChangeLog X-VCS-Directories: sys-apps/portage X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20130321233911.8CCFE2171D@flycatcher.gentoo.org> Date: Thu, 21 Mar 2013 23:39:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 5e931cf0-8071-43c8-8838-756b9e924346 X-Archives-Hash: 3f56e3bc954f3845a879f583e619b2bf zmedico 13/03/21 23:39:11 Modified: portage-9999.ebuild ChangeLog Log: Add experimental PYTHON_TARGETS support (instead of setting PYTHONPATH via /etc/env.d). (Portage version: 2.2.0_alpha168_p8/cvs/Linux i686, RepoMan options: --force, signed Manifest commit with key 0xFDE8EF85AE5719A3) Revision Changes Path 1.69 sys-apps/portage/portage-9999.ebuild file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-9999.ebuild?rev=1.69&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-9999.ebuild?rev=1.69&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-9999.ebuild?r1=1.68&r2=1.69 Index: portage-9999.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-9999.ebuild,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- portage-9999.ebuild 6 Feb 2013 19:46:46 -0000 1.68 +++ portage-9999.ebuild 21 Mar 2013 23:39:11 -0000 1.69 @@ -1,9 +1,14 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-9999.ebuild,v 1.68 2013/02/06 19:46:46 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-9999.ebuild,v 1.69 2013/03/21 23:39:11 zmedico Exp $ EAPI=3 -inherit git-2 eutils python +PYTHON_COMPAT=( + pypy1_9 pypy2_0 + python3_1 python3_2 python3_3 python3_4 + python2_6 python2_7 +) +inherit git-2 eutils multilib python DESCRIPTION="Portage is the package management and distribution system for Gentoo" HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml" @@ -12,6 +17,11 @@ SLOT="0" IUSE="build doc epydoc +ipc linguas_ru pypy2_0 python2 python3 selinux xattr" +for _pyimpl in ${PYTHON_COMPAT[@]} ; do + IUSE+=" python_targets_${_pyimpl}" +done +unset _pyimpl + # Import of the io module in python-2.6 raises ImportError for the # thread module if threading is disabled. python_dep_ssl="python3? ( =dev-lang/python-3*[ssl] ) @@ -24,6 +34,17 @@ python_dep="${python_dep//,ssl}" python_dep="${python_dep//ssl,}" +python_dep="${python_dep} + python_targets_pypy1_9? ( dev-python/pypy:1.9 ) + python_targets_pypy2_0? ( dev-python/pypy:2.0 ) + python_targets_python2_6? ( dev-lang/python:2.6 ) + python_targets_python2_7? ( dev-lang/python:2.7 ) + python_targets_python3_1? ( dev-lang/python:3.1 ) + python_targets_python3_2? ( dev-lang/python:3.2 ) + python_targets_python3_3? ( dev-lang/python:3.3 ) + python_targets_python3_4? ( dev-lang/python:3.4 ) +" + # The pysqlite blocker is for bug #282760. # make-3.82 is for bug #455858 DEPEND="${python_dep} @@ -100,8 +121,8 @@ ! compatible_python_is_selected ; then ewarn "Attempting to select a compatible default python interpreter" local x success=0 - for x in /usr/bin/python2.* ; do - x=${x#/usr/bin/python2.} + for x in "${EPREFIX}"/usr/bin/python2.* ; do + x=${x#${EPREFIX}/usr/bin/python2.} if [[ $x -ge 6 ]] 2>/dev/null ; then eselect python set python2.$x if compatible_python_is_selected ; then @@ -240,12 +261,47 @@ # Use dodoc for compression, since the Makefile doesn't do that. dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} || die - # Set PYTHONPATH for portage API consumers. This way we don't have - # to rely on patched python having the correct path, since it has - # been known to incorrectly add /usr/libx32/portage/pym to sys.path. - echo "PYTHONPATH=\"${EPREFIX}/usr/lib/portage/pym\"" > \ - "${T}/05portage" || die - doenvd "${T}/05portage" + # Allow external portage API consumers to import portage python modules + # (this used to be done with PYTHONPATH setting in /etc/env.d). + # For each of PYTHON_TARGETS, install a tree of *.py symlinks in + # site-packages, and compile with the corresponding interpreter. + local impl files mod_dir dest_mod_dir python relative_path files x + for impl in "${PYTHON_COMPAT[@]}" ; do + use "python_targets_${impl}" || continue + while read -r mod_dir ; do + cd "${S}/pym/${mod_dir}" || die + files=$(echo *.py) + if [ -z "${files}" ] || [ "${files}" = "*.py" ]; then + # __pycache__ directories contain no py files + continue + fi + dest_mod_dir=/usr/$(get_libdir)/${impl/_/.}/site-packages/${mod_dir} + dodir "${dest_mod_dir}" || die + relative_path=../../../lib/portage/pym/${mod_dir} + x=/${mod_dir} + while [ -n "${x}" ] ; do + relative_path=../${relative_path} + x=${x%/*} + done + for x in ${files} ; do + dosym "${relative_path}/${x}" \ + "${dest_mod_dir}/${x}" || die + done + done < <(cd "${S}"/pym || die ; find * -type d ! -path "portage/tests*") + case "${impl}" in + python*) + python=${impl/_/.} + python=${EPREFIX}/usr/bin/${python} + "${python}" -m compileall -q -f -d "${EPREFIX}${dest_mod_dir}" "${ED}${dest_mod_dir#/}" || die + "${python}" -OO -m compileall -q -f -d "${EPREFIX}${dest_mod_dir}" "${ED}${dest_mod_dir#/}" || die + ;; + pypy*) + python=${impl/_/.} + python=${EPREFIX}/usr/bin/${python/pypy/pypy-c} + "${python}" -m compileall -q -f -d "${EPREFIX}${dest_mod_dir}" "${ED}${dest_mod_dir#/}" || die + ;; + esac + done } pkg_preinst() { @@ -276,10 +332,6 @@ } pkg_postinst() { - # Compile all source files recursively. Any orphans - # will be identified and removed in postrm. - python_mod_optimize /usr/lib/portage/pym - if $WORLD_MIGRATION_UPGRADE && \ grep -q "^@" "${EROOT}/var/lib/portage/world"; then einfo "moving set references from the worldfile into world_sets" 1.1230 sys-apps/portage/ChangeLog file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.1230&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.1230&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?r1=1.1229&r2=1.1230 Index: ChangeLog =================================================================== RCS file: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v retrieving revision 1.1229 retrieving revision 1.1230 diff -u -r1.1229 -r1.1230 --- ChangeLog 20 Mar 2013 17:46:29 -0000 1.1229 +++ ChangeLog 21 Mar 2013 23:39:11 -0000 1.1230 @@ -1,6 +1,10 @@ # ChangeLog for sys-apps/portage # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1229 2013/03/20 17:46:29 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1230 2013/03/21 23:39:11 zmedico Exp $ + + 21 Mar 2013; Zac Medico portage-9999.ebuild: + Add experimental PYTHON_TARGETS support (instead of setting PYTHONPATH via + /etc/env.d). 20 Mar 2013; Jeroen Roovers portage-2.1.11.55.ebuild: Stable for HPPA (bug #462134).