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

Diff of /eclass/python.eclass

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

Revision 1.60 Revision 1.61
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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/python.eclass,v 1.60 2009/08/05 18:31:30 arfrever Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.61 2009/08/07 00:43:16 arfrever Exp $
4 4
5# @ECLASS: python.eclass 5# @ECLASS: python.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# python@gentoo.org 7# python@gentoo.org
8# 8#
239 if has "${EAPI:-0}" 0 1; then 239 if has "${EAPI:-0}" 0 1; then
240 die "${FUNCNAME}(): --default-function option cannot be used in this EAPI" 240 die "${FUNCNAME}(): --default-function option cannot be used in this EAPI"
241 fi 241 fi
242 242
243 if [[ "${EBUILD_PHASE}" == "configure" ]]; then 243 if [[ "${EBUILD_PHASE}" == "configure" ]]; then
244 if has "${EAPI}" 2; then
244 python_default_function() { 245 python_default_function() {
245 econf 246 econf
246 } 247 }
248 else
249 python_default_function() {
250 nonfatal econf
251 }
252 fi
247 elif [[ "${EBUILD_PHASE}" == "compile" ]]; then 253 elif [[ "${EBUILD_PHASE}" == "compile" ]]; then
248 python_default_function() { 254 python_default_function() {
249 emake 255 emake
250 } 256 }
251 elif [[ "${EBUILD_PHASE}" == "test" ]]; then 257 elif [[ "${EBUILD_PHASE}" == "test" ]]; then
550 [[ -f "${myroot}/${f}" ]] && myfiles+=("${myroot}/${f}") 556 [[ -f "${myroot}/${f}" ]] && myfiles+=("${myroot}/${f}")
551 done 557 done
552 558
553 if ((${#myfiles[@]})); then 559 if ((${#myfiles[@]})); then
554 python${PYVER} ${myroot}/usr/$(get_libdir)/python${PYVER}/py_compile.py "${myfiles[@]}" 560 python${PYVER} ${myroot}/usr/$(get_libdir)/python${PYVER}/py_compile.py "${myfiles[@]}"
555 python${PYVER} -O ${myroot}/usr/$(get_libdir)/python${PYVER}/py_compile.py "${myfiles[@]}" 561 python${PYVER} -O ${myroot}/usr/$(get_libdir)/python${PYVER}/py_compile.py "${myfiles[@]}" 2> /dev/null
556 else 562 else
557 ewarn "No files to compile!" 563 ewarn "No files to compile!"
558 fi 564 fi
559} 565}
560 566
638 if ((${#site_packages_dirs[@]})); then 644 if ((${#site_packages_dirs[@]})); then
639 for dir in "${site_packages_dirs[@]}"; do 645 for dir in "${site_packages_dirs[@]}"; do
640 site_packages_absolute_dirs+=("${root}/$(python_get_sitedir)/${dir}") 646 site_packages_absolute_dirs+=("${root}/$(python_get_sitedir)/${dir}")
641 done 647 done
642 "$(PYTHON)" "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${site_packages_absolute_dirs[@]}" || return_code="1" 648 "$(PYTHON)" "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${site_packages_absolute_dirs[@]}" || return_code="1"
643 "$(PYTHON)" -O "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${site_packages_absolute_dirs[@]}" || return_code="1" 649 "$(PYTHON)" -O "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${site_packages_absolute_dirs[@]}" 2> /dev/null || return_code="1"
644 fi 650 fi
645 if ((${#site_packages_files[@]})); then 651 if ((${#site_packages_files[@]})); then
646 for file in "${site_packages_files[@]}"; do 652 for file in "${site_packages_files[@]}"; do
647 site_packages_absolute_files+=("${root}/$(python_get_sitedir)/${file}") 653 site_packages_absolute_files+=("${root}/$(python_get_sitedir)/${file}")
648 done 654 done
649 "$(PYTHON)" "${root}/$(python_get_libdir)/py_compile.py" "${site_packages_absolute_files[@]}" || return_code="1" 655 "$(PYTHON)" "${root}/$(python_get_libdir)/py_compile.py" "${site_packages_absolute_files[@]}" || return_code="1"
650 "$(PYTHON)" -O "${root}/$(python_get_libdir)/py_compile.py" "${site_packages_absolute_files[@]}" || return_code="1" 656 "$(PYTHON)" -O "${root}/$(python_get_libdir)/py_compile.py" "${site_packages_absolute_files[@]}" 2> /dev/null || return_code="1"
651 fi 657 fi
652 eend "${return_code}" 658 eend "${return_code}"
653 fi 659 fi
654 unset site_packages_absolute_dirs site_packages_absolute_files 660 unset site_packages_absolute_dirs site_packages_absolute_files
655 done 661 done
660 if ((${#other_dirs[@]})) || ((${#other_files[@]})); then 666 if ((${#other_dirs[@]})) || ((${#other_files[@]})); then
661 return_code="0" 667 return_code="0"
662 ebegin "Compilation and optimization of Python modules placed outside of site-packages directories for Python ${PYVER}..." 668 ebegin "Compilation and optimization of Python modules placed outside of site-packages directories for Python ${PYVER}..."
663 if ((${#other_dirs[@]})); then 669 if ((${#other_dirs[@]})); then
664 python${PYVER} "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${other_dirs[@]}" || return_code="1" 670 python${PYVER} "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${other_dirs[@]}" || return_code="1"
665 python${PYVER} -O "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${other_dirs[@]}" || return_code="1" 671 python${PYVER} -O "${root}/$(python_get_libdir)/compileall.py" "${options[@]}" "${other_dirs[@]}" 2> /dev/null || return_code="1"
666 fi 672 fi
667 if ((${#other_files[@]})); then 673 if ((${#other_files[@]})); then
668 python${PYVER} "${root}/$(python_get_libdir)/py_compile.py" "${other_files[@]}" || return_code="1" 674 python${PYVER} "${root}/$(python_get_libdir)/py_compile.py" "${other_files[@]}" || return_code="1"
669 python${PYVER} -O "${root}/$(python_get_libdir)/py_compile.py" "${other_files[@]}" || return_code="1" 675 python${PYVER} -O "${root}/$(python_get_libdir)/py_compile.py" "${other_files[@]}" 2> /dev/null || return_code="1"
670 fi 676 fi
671 eend "${return_code}" 677 eend "${return_code}"
672 fi 678 fi
673 else 679 else
674 local myroot mydirs=() myfiles=() myopts=() 680 local myroot mydirs=() myfiles=() myopts=()
720 python${PYVER} \ 726 python${PYVER} \
721 "${myroot}"/usr/$(get_libdir)/python${PYVER}/compileall.py \ 727 "${myroot}"/usr/$(get_libdir)/python${PYVER}/compileall.py \
722 "${myopts[@]}" "${mydirs[@]}" 728 "${myopts[@]}" "${mydirs[@]}"
723 python${PYVER} -O \ 729 python${PYVER} -O \
724 "${myroot}"/usr/$(get_libdir)/python${PYVER}/compileall.py \ 730 "${myroot}"/usr/$(get_libdir)/python${PYVER}/compileall.py \
725 "${myopts[@]}" "${mydirs[@]}" 731 "${myopts[@]}" "${mydirs[@]}" 2> /dev/null
726 fi 732 fi
727 733
728 if ((${#myfiles[@]})); then 734 if ((${#myfiles[@]})); then
729 python_mod_compile "${myfiles[@]}" 735 python_mod_compile "${myfiles[@]}"
730 fi 736 fi

Legend:
Removed from v.1.60  
changed lines
  Added in v.1.61

  ViewVC Help
Powered by ViewVC 1.1.20