Gentoo Development Guide

PYTHON-DISTUTILS-NG

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

NAME

python-distutils-ng - Install Python packages using distutils.  

DESCRIPTION

The Python eclass is designed to allow an easier installation of Python packages and their incorporation into the Gentoo Linux system.

This eclass provides functions for following phases:
 - src_prepare - you can define python_prepare_all function that will be run
   before creating implementation-specific directory and python_prepare
   function that will be run for each implementation
 - src_configure - you can define python_configure function that will be run
   for each implementation
 - src_compile - you can define python_compile function that will be run for
   each implementation, default function will run `setup.py build'
 - src_test - you can define python_test function that will be run for each
   implementation
 - src_install - you can define python_install function that will be run for
   each implementation and python_install_all that will be run in original
   directory (so it will not contain any implementation-specific files)  

FUNCTIONS

_python-distutils-ng_get_binary_for_implementation implementation
This function returns full path for Python binary for given implementation.

Binary returned by this function should be used instead of simply calling `python'.

Return value: Full path to Python binary for given implementation.

_python-distutils-ng_run_for_impl implementation command_to_run
Run command_to_run using specified Python implementation.

This will run the command_to_run in implementation-specific working directory.

_python-distutils-ng_run_for_each_impl command_to_run
Run command_to_run for all enabled Python implementations.

See also _python-distutils-ng_run_for_impl

_python-distutils-ng_default_distutils_compile
Default src_compile for distutils-based packages.
_python-distutils-ng_default_distutils_install
Default src_install for distutils-based packages.
python-distutils-ng_rewrite_hashbang script_file_name implementation
Rewrite #! line in named script, dies if #! line is not for Python or missing.
python-distutils-ng_redoscript script_file_path [destination_directory]
Reinstall script installed already by setup.py. This works by first moving the script to ${T} directory and later running python-distutils-ng_doscript on it. script_file_path has to be a full path relative to ${D}. Warning: this function can be run automatically by the eclass in src_install, see python-distutils-ng_src_install and PYTHON_DISABLE_SCRIPT_REDOS variable.
python-distutils-ng_doscript script_file_name [destination_directory]
Install given script file in destination directory (for default value check python-distutils-ng_newscript) for all enabled implementations using original script name as a base name.

See also python-distutils-ng_newscript for more details.

python-distutils-ng_newscript script_file_name new_file_name [destination_directory]
Install given script file in destination directory for all enabled implementations using new_file_name as a base name.

Destination directory defaults to /usr/bin.

If only one Python implementation is enabled the script will be installed as-is. Otherwise each script copy will have the name mangled to "new_file_name-IMPLEMENTATION". For every installed script new hash-bang line will be inserted to reference specific Python interpreter.

In case of multiple implementations there will be also a symlink with name equal to new_file_name that will be a symlink to default implementation, which defaults to value of PYTHON_DEFAULT_IMPLEMENTATION, if not specified the function will pick default implementation: it will the be first enabled one from the following list:
  python2_7, python2_6, python2_5, python3_2, python3_1, pypy1_8, pypy1_7, jython2_5

 

ECLASS VARIABLES

PYTHON_COMPAT
This variable contains a space separated list of implementations (see above) a package is compatible to. It must be set before the `inherit' call. The default is to enable all implementations.
PYTHON_OPTIONAL
Set the value to "yes" to make the dependency on a Python interpreter optional.
PYTHON_DISABLE_COMPILATION
Set the value to "yes" to skip compilation and/or optimization of Python modules.
PYTHON_DISABLE_SCRIPT_REDOS
Set to any value to disable automatic reinstallation of scripts in bin directories. See python-distutils-ng_src_install function.
PYTHON_USE
Comma-separated list of useflags needed for all(!) allowed implementations. This is directly substituted into one or more of dev-lang/python[${PYTHON_USE}], dev-python/pypy[${PYTHON_USE}] and dev-java/jython[${PYTHON_USE}].
example 1: PYTHON_USE="xml,sqlite"
example 2: PYTHON_USE="xml?,threads?,-foo"
 

AUTHORS

Author: Krzysztof Pawlik <nelchael@gentoo.org>
 

MAINTAINERS

Python herd <python@gentoo.org>
 

REPORTING BUGS

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

FILES

/usr/portage/eclass/python-distutils-ng  

SEE ALSO

ebuild(5)
http://sources.gentoo.org/eclass/python-distutils-ng?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:06 GMT, September 29, 2013