/[gentoo-x86]/eclass/python-distutils-ng.eclass
Gentoo

Diff of /eclass/python-distutils-ng.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.11 Revision 1.15
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/python-distutils-ng.eclass,v 1.11 2012/04/03 19:21:45 nelchael Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/python-distutils-ng.eclass,v 1.15 2012/05/03 00:31:58 floppym Exp $
4 4
5# @ECLASS: python-distutils-ng 5# @ECLASS: python-distutils-ng
6# @MAINTAINER: 6# @MAINTAINER:
7# Python herd <python@gentoo.org> 7# Python herd <python@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
132# This will run the command_to_run in implementation-specific working directory. 132# This will run the command_to_run in implementation-specific working directory.
133_python-distutils-ng_run_for_impl() { 133_python-distutils-ng_run_for_impl() {
134 local impl="${1}" 134 local impl="${1}"
135 local command="${2}" 135 local command="${2}"
136 136
137 S="${WORKDIR}/impl_${impl}/${_PACKAGE_SPECIFIC_S}" 137 local S="${WORKDIR}/impl_${impl}/${_PACKAGE_SPECIFIC_S}"
138 PYTHON="$(_python-distutils-ng_get_binary_for_implementation "${impl}")" 138 PYTHON="$(_python-distutils-ng_get_binary_for_implementation "${impl}")"
139 EPYTHON="${impl/_/.}" 139 EPYTHON="${impl/_/.}"
140 140
141 einfo "Running ${command} in ${S} for ${impl}" 141 einfo "Running ${command} in ${S} for ${impl}"
142 142
302} 302}
303 303
304# Phase function: pkg_pretend 304# Phase function: pkg_pretend
305python-distutils-ng_pkg_pretend() { 305python-distutils-ng_pkg_pretend() {
306 if has "collision-protect" ${FEATURES}; then 306 if has "collision-protect" ${FEATURES}; then
307 eerror "Due to previous eclass compiling Python files outside of src_install" 307 ewarn "Due to previous eclass compiling Python files outside of src_install"
308 eerror "(and not recording resulting .pyc and .pyo files as owned by any package)" 308 ewarn "(and not recording resulting .pyc and .pyo files as owned by any package)"
309 eerror "merging this package with \"collision-protect\" in FEATURES will result" 309 ewarn "merging this package with \"collision-protect\" in FEATURES may result"
310 eerror "in an error, please switch to using \"protect-owned\" instead." 310 ewarn "in an error, please switch to using \"protect-owned\" instead."
311 die "\"collision-protect\" in FEATURES detected"
312 fi 311 fi
313} 312}
314 313
315# Phase function: src_prepare 314# Phase function: src_prepare
316python-distutils-ng_src_prepare() { 315python-distutils-ng_src_prepare() {
383 else 382 else
384 _python-distutils-ng_run_for_each_impl \ 383 _python-distutils-ng_run_for_each_impl \
385 _python-distutils-ng_default_distutils_install 384 _python-distutils-ng_default_distutils_install
386 fi 385 fi
387 386
388 S="${WORKDIR}/${_PACKAGE_SPECIFIC_S}"
389 if type python_install_all &> /dev/null; then 387 if type python_install_all &> /dev/null; then
390 einfo "Running python_install_all in ${S} for all" 388 einfo "Running python_install_all in ${S} for all"
389 pushd "${S}" &> /dev/null
391 python_install_all 390 python_install_all
391 popd &> /dev/null
392 fi 392 fi
393 393
394 for impl in ${PYTHON_COMPAT}; do 394 for impl in ${PYTHON_COMPAT}; do
395 [[ "${PYTHON_DISABLE_COMPILATION}" = "yes" ]] && continue 395 [[ "${PYTHON_DISABLE_COMPILATION}" = "yes" ]] && continue
396 use "python_targets_${impl}" ${PYTHON_COMPAT} || continue 396 use "python_targets_${impl}" ${PYTHON_COMPAT} || continue
397 397
398 PYTHON="$(_python-distutils-ng_get_binary_for_implementation "${impl}")" 398 PYTHON="$(_python-distutils-ng_get_binary_for_implementation "${impl}")"
399 for accessible_path in $(${PYTHON} -c 'import sys; print " ".join(sys.path)'); do 399 for accessible_path in $(${PYTHON} -c 'import sys; print(" ".join(sys.path))'); do
400 [[ -d "${D}/${accessible_path}" ]] || continue 400 [[ -d "${D}/${accessible_path}" ]] || continue
401 401
402 _python-distutils-ng_has_compileall "${impl}" || continue 402 _python-distutils-ng_has_compileall "${impl}" || continue
403 ebegin "Compiling ${accessible_path} for ${impl}" 403 ebegin "Compiling ${accessible_path} for ${impl}"
404 ${PYTHON} \ 404 ${PYTHON} \

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.20