Gentoo Development Guide
PYTHON-SINGLE-R1
Section: portage (5)Updated: May 2013
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-single-r1_pkg_setup
- Determine what the selected Python implementation is and set EPYTHON and PYTHON accordingly.
- python_fix_shebang <path>...
-
Replace the shebang in Python scripts with the current Python
implementation (EPYTHON). If a directory is passed, works recursively
on all Python scripts.
Only files having a 'python' shebang will be modified; other files will be skipped. If a script has a complete shebang matching the chosen interpreter version, it is left unmodified. If a script has a complete shebang matching other version, the command dies.
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.
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-python/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(+)?
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-r1SEE ALSO
ebuild(5)http://sources.gentoo.org/eclass/python-single-r1?view=log
Index
This document was created by man2html, using the manual pages.
Time: 03:25:02 GMT, May 19, 2013