Gentoo Development Guide

PYTHON-SINGLE-R1

Section: portage (5)
Updated: Oct 2014
Index Return to Main Contents
 

NAME

python-single-r1 - An eclass for Python packages not installed for multiple implementations.  

DESCRIPTION

An extension of the python-r1 eclass suite for packages which don't support being installed for multiple Python implementations. This mostly includes tools embedding Python.

This eclass extends the IUSE and REQUIRED_USE set by python-r1 to request correct PYTHON_SINGLE_TARGET. It also replaces PYTHON_USEDEP and PYTHON_DEPS with a more suitable form.

Please note that packages support multiple Python implementations (using python-r1 eclass) can not depend on packages not supporting them (using this eclass).

Please note that python-single-r1 will always inherit python-utils-r1 as well. Thus, all the functions defined there can be used in the packages using python-single-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_setup
Determine what the selected Python implementation is and set the Python build environment up for it.
python-single-r1_pkg_setup
Runs python_setup.
 

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 chosen 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.

This should be set before calling `inherit'.

Example:

PYTHON_REQ_USE="gdbm,ncurses(-)?"

It will cause the Python dependencies to look like:

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

The dependency string is conditional on PYTHON_SINGLE_TARGET.

Example use:

RDEPEND="${PYTHON_DEPS}
dev-foo/mydep"
DEPEND="${RDEPEND}"

Example value:

dev-lang/python-exec:=
python_single_target_python2_6? ( dev-lang/python:2.6[gdbm] )
python_single_target_python2_7? ( dev-lang/python:2.7[gdbm] )
PYTHON_USEDEP
This is an eclass-generated USE-dependency string which can be used to depend on another Python package being built for the same Python implementations.

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:

RDEPEND="dev-python/foo[${PYTHON_USEDEP}]"

Example value:

python_targets_python2_7(-)?,python_single_target_python2_7(+)?
PYTHON_REQUIRED_USE
This is an eclass-generated required-use expression which ensures the following: 1. Exactly one PYTHON_SINGLE_TARGET value has been enabled. 2. The selected PYTHON_SINGLE_TARGET value is enabled in PYTHON_TARGETS.

This expression should be utilized in an ebuild by including it in REQUIRED_USE, optionally behind a use flag.

Example use:

REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"

Example value:

python_single_target_python2_6? ( python_targets_python2_6 )
python_single_target_python2_7? ( python_targets_python2_7 )
^^ ( python_single_target_python2_6 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-single-r1  

SEE ALSO

ebuild(5)
http://sources.gentoo.org/eclass/python-single-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:08 GMT, October 25, 2014