Gentoo Development Guide

PYTHON-ANY-R1

Section: portage (5)
Updated: Jun 2013
Index Return to Main Contents
 

NAME

python-any-r1 - An eclass for packages having build-time dependency on Python.  

DESCRIPTION

A minimal eclass for packages which need any Python interpreter installed without a need for explicit choice and invariability. This usually involves packages requiring Python at build-time but having no other relevance to it.

This eclass provides a minimal PYTHON_DEPS variable with a dependency string on any of the supported Python implementations. It also exports pkg_setup() which finds the best supported implementation and sets it as the active one.

Optionally, you can define a python_check_deps() function. It will be called by the eclass with EPYTHON set to each matching Python implementation and it is expected to check whether the implementation fulfills the package requirements. You can use the locally exported PYTHON_USEDEP to check USE-dependencies of relevant packages. It should return a true value (0) if the Python implementation fulfills the requirements, a false value (non-zero) otherwise.

Please note that python-any-r1 will always inherit python-utils-r1 as well. Thus, all the functions defined there can be used in the packages using python-any-r1, and there is no need ever to inherit both.

For more information, please see the python-r1 Developer's Guide: http://www.gentoo.org/proj/en/Python/python-r1/dev-guide.xml  

FUNCTIONS

python-any-r1_pkg_setup
Determine what the best installed (and supported) Python implementation is and set EPYTHON and PYTHON accordingly.
 

ECLASS VARIABLES

PYTHON_COMPAT (REQUIRED)
This variable contains a list of Python implementations the package supports. It must be set before the `inherit' call. It has to be an array.

Example:

PYTHON_COMPAT=( python{2_5,2_6,2_7} )
PYTHON_REQ_USE
The list of USEflags required to be enabled on the Python implementations, formed as a USE-dependency string. It should be valid for all implementations in PYTHON_COMPAT, so it may be necessary to use USE defaults.

Example:

PYTHON_REQ_USE="gdbm,ncurses(-)?"

It will cause the Python dependencies to look like:

|| ( dev-lang/python:X.Y[gdbm,ncurses(-)?] ... )
PYTHON_DEPS
This is an eclass-generated Python dependency string for all implementations listed in PYTHON_COMPAT.

Any of the supported interpreters will satisfy the dependency.

Example use:

DEPEND="${RDEPEND}
${PYTHON_DEPS}"

Example value:

|| ( dev-lang/python:2.7[gdbm]
        dev-lang/python:2.6[gdbm] )
PYTHON_USEDEP
An eclass-generated USE-dependency string for the currently tested implementation. It is set locally for python_check_deps() call.

The generate USE-flag list is compatible with packages using python-r1, python-single-r1 and python-distutils-ng eclasses. It must not be used on packages using python.eclass.

Example use:

python_check_deps() {
has_version "dev-python/foo[${PYTHON_USEDEP}]"
}

Example value:

python_targets_python2_7(-)?,python_single_target_python2_7(+)?
 

AUTHORS

Author: Michał Górny <mgorny@gentoo.org>
Based on work of: Krzysztof Pawlik <nelchael@gentoo.org>
 

MAINTAINERS

Python team <python@gentoo.org>
 

REPORTING BUGS

Please report bugs via http://bugs.gentoo.org/  

FILES

/usr/portage/eclass/python-any-r1  

SEE ALSO

ebuild(5)
http://sources.gentoo.org/eclass/python-any-r1?view=log


 

Index

NAME
DESCRIPTION
FUNCTIONS
ECLASS VARIABLES
AUTHORS
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:25:01 GMT, June 19, 2013