1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # @ECLASS: distutils-r1.eclass
7 # Python team <python@gentoo.org>
9 # Author: Michał Górny <mgorny@gentoo.org>
10 # Based on the work of: Krzysztof Pawlik <nelchael@gentoo.org>
11 # @BLURB: A simple eclass to build Python packages using distutils.
13 # A simple eclass providing functions to build Python packages using
14 # the distutils build system. It exports phase functions for all
15 # the src_* phases. Each of the phases runs two pseudo-phases:
16 # python_..._all() (e.g. python_prepare_all()) once in ${S}, then
17 # python_...() (e.g. python_prepare()) for each implementation
18 # (see: python_foreach_impl() in python-r1).
20 # In distutils-r1_src_prepare(), the 'all' function is run before
21 # per-implementation ones (because it creates the implementations),
22 # per-implementation functions are run in a random order.
24 # In remaining phase functions, the per-implementation functions are run
25 # before the 'all' one, and they are ordered from the least to the most
26 # preferred implementation (so that 'better' files overwrite 'worse'
29 # If the ebuild doesn't specify a particular pseudo-phase function,
30 # the default one will be used (distutils-r1_...). Defaults are provided
31 # for all per-implementation pseudo-phases, python_prepare_all()
32 # and python_install_all(); whenever writing your own pseudo-phase
33 # functions, you should consider calling the defaults (and especially
34 # distutils-r1_python_prepare_all).
36 # Please note that distutils-r1 sets RDEPEND and DEPEND unconditionally
39 # Also, please note that distutils-r1 will always inherit python-r1
40 # as well. Thus, all the variables defined and documented there are
41 # relevant to the packages using distutils-r1.
43 # For more information, please see the wiki:
44 # https://wiki.gentoo.org/wiki/Project:Python/distutils-r1
48 die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
53 die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
57 # @ECLASS-VARIABLE: DISTUTILS_OPTIONAL
60 # If set to a non-null value, distutils part in the ebuild will
61 # be considered optional. No dependencies will be added and no phase
62 # functions will be exported.
64 # If you enable DISTUTILS_OPTIONAL, you have to set proper dependencies
65 # for your package (using ${PYTHON_DEPS}) and to either call
66 # distutils-r1 default phase functions or call the build system
69 # @ECLASS-VARIABLE: DISTUTILS_SINGLE_IMPL
72 # If set to a non-null value, the ebuild will support setting a single
73 # Python implementation only. It will effectively replace the python-r1
74 # eclass inherit with python-single-r1.
76 # Note that inheriting python-single-r1 will cause pkg_setup()
77 # to be exported. It must be run in order for the eclass functions
78 # to function properly.
80 if [[ ! ${_DISTUTILS_R1} ]]; then
82 inherit eutils toolchain-funcs
84 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
85 inherit multiprocessing python-r1
87 inherit python-single-r1
92 if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
93 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
96 if [[ ! ${_DISTUTILS_R1} ]]; then
98 if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
99 RDEPEND=${PYTHON_DEPS}
100 DEPEND=${PYTHON_DEPS}
101 REQUIRED_USE=${PYTHON_REQUIRED_USE}
104 # @ECLASS-VARIABLE: PATCHES
107 # An array containing patches to be applied to the sources before
110 # If unset, no custom patches will be applied.
112 # Please note, however, that at some point the eclass may apply
113 # additional distutils patches/quirks independently of this variable.
117 # PATCHES=( "${FILESDIR}"/${P}-make-gentoo-happy.patch )
120 # @ECLASS-VARIABLE: DOCS
123 # An array containing documents installed using dodoc. The files listed
124 # there must exist in the directory from which
125 # distutils-r1_python_install_all() is run (${S} by default).
127 # If unset, the function will instead look up files matching default
128 # filename pattern list (from the Package Manager Specification),
129 # and install those found.
133 # DOCS=( NEWS README )
136 # @ECLASS-VARIABLE: HTML_DOCS
139 # An array containing documents installed using dohtml. The files
140 # and directories listed there must exist in the directory from which
141 # distutils-r1_python_install_all() is run (${S} by default).
143 # If unset, no HTML docs will be installed.
147 # HTML_DOCS=( doc/html/. )
150 # @ECLASS-VARIABLE: EXAMPLES
153 # An array containing examples installed into 'examples' doc
154 # subdirectory. The files and directories listed there must exist
155 # in the directory from which distutils-r1_python_install_all() is run
158 # The 'examples' subdirectory will be marked not to be compressed
161 # If unset, no examples will be installed.
165 # EXAMPLES=( examples/. demos/. )
168 # @ECLASS-VARIABLE: DISTUTILS_IN_SOURCE_BUILD
171 # If set to a non-null value, in-source builds will be enabled.
172 # If unset, the default is to use in-source builds when python_prepare()
173 # is declared, and out-of-source builds otherwise.
175 # If in-source builds are used, the eclass will create a copy of package
176 # sources for each Python implementation in python_prepare_all(),
177 # and work on that copy afterwards.
179 # If out-of-source builds are used, the eclass will instead work
180 # on the sources directly, prepending setup.py arguments with
181 # 'build --build-base ${BUILD_DIR}' to enforce keeping & using built
182 # files in the specific root.
184 # @ECLASS-VARIABLE: DISTUTILS_ALL_SUBPHASE_IMPLS
187 # An array of patterns specifying which implementations can be used
188 # for *_all() sub-phase functions. If undefined, defaults to '*'
189 # (allowing any implementation). If multiple values are specified,
190 # implementations matching any of the patterns will be accepted.
192 # If the restriction needs to apply conditionally to a USE flag,
193 # the variable should be set conditionally as well (e.g. in an early
194 # phase function or other convenient location).
196 # Please remember to add a matching || block to REQUIRED_USE,
197 # to ensure that at least one implementation matching the patterns will
202 # REQUIRED_USE="doc? ( || ( $(python_gen_useflags 'python2*') ) )"
205 # use doc && DISTUTILS_ALL_SUBPHASE_IMPLS=( 'python2*' )
209 # @ECLASS-VARIABLE: mydistutilsargs
212 # An array containing options to be passed to setup.py.
216 # python_configure_all() {
217 # mydistutilsargs=( --enable-my-hidden-option )
221 # @FUNCTION: esetup.py
222 # @USAGE: [<args>...]
224 # Run setup.py using currently selected Python interpreter
225 # (if ${PYTHON} is set; fallback 'python' otherwise).
227 # setup.py will be passed the following, in order:
228 # 1. ${mydistutilsargs[@]}
229 # 2. additional arguments passed to the esetup.py function.
231 # Please note that setup.py will respect defaults (unless overriden
232 # via command-line options) from setup.cfg that is created
233 # in distutils-r1_python_compile and in distutils-r1_python_install.
235 # This command dies on failure.
237 debug-print-function ${FUNCNAME} "${@}"
239 set -- "${PYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}"
245 # @FUNCTION: distutils_install_for_testing
246 # @USAGE: [<args>...]
248 # Install the package into a temporary location for running tests.
249 # Update PYTHONPATH appropriately and set TEST_DIR to the test
250 # installation root. The Python packages will be installed in 'lib'
251 # subdir, and scripts in 'scripts' subdir (like in BUILD_DIR).
253 # Please note that this function should be only used if package uses
254 # namespaces (and therefore proper install needs to be done to enforce
255 # PYTHONPATH) or tests rely on the results of install command.
256 # For most of the packages, tests built in BUILD_DIR are good enough.
257 distutils_install_for_testing() {
258 debug-print-function ${FUNCNAME} "${@}"
261 # 1) because of namespaces, we can't use 'install --root',
262 # 2) 'install --home' is terribly broken on pypy, so we need
263 # to override --install-lib and --install-scripts,
264 # 3) non-root 'install' complains about PYTHONPATH and missing dirs,
265 # so we need to set it properly and mkdir them,
266 # 4) it runs a bunch of commands which write random files to cwd,
267 # in order to avoid that, we add the necessary path overrides
268 # in _distutils-r1_create_setup_cfg.
270 TEST_DIR=${BUILD_DIR}/test
271 local bindir=${TEST_DIR}/scripts
272 local libdir=${TEST_DIR}/lib
273 PYTHONPATH=${libdir}:${PYTHONPATH}
278 --install-lib="${libdir}"
279 --install-scripts="${bindir}"
282 mkdir -p "${libdir}" || die
283 esetup.py "${add_args[@]}" "${@}"
286 # @FUNCTION: _distutils-r1_disable_ez_setup
289 # Stub out ez_setup.py and distribute_setup.py to prevent packages
290 # from trying to download a local copy of setuptools.
291 _distutils-r1_disable_ez_setup() {
292 local stub="def use_setuptools(*args, **kwargs): pass"
293 if [[ -f ez_setup.py ]]; then
294 echo "${stub}" > ez_setup.py || die
296 if [[ -f distribute_setup.py ]]; then
297 echo "${stub}" > distribute_setup.py || die
301 # @FUNCTION: distutils-r1_python_prepare_all
303 # The default python_prepare_all(). It applies the patches from PATCHES
304 # array, then user patches and finally calls python_copy_sources to
305 # create copies of resulting sources for each Python implementation.
307 # At some point in the future, it may also apply eclass-specific
308 # distutils patches and/or quirks.
309 distutils-r1_python_prepare_all() {
310 debug-print-function ${FUNCNAME} "${@}"
312 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
316 # by default, use in-source build if python_prepare() is used
317 if [[ ! ${DISTUTILS_IN_SOURCE_BUILD+1} ]]; then
318 if declare -f python_prepare >/dev/null; then
319 DISTUTILS_IN_SOURCE_BUILD=1
323 _distutils-r1_disable_ez_setup
325 if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
327 # create source copies for each implementation
331 _DISTUTILS_DEFAULT_CALLED=1
334 # @FUNCTION: distutils-r1_python_prepare
336 # The default python_prepare(). A no-op.
337 distutils-r1_python_prepare() {
338 debug-print-function ${FUNCNAME} "${@}"
343 # @FUNCTION: distutils-r1_python_configure
345 # The default python_configure(). A no-op.
346 distutils-r1_python_configure() {
347 debug-print-function ${FUNCNAME} "${@}"
352 # @FUNCTION: _distutils-r1_create_setup_cfg
355 # Create implementation-specific configuration file for distutils,
356 # setting proper build-dir (and install-dir) paths.
357 _distutils-r1_create_setup_cfg() {
358 cat > "${HOME}"/.pydistutils.cfg <<-_EOF_ || die
360 build-base = ${BUILD_DIR}
362 # using a single directory for them helps us export
363 # ${PYTHONPATH} and ebuilds find the sources independently
364 # of whether the package installs extensions or not
366 # note: due to some packages (wxpython) relying on separate
367 # platlib & purelib dirs, we do not set --build-lib (which
368 # can not be overriden with --build-*lib)
369 build-platlib = %(build-base)s/lib
370 build-purelib = %(build-base)s/lib
372 # make the ebuild writer lives easier
373 build-scripts = %(build-base)s/scripts
376 egg-base = ${BUILD_DIR}
378 # this is needed by distutils_install_for_testing since
379 # setuptools like to create .egg files for install --home.
381 dist-dir = ${BUILD_DIR}/dist
384 # we can't refer to ${D} before src_install()
385 if [[ ${EBUILD_PHASE} == install ]]; then
386 cat >> "${HOME}"/.pydistutils.cfg <<-_EOF_ || die
388 # installation paths -- allow calling extra install targets
389 # without the default 'install'
396 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
397 cat >> "${HOME}"/.pydistutils.cfg <<-_EOF_ || die
398 install-scripts = $(python_get_scriptdir)
404 # @FUNCTION: _distutils-r1_copy_egg_info
407 # Copy egg-info files to the ${BUILD_DIR} (that's going to become
408 # egg-base in esetup.py). This way, we respect whatever's in upstream
410 _distutils-r1_copy_egg_info() {
411 mkdir -p "${BUILD_DIR}" || die
412 # stupid freebsd can't do 'cp -t ${BUILD_DIR} {} +'
413 find -name '*.egg-info' -type d -exec cp -pr {} "${BUILD_DIR}"/ ';' || die
416 # @FUNCTION: distutils-r1_python_compile
417 # @USAGE: [additional-args...]
419 # The default python_compile(). Runs 'esetup.py build'. Any parameters
420 # passed to this function will be appended to setup.py invocation,
421 # i.e. passed as options to the 'build' command.
423 # This phase also sets up initial setup.cfg with build directories
424 # and copies upstream egg-info files if supplied.
425 distutils-r1_python_compile() {
426 debug-print-function ${FUNCNAME} "${@}"
428 _distutils-r1_create_setup_cfg
429 _distutils-r1_copy_egg_info
431 esetup.py build "${@}"
434 # @FUNCTION: _distutils-r1_wrap_scripts
435 # @USAGE: <path> <bindir>
438 # Moves and wraps all installed scripts/executables as necessary.
439 _distutils-r1_wrap_scripts() {
440 debug-print-function ${FUNCNAME} "${@}"
442 [[ ${#} -eq 2 ]] || die "usage: ${FUNCNAME} <path> <bindir>"
446 local PYTHON_SCRIPTDIR
447 python_export PYTHON_SCRIPTDIR
449 local f python_files=() non_python_files=()
451 if [[ -d ${path}${PYTHON_SCRIPTDIR} ]]; then
452 for f in "${path}${PYTHON_SCRIPTDIR}"/*; do
453 [[ -d ${f} ]] && die "Unexpected directory: ${f}"
454 debug-print "${FUNCNAME}: found executable at ${f#${path}/}"
457 read -r shebang < "${f}"
458 if [[ ${shebang} == '#!'*${EPYTHON}* ]]; then
459 debug-print "${FUNCNAME}: matching shebang: ${shebang}"
460 python_files+=( "${f}" )
462 debug-print "${FUNCNAME}: non-matching shebang: ${shebang}"
463 non_python_files+=( "${f}" )
466 mkdir -p "${path}${bindir}" || die
469 for f in "${python_files[@]}"; do
470 local basename=${f##*/}
472 debug-print "${FUNCNAME}: installing wrapper at ${bindir}/${basename}"
473 _python_ln_rel "${path}${EPREFIX}"/usr/lib/python-exec/python-exec2 \
474 "${path}${bindir}/${basename}" || die
477 for f in "${non_python_files[@]}"; do
478 local basename=${f##*/}
480 debug-print "${FUNCNAME}: moving ${f#${path}/} to ${bindir}/${basename}"
481 mv "${f}" "${path}${bindir}/${basename}" || die
486 # @FUNCTION: distutils-r1_python_install
487 # @USAGE: [additional-args...]
489 # The default python_install(). Runs 'esetup.py install', doing
490 # intermediate root install and handling script wrapping afterwards.
491 # Any parameters passed to this function will be appended
492 # to the setup.py invocation (i.e. as options to the 'install' command).
494 # This phase updates the setup.cfg file with install directories.
495 distutils-r1_python_install() {
496 debug-print-function ${FUNCNAME} "${@}"
498 local args=( "${@}" )
500 # enable compilation for the install phase.
501 local -x PYTHONDONTWRITEBYTECODE=
503 # re-create setup.cfg with install paths
504 _distutils-r1_create_setup_cfg
506 # python likes to compile any module it sees, which triggers sandbox
507 # failures if some packages haven't compiled their modules yet.
508 addpredict "${EPREFIX}/usr/$(get_libdir)/${EPYTHON}"
509 addpredict /usr/lib/portage/pym
510 addpredict /usr/local # bug 498232
512 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
513 # user may override --install-scripts
514 # note: this is poor but distutils argv parsing is dumb
515 local mydistutilsargs=( "${mydistutilsargs[@]}" )
516 local scriptdir=${EPREFIX}/usr/bin
518 # construct a list of mydistutilsargs[0] args[0] args[1]...
520 [[ ${mydistutilsargs[@]} ]] && eval arg_vars+=(
521 'mydistutilsargs['{0..$(( ${#mydistutilsargs[@]} - 1 ))}']'
523 [[ ${args[@]} ]] && eval arg_vars+=(
524 'args['{0..$(( ${#args[@]} - 1 ))}']'
527 set -- "${arg_vars[@]}"
535 scriptdir=${a#--install-scripts=}
540 unset "${arg_var}" "${1}"
547 local root=${D}/_${EPYTHON}
548 [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D}
550 esetup.py install --root="${root}" "${args[@]}"
552 local forbidden_package_names=( examples test tests )
554 for p in "${forbidden_package_names[@]}"; do
555 if [[ -d ${root}$(python_get_sitedir)/${p} ]]; then
556 die "Package installs '${p}' package which is forbidden and likely a bug in the build system."
559 if [[ -d ${root}/usr/$(get_libdir)/pypy/share ]]; then
560 eqawarn "Package installs 'share' in PyPy prefix, see bug #465546."
563 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
564 _distutils-r1_wrap_scripts "${root}" "${scriptdir}"
565 multibuild_merge_root "${root}" "${D}"
569 # @FUNCTION: distutils-r1_python_install_all
571 # The default python_install_all(). It installs the documentation.
572 distutils-r1_python_install_all() {
573 debug-print-function ${FUNCNAME} "${@}"
577 if declare -p EXAMPLES &>/dev/null; then
578 local INSDESTTREE=/usr/share/doc/${PF}/examples
579 doins -r "${EXAMPLES[@]}"
580 docompress -x "${INSDESTTREE}"
583 _DISTUTILS_DEFAULT_CALLED=1
586 # @FUNCTION: distutils-r1_run_phase
587 # @USAGE: [<argv>...]
590 # Run the given command.
592 # If out-of-source builds are used, the phase function is run in source
593 # directory, with BUILD_DIR pointing at the build directory
594 # and PYTHONPATH having an entry for the module build directory.
596 # If in-source builds are used, the command is executed in the directory
597 # holding the per-implementation copy of sources. BUILD_DIR points
598 # to the 'build' subdirectory.
599 distutils-r1_run_phase() {
600 debug-print-function ${FUNCNAME} "${@}"
602 if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
603 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
604 cd "${BUILD_DIR}" || die
606 local BUILD_DIR=${BUILD_DIR}/build
608 local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
611 # using PYTHONPATH when the ${BUILD_DIR}/lib is not created yet might lead to
612 # problems in setup.py scripts that try to import modules/packages from that path
613 # during the build process (Python at startup evaluates PYTHONPATH, if the dir is
614 # not valid then associates a NullImporter object to ${BUILD_DIR}/lib storing it
615 # in the sys.path_importer_cache)
616 mkdir -p "${BUILD_DIR}/lib" || die
618 # We need separate home for each implementation, for .pydistutils.cfg.
619 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
620 local -x HOME=${HOME}/${EPYTHON}
621 mkdir -p "${HOME}" || die
624 # Set up build environment, bug #513664.
625 local -x AR=${AR} CC=${CC} CPP=${CPP} CXX=${CXX}
626 tc-export AR CC CPP CXX
628 # How to build Python modules in different worlds...
631 # provided by haubi, 2014-07-08
632 *-aix*) ldopts='-shared -Wl,-berok';; # good enough
633 # provided by grobian, 2014-06-22, bug #513664 c7
634 *-darwin*) ldopts='-bundle -undefined dynamic_lookup';;
635 *) ldopts='-shared';;
638 local -x LDSHARED="${CC} ${ldopts}" LDCXXSHARED="${CXX} ${ldopts}"
642 cd "${_DISTUTILS_INITIAL_CWD}" || die
645 # @FUNCTION: _distutils-r1_run_common_phase
646 # @USAGE: [<argv>...]
649 # Run the given command, restoring the state for a most preferred Python
650 # implementation matching DISTUTILS_ALL_SUBPHASE_IMPLS.
652 # If in-source build is used, the command will be run in the copy
653 # of sources made for the selected Python interpreter.
654 _distutils-r1_run_common_phase() {
655 local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR}
657 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
658 local best_impl patterns=( "${DISTUTILS_ALL_SUBPHASE_IMPLS[@]-*}" )
659 _distutils_try_impl() {
661 for pattern in "${patterns[@]}"; do
662 if [[ ${EPYTHON} == ${pattern} ]]; then
663 best_impl=${MULTIBUILD_VARIANT}
667 python_foreach_impl _distutils_try_impl
669 local PYTHON_COMPAT=( "${best_impl}" )
672 _distutils-r1_run_foreach_impl "${@}"
675 # @FUNCTION: _distutils-r1_run_foreach_impl
678 # Run the given phase for each implementation if multiple implementations
679 # are enabled, once otherwise.
680 _distutils-r1_run_foreach_impl() {
681 debug-print-function ${FUNCNAME} "${@}"
683 if [[ ${DISTUTILS_NO_PARALLEL_BUILD} ]]; then
684 eqawarn "DISTUTILS_NO_PARALLEL_BUILD is no longer meaningful. Now all builds"
685 eqawarn "are non-parallel. Please remove it from the ebuild."
687 unset DISTUTILS_NO_PARALLEL_BUILD # avoid repeated warnings
690 # store for restoring after distutils-r1_run_phase.
691 local _DISTUTILS_INITIAL_CWD=${PWD}
692 set -- distutils-r1_run_phase "${@}"
694 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
695 python_foreach_impl "${@}"
697 if [[ ! ${EPYTHON} ]]; then
698 die "EPYTHON unset, python-single-r1_pkg_setup not called?!"
700 local BUILD_DIR=${BUILD_DIR:-${S}}
701 BUILD_DIR=${BUILD_DIR%%/}_${EPYTHON}
707 distutils-r1_src_prepare() {
708 debug-print-function ${FUNCNAME} "${@}"
710 local _DISTUTILS_DEFAULT_CALLED
712 # common preparations
713 if declare -f python_prepare_all >/dev/null; then
716 distutils-r1_python_prepare_all
719 if [[ ! ${_DISTUTILS_DEFAULT_CALLED} ]]; then
720 eqawarn "QA warning: python_prepare_all() didn't call distutils-r1_python_prepare_all"
723 if declare -f python_prepare >/dev/null; then
724 _distutils-r1_run_foreach_impl python_prepare
728 distutils-r1_src_configure() {
729 python_export_utf8_locale
731 if declare -f python_configure >/dev/null; then
732 _distutils-r1_run_foreach_impl python_configure
735 if declare -f python_configure_all >/dev/null; then
736 _distutils-r1_run_common_phase python_configure_all
740 distutils-r1_src_compile() {
741 debug-print-function ${FUNCNAME} "${@}"
743 if declare -f python_compile >/dev/null; then
744 _distutils-r1_run_foreach_impl python_compile
746 _distutils-r1_run_foreach_impl distutils-r1_python_compile
749 if declare -f python_compile_all >/dev/null; then
750 _distutils-r1_run_common_phase python_compile_all
755 # Work around for setuptools test behavior (bug 534058).
756 # https://bitbucket.org/pypa/setuptools/issue/292
757 rm -rf "${BUILD_DIR}"/lib/*.egg-info
760 distutils-r1_src_test() {
761 debug-print-function ${FUNCNAME} "${@}"
763 if declare -f python_test >/dev/null; then
764 _distutils-r1_run_foreach_impl python_test
765 _distutils-r1_run_foreach_impl _clean_egg_info
768 if declare -f python_test_all >/dev/null; then
769 _distutils-r1_run_common_phase python_test_all
773 distutils-r1_src_install() {
774 debug-print-function ${FUNCNAME} "${@}"
776 if declare -f python_install >/dev/null; then
777 _distutils-r1_run_foreach_impl python_install
779 _distutils-r1_run_foreach_impl distutils-r1_python_install
782 local _DISTUTILS_DEFAULT_CALLED
784 if declare -f python_install_all >/dev/null; then
785 _distutils-r1_run_common_phase python_install_all
787 _distutils-r1_run_common_phase distutils-r1_python_install_all
790 if [[ ! ${_DISTUTILS_DEFAULT_CALLED} ]]; then
791 eqawarn "QA warning: python_install_all() didn't call distutils-r1_python_install_all"
795 # -- distutils.eclass functions --
797 distutils_get_intermediate_installation_image() {
798 die "${FUNCNAME}() is invalid for distutils-r1"
801 distutils_src_unpack() {
802 die "${FUNCNAME}() is invalid for distutils-r1, and you don't want it in EAPI ${EAPI} anyway"
805 distutils_src_prepare() {
806 die "${FUNCNAME}() is invalid for distutils-r1, you probably want: ${FUNCNAME/_/-r1_}"
809 distutils_src_compile() {
810 die "${FUNCNAME}() is invalid for distutils-r1, you probably want: ${FUNCNAME/_/-r1_}"
813 distutils_src_test() {
814 die "${FUNCNAME}() is invalid for distutils-r1, you probably want: ${FUNCNAME/_/-r1_}"
817 distutils_src_install() {
818 die "${FUNCNAME}() is invalid for distutils-r1, you probably want: ${FUNCNAME/_/-r1_}"
821 distutils_pkg_postinst() {
822 die "${FUNCNAME}() is invalid for distutils-r1, and pkg_postinst is unnecessary"
825 distutils_pkg_postrm() {
826 die "${FUNCNAME}() is invalid for distutils-r1, and pkg_postrm is unnecessary"