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

Diff of /eclass/python.eclass

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

Revision 1.66 Revision 1.67
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.66 2009/08/28 16:08:51 arfrever Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.67 2009/08/29 02:15:24 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#
231 ;; 231 ;;
232 -s|--separate-build-dirs) 232 -s|--separate-build-dirs)
233 separate_build_dirs="1" 233 separate_build_dirs="1"
234 ;; 234 ;;
235 -*) 235 -*)
236 die "${FUNCNAME}(): Unrecognized option $1" 236 die "${FUNCNAME}(): Unrecognized option '$1'"
237 ;; 237 ;;
238 *) 238 *)
239 break 239 break
240 ;; 240 ;;
241 esac 241 esac
246 if [[ "$#" -eq "0" ]]; then 246 if [[ "$#" -eq "0" ]]; then
247 die "${FUNCNAME}(): Missing function name" 247 die "${FUNCNAME}(): Missing function name"
248 fi 248 fi
249 function="$1" 249 function="$1"
250 shift 250 shift
251
252 if [[ -z "$(type -t "${function}")" ]]; then
253 die "${FUNCNAME}(): '${function}' function isn't defined"
254 fi
251 else 255 else
252 if [[ "$#" -ne "0" ]]; then 256 if [[ "$#" -ne "0" ]]; then
253 die "${FUNCNAME}(): --default-function option and function name cannot be specified simultaneously" 257 die "${FUNCNAME}(): '--default-function' option and function name cannot be specified simultaneously"
254 fi 258 fi
255 if has "${EAPI:-0}" 0 1; then 259 if has "${EAPI:-0}" 0 1; then
256 die "${FUNCNAME}(): --default-function option cannot be used in this EAPI" 260 die "${FUNCNAME}(): '--default-function' option cannot be used in this EAPI"
257 fi 261 fi
258 262
259 if [[ "${EBUILD_PHASE}" == "configure" ]]; then 263 if [[ "${EBUILD_PHASE}" == "configure" ]]; then
260 if has "${EAPI}" 2; then 264 if has "${EAPI}" 2; then
261 python_default_function() { 265 python_default_function() {
390 394
391# @FUNCTION: python_pkg_setup 395# @FUNCTION: python_pkg_setup
392# @DESCRIPTION: 396# @DESCRIPTION:
393# Makes sure PYTHON_USE_WITH or PYTHON_USE_WITH_OR listed use flags 397# Makes sure PYTHON_USE_WITH or PYTHON_USE_WITH_OR listed use flags
394# are respected. Only exported if one of those variables is set. 398# are respected. Only exported if one of those variables is set.
395if ! has ${EAPI:-0} 0 1 && [[ -n ${PYTHON_USE_WITH} || -n ${PYTHON_USE_WITH_OR} ]]; then 399if ! has "${EAPI:-0}" 0 1 && [[ -n ${PYTHON_USE_WITH} || -n ${PYTHON_USE_WITH_OR} ]]; then
396 python_pkg_setup_fail() { 400 python_pkg_setup_fail() {
397 eerror "${1}" 401 eerror "${1}"
398 die "${1}" 402 die "${1}"
399 } 403 }
400 404
440 if [[ ${PYTHON_USE_WITH_OPT} ]]; then 444 if [[ ${PYTHON_USE_WITH_OPT} ]]; then
441 PYTHON_USE_WITH_ATOM="${PYTHON_USE_WITH_OPT}? ( ${PYTHON_USE_WITH_ATOM} )" 445 PYTHON_USE_WITH_ATOM="${PYTHON_USE_WITH_OPT}? ( ${PYTHON_USE_WITH_ATOM} )"
442 fi 446 fi
443 DEPEND="${PYTHON_USE_WITH_ATOM}" 447 DEPEND="${PYTHON_USE_WITH_ATOM}"
444 RDEPEND="${PYTHON_USE_WITH_ATOM}" 448 RDEPEND="${PYTHON_USE_WITH_ATOM}"
449fi
450
451# @ECLASS-VARIABLE: PYTHON_DEFINE_DEFAULT_FUNCTIONS
452# @DESCRIPTION:
453# Set this to define default functions for the following ebuild phases:
454# src_prepare, src_configure, src_compile, src_test, src_install.
455if ! has "${EAPI:-0}" 0 1 && [[ -n "${PYTHON_DEFINE_DEFAULT_FUNCTIONS}" ]]; then
456 python_src_prepare() {
457 python_copy_sources
458 }
459
460 for python_default_function in src_configure src_compile src_test src_install; do
461 eval "python_${python_default_function}() { python_execute_function -d -s; }"
462 done
463 unset python_default_function
464
465 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
445fi 466fi
446 467
447# @FUNCTION: python_disable_pyc 468# @FUNCTION: python_disable_pyc
448# @DESCRIPTION: 469# @DESCRIPTION:
449# Tell Python not to automatically recompile modules to .pyc/.pyo 470# Tell Python not to automatically recompile modules to .pyc/.pyo

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.67

  ViewVC Help
Powered by ViewVC 1.1.20