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

Diff of /eclass/python.eclass

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

Revision 1.168 Revision 1.169
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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.168 2013/09/18 18:47:59 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.169 2014/02/06 05:34:07 vapier Exp $
4 4
5# @ECLASS: python.eclass 5# @ECLASS: python.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Gentoo Python Project <python@gentoo.org> 7# Gentoo Python Project <python@gentoo.org>
8# @BLURB: Eclass for Python packages 8# @BLURB: Eclass for Python packages
339 339
340_python_initial_sanity_checks() { 340_python_initial_sanity_checks() {
341 if [[ "$(declare -p PYTHON_SANITY_CHECKS_EXECUTED 2> /dev/null)" != "declare -- PYTHON_SANITY_CHECKS_EXECUTED="* || " ${FUNCNAME[@]:1} " =~ " "(python_set_active_version|python_pkg_setup)" " && -z "${PYTHON_SKIP_SANITY_CHECKS}" ]]; then 341 if [[ "$(declare -p PYTHON_SANITY_CHECKS_EXECUTED 2> /dev/null)" != "declare -- PYTHON_SANITY_CHECKS_EXECUTED="* || " ${FUNCNAME[@]:1} " =~ " "(python_set_active_version|python_pkg_setup)" " && -z "${PYTHON_SKIP_SANITY_CHECKS}" ]]; then
342 # Ensure that /usr/bin/python and /usr/bin/python-config are valid. 342 # Ensure that /usr/bin/python and /usr/bin/python-config are valid.
343 if [[ "$(readlink "${EPREFIX}/usr/bin/python")" != "python-wrapper" ]]; then 343 if [[ "$(readlink "${EPREFIX}/usr/bin/python")" != "python-wrapper" ]]; then
344 eerror "'${EPREFIX}/usr/bin/python' is not valid symlink." 344 eerror "'${EPREFIX}/usr/bin/python' is not a valid symlink."
345 eerror "Use \`eselect python set \${python_interpreter}\` to fix this problem." 345 eerror "Use \`eselect python set \${python_interpreter}\` to fix this problem."
346 die "'${EPREFIX}/usr/bin/python' is not valid symlink" 346 die "'${EPREFIX}/usr/bin/python' is not a valid symlink"
347 fi 347 fi
348 if [[ "$(<"${EPREFIX}/usr/bin/python-config")" != *"Gentoo python-config wrapper script"* ]]; then 348 if [[ "$(<"${EPREFIX}/usr/bin/python-config")" != *"Gentoo python-config wrapper script"* ]]; then
349 eerror "'${EPREFIX}/usr/bin/python-config' is not valid script" 349 eerror "'${EPREFIX}/usr/bin/python-config' is not a valid script"
350 eerror "Use \`eselect python set \${python_interpreter}\` to fix this problem." 350 eerror "Use \`eselect python set \${python_interpreter}\` to fix this problem."
351 die "'${EPREFIX}/usr/bin/python-config' is not valid script" 351 die "'${EPREFIX}/usr/bin/python-config' is not a valid script"
352 fi 352 fi
353 fi 353 fi
354} 354}
355 355
356_python_final_sanity_checks() { 356_python_final_sanity_checks() {
800 800
801 python_version="$("${EPREFIX}/usr/bin/python" -c 'from sys import version_info; print(".".join(str(x) for x in version_info[:2]))')" 801 python_version="$("${EPREFIX}/usr/bin/python" -c 'from sys import version_info; print(".".join(str(x) for x in version_info[:2]))')"
802 802
803 if has_version "=dev-lang/python-2*"; then 803 if has_version "=dev-lang/python-2*"; then
804 if [[ "$(readlink "${EPREFIX}/usr/bin/python2")" != "python2."* ]]; then 804 if [[ "$(readlink "${EPREFIX}/usr/bin/python2")" != "python2."* ]]; then
805 die "'${EPREFIX}/usr/bin/python2' is not valid symlink" 805 die "'${EPREFIX}/usr/bin/python2' is not a valid symlink"
806 fi 806 fi
807 807
808 python2_version="$("${EPREFIX}/usr/bin/python2" -c 'from sys import version_info; print(".".join(str(x) for x in version_info[:2]))')" 808 python2_version="$("${EPREFIX}/usr/bin/python2" -c 'from sys import version_info; print(".".join(str(x) for x in version_info[:2]))')"
809 809
810 support_python_major_version="0" 810 support_python_major_version="0"
823 fi 823 fi
824 fi 824 fi
825 825
826 if has_version "=dev-lang/python-3*"; then 826 if has_version "=dev-lang/python-3*"; then
827 if [[ "$(readlink "${EPREFIX}/usr/bin/python3")" != "python3."* ]]; then 827 if [[ "$(readlink "${EPREFIX}/usr/bin/python3")" != "python3."* ]]; then
828 die "'${EPREFIX}/usr/bin/python3' is not valid symlink" 828 die "'${EPREFIX}/usr/bin/python3' is not a valid symlink"
829 fi 829 fi
830 830
831 python3_version="$("${EPREFIX}/usr/bin/python3" -c 'from sys import version_info; print(".".join(str(x) for x in version_info[:2]))')" 831 python3_version="$("${EPREFIX}/usr/bin/python3" -c 'from sys import version_info; print(".".join(str(x) for x in version_info[:2]))')"
832 832
833 support_python_major_version="0" 833 support_python_major_version="0"

Legend:
Removed from v.1.168  
changed lines
  Added in v.1.169

  ViewVC Help
Powered by ViewVC 1.1.20