/[gentoo-x86]/eclass/distutils-r1.eclass
Gentoo

Contents of /eclass/distutils-r1.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.86 - (show annotations) (download)
Sat Sep 28 19:11:05 2013 UTC (11 months, 3 weeks ago) by floppym
Branch: MAIN
Changes since 1.85: +2 -2 lines
Truncate .pydistutils.cfg in case we call distutils-r1_python_compile more than once.

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.85 2013/09/27 19:21:43 mgorny Exp $
4
5 # @ECLASS: distutils-r1
6 # @MAINTAINER:
7 # Python team <python@gentoo.org>
8 # @AUTHOR:
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.
12 # @DESCRIPTION:
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).
19 #
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.
23 #
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'
27 # ones).
28 #
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).
35 #
36 # Please note that distutils-r1 sets RDEPEND and DEPEND unconditionally
37 # for you.
38 #
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.
42 #
43 # For more information, please see the python-r1 Developer's Guide:
44 # http://www.gentoo.org/proj/en/Python/python-r1/dev-guide.xml
45
46 case "${EAPI:-0}" in
47 0|1|2|3)
48 die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
49 ;;
50 4|5)
51 ;;
52 *)
53 die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
54 ;;
55 esac
56
57 # @ECLASS-VARIABLE: DISTUTILS_OPTIONAL
58 # @DEFAULT_UNSET
59 # @DESCRIPTION:
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.
63 #
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
67 # manually.
68
69 # @ECLASS-VARIABLE: DISTUTILS_SINGLE_IMPL
70 # @DEFAULT_UNSET
71 # @DESCRIPTION:
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.
75 #
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.
79
80 if [[ ! ${_DISTUTILS_R1} ]]; then
81
82 inherit eutils
83
84 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
85 inherit multiprocessing python-r1
86 else
87 inherit python-single-r1
88 fi
89
90 fi
91
92 if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
93 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
94 fi
95
96 if [[ ! ${_DISTUTILS_R1} ]]; then
97
98 if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
99 RDEPEND=${PYTHON_DEPS}
100 DEPEND=${PYTHON_DEPS}
101 REQUIRED_USE=${PYTHON_REQUIRED_USE}
102 fi
103
104 # @ECLASS-VARIABLE: PATCHES
105 # @DEFAULT_UNSET
106 # @DESCRIPTION:
107 # An array containing patches to be applied to the sources before
108 # copying them.
109 #
110 # If unset, no custom patches will be applied.
111 #
112 # Please note, however, that at some point the eclass may apply
113 # additional distutils patches/quirks independently of this variable.
114 #
115 # Example:
116 # @CODE
117 # PATCHES=( "${FILESDIR}"/${P}-make-gentoo-happy.patch )
118 # @CODE
119
120 # @ECLASS-VARIABLE: DOCS
121 # @DEFAULT_UNSET
122 # @DESCRIPTION:
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).
126 #
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.
130 #
131 # Example:
132 # @CODE
133 # DOCS=( NEWS README )
134 # @CODE
135
136 # @ECLASS-VARIABLE: HTML_DOCS
137 # @DEFAULT_UNSET
138 # @DESCRIPTION:
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).
142 #
143 # If unset, no HTML docs will be installed.
144 #
145 # Example:
146 # @CODE
147 # HTML_DOCS=( doc/html/. )
148 # @CODE
149
150 # @ECLASS-VARIABLE: EXAMPLES
151 # @DEFAULT_UNSET
152 # @DESCRIPTION:
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
156 # (${S} by default).
157 #
158 # The 'examples' subdirectory will be marked not to be compressed
159 # automatically.
160 #
161 # If unset, no examples will be installed.
162 #
163 # Example:
164 # @CODE
165 # EXAMPLES=( examples/. demos/. )
166 # @CODE
167
168 # @ECLASS-VARIABLE: DISTUTILS_IN_SOURCE_BUILD
169 # @DEFAULT_UNSET
170 # @DESCRIPTION:
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.
174 #
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.
178 #
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.
183
184 # @ECLASS-VARIABLE: DISTUTILS_NO_PARALLEL_BUILD
185 # @DEFAULT_UNSET
186 # @DESCRIPTION:
187 # If set to a non-null value, the parallel build feature will
188 # be disabled.
189 #
190 # When parallel builds are used, the implementation-specific sub-phases
191 # for selected Python implementation will be run in parallel. This will
192 # increase build efficiency with distutils which does not do parallel
193 # builds.
194 #
195 # This variable can be used to disable the afore-mentioned feature
196 # in case it causes issues with the package.
197
198 # @ECLASS-VARIABLE: mydistutilsargs
199 # @DEFAULT_UNSET
200 # @DESCRIPTION:
201 # An array containing options to be passed to setup.py.
202 #
203 # Example:
204 # @CODE
205 # python_configure_all() {
206 # mydistutilsargs=( --enable-my-hidden-option )
207 # }
208 # @CODE
209
210 # @FUNCTION: esetup.py
211 # @USAGE: [<args>...]
212 # @DESCRIPTION:
213 # Run setup.py using currently selected Python interpreter
214 # (if ${PYTHON} is set; fallback 'python' otherwise).
215 #
216 # setup.py will be passed the following, in order:
217 # 1. ${mydistutilsargs[@]}
218 # 2. additional arguments passed to the esetup.py function.
219 #
220 # This command dies on failure.
221 esetup.py() {
222 debug-print-function ${FUNCNAME} "${@}"
223
224 set -- "${PYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}"
225
226 echo "${@}" >&2
227 "${@}" || die
228 }
229
230 # @FUNCTION: distutils_install_for_testing
231 # @USAGE: [<args>...]
232 # @DESCRIPTION:
233 # Install the package into a temporary location for running tests.
234 # Update PYTHONPATH appropriately and set TEST_DIR to the test
235 # installation root. The Python packages will be installed in 'lib'
236 # subdir, and scripts in 'scripts' subdir (like in BUILD_DIR).
237 #
238 # Please note that this function should be only used if package uses
239 # namespaces (and therefore proper install needs to be done to enforce
240 # PYTHONPATH) or tests rely on the results of install command.
241 # For most of the packages, tests built in BUILD_DIR are good enough.
242 distutils_install_for_testing() {
243 debug-print-function ${FUNCNAME} "${@}"
244
245 # A few notes:
246 # 1) because of namespaces, we can't use 'install --root',
247 # 2) 'install --home' is terribly broken on pypy, so we need
248 # to override --install-lib and --install-scripts,
249 # 3) non-root 'install' complains about PYTHONPATH and missing dirs,
250 # so we need to set it properly and mkdir them,
251 # 4) it runs a bunch of commands which write random files to cwd,
252 # in order to avoid that, we need to run them ourselves to pass
253 # alternate build paths,
254 # 5) 'install' needs to go before 'bdist_egg' or the latter would
255 # re-set install paths.
256
257 TEST_DIR=${BUILD_DIR}/test
258 local bindir=${TEST_DIR}/scripts
259 local libdir=${TEST_DIR}/lib
260 PYTHONPATH=${libdir}:${PYTHONPATH}
261
262 local add_args=(
263 install
264 --home="${TEST_DIR}"
265 --install-lib="${libdir}"
266 --install-scripts="${bindir}"
267 )
268
269 if "${PYTHON:-python}" setup.py --help bdist_egg &>/dev/null; then
270 add_args+=(
271 bdist_egg --dist-dir="${TEST_DIR}"
272 )
273 fi
274
275 mkdir -p "${libdir}" || die
276 esetup.py "${add_args[@]}" "${@}"
277 }
278
279 # @FUNCTION: _distutils-r1_disable_ez_setup
280 # @INTERNAL
281 # @DESCRIPTION:
282 # Stub out ez_setup.py and distribute_setup.py to prevent packages
283 # from trying to download a local copy of setuptools.
284 _distutils-r1_disable_ez_setup() {
285 local stub="def use_setuptools(*args, **kwargs): pass"
286 if [[ -f ez_setup.py ]]; then
287 echo "${stub}" > ez_setup.py || die
288 fi
289 if [[ -f distribute_setup.py ]]; then
290 echo "${stub}" > distribute_setup.py || die
291 fi
292 }
293
294 # @FUNCTION: distutils-r1_python_prepare_all
295 # @DESCRIPTION:
296 # The default python_prepare_all(). It applies the patches from PATCHES
297 # array, then user patches and finally calls python_copy_sources to
298 # create copies of resulting sources for each Python implementation.
299 #
300 # At some point in the future, it may also apply eclass-specific
301 # distutils patches and/or quirks.
302 distutils-r1_python_prepare_all() {
303 debug-print-function ${FUNCNAME} "${@}"
304
305 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
306
307 epatch_user
308
309 # by default, use in-source build if python_prepare() is used
310 if [[ ! ${DISTUTILS_IN_SOURCE_BUILD+1} ]]; then
311 if declare -f python_prepare >/dev/null; then
312 DISTUTILS_IN_SOURCE_BUILD=1
313 fi
314 fi
315
316 _distutils-r1_disable_ez_setup
317
318 if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
319 then
320 # create source copies for each implementation
321 python_copy_sources
322 fi
323
324 _DISTUTILS_DEFAULT_CALLED=1
325 }
326
327 # @FUNCTION: distutils-r1_python_prepare
328 # @DESCRIPTION:
329 # The default python_prepare(). A no-op.
330 distutils-r1_python_prepare() {
331 debug-print-function ${FUNCNAME} "${@}"
332
333 :
334 }
335
336 # @FUNCTION: distutils-r1_python_configure
337 # @DESCRIPTION:
338 # The default python_configure(). A no-op.
339 distutils-r1_python_configure() {
340 debug-print-function ${FUNCNAME} "${@}"
341
342 :
343 }
344
345 # @FUNCTION: _distutils-r1_create_setup_cfg
346 # @INTERNAL
347 # @DESCRIPTION:
348 # Create implementation-specific configuration file for distutils,
349 # setting proper build-dir paths.
350 _distutils-r1_create_setup_cfg() {
351 cat > "${HOME}"/.pydistutils.cfg <<-_EOF_ || die
352 [build]
353 build-base = ${BUILD_DIR}
354
355 # using a single directory for them helps us export
356 # ${PYTHONPATH} and ebuilds find the sources independently
357 # of whether the package installs extensions or not
358 #
359 # note: due to some packages (wxpython) relying on separate
360 # platlib & purelib dirs, we do not set --build-lib (which
361 # can not be overriden with --build-*lib)
362 build-platlib = %(build-base)s/lib
363 build-purelib = %(build-base)s/lib
364
365 # make the ebuild writer lives easier
366 build-scripts = %(build-base)s/scripts
367
368 [egg_info]
369 egg-base = ${BUILD_DIR}
370 _EOF_
371 }
372
373 # @FUNCTION: _distutils-r1_copy_egg_info
374 # @INTERNAL
375 # @DESCRIPTION:
376 # Copy egg-info files to the ${BUILD_DIR} (that's going to become
377 # egg-base in esetup.py). This way, we respect whatever's in upstream
378 # egg-info.
379 _distutils-r1_copy_egg_info() {
380 mkdir -p "${BUILD_DIR}" || die
381 # stupid freebsd can't do 'cp -t ${BUILD_DIR} {} +'
382 find -name '*.egg-info' -type d -exec cp -pr {} "${BUILD_DIR}"/ ';' || die
383 }
384
385 # @FUNCTION: distutils-r1_python_compile
386 # @USAGE: [additional-args...]
387 # @DESCRIPTION:
388 # The default python_compile(). Runs 'esetup.py build'. Any parameters
389 # passed to this function will be appended to setup.py invocation,
390 # i.e. passed as options to the 'build' command.
391 distutils-r1_python_compile() {
392 debug-print-function ${FUNCNAME} "${@}"
393
394 _distutils-r1_create_setup_cfg
395 _distutils-r1_copy_egg_info
396
397 esetup.py build "${@}"
398 }
399
400 # @FUNCTION: distutils-r1_python_test
401 # @DESCRIPTION:
402 # The default python_test(). A no-op.
403 distutils-r1_python_test() {
404 debug-print-function ${FUNCNAME} "${@}"
405
406 :
407 }
408
409 # @FUNCTION: _distutils-r1_wrap_scripts
410 # @USAGE: <path>
411 # @INTERNAL
412 # @DESCRIPTION:
413 # Moves and wraps all installed scripts/executables as necessary.
414 _distutils-r1_wrap_scripts() {
415 debug-print-function ${FUNCNAME} "${@}"
416
417 local path=${1}
418 [[ ${path} ]] || die "${FUNCNAME}: no path given"
419
420 if ! _python_want_python_exec2; then
421 local PYTHON_SCRIPTDIR=${EPREFIX}/usr/bin
422 fi
423
424 mkdir -p "${path}${EPREFIX}/usr/bin" || die
425 local f
426 while IFS= read -r -d '' f; do
427 local basename=${f##*/}
428 debug-print "${FUNCNAME}: found executable at ${f#${path}/}"
429
430 [[ -d ${f} ]] && die "Unexpected directory: ${f}"
431
432 local shebang
433 read -r shebang < "${f}"
434 if [[ ${shebang} == '#!'*${EPYTHON}* ]]; then
435 debug-print "${FUNCNAME}: matching shebang: ${shebang}"
436
437 if ! _python_want_python_exec2; then
438 local newf=${f%/*}/${basename}-${EPYTHON}
439 debug-print "${FUNCNAME}: renaming to ${newf#${path}}"
440 mv "${f}" "${newf}" || die
441 fi
442
443 debug-print "${FUNCNAME}: installing wrapper at /usr/bin/${basename}"
444 _python_ln_rel "${path}${EPREFIX}"$(_python_get_wrapper_path) \
445 "${path}${EPREFIX}/usr/bin/${basename}" || die
446 elif _python_want_python_exec2; then
447 debug-print "${FUNCNAME}: non-matching shebang: ${shebang}"
448
449 debug-print "${FUNCNAME}: moving to /usr/bin/${basename}"
450 mv "${f}" "${path}${EPREFIX}/usr/bin/${basename}" || die
451 fi
452 done < <(find "${path}${PYTHON_SCRIPTDIR}" -mindepth 1 -print0)
453 }
454
455 # @FUNCTION: distutils-r1_python_install
456 # @USAGE: [additional-args...]
457 # @DESCRIPTION:
458 # The default python_install(). Runs 'esetup.py install', appending
459 # the optimization flags. Then renames the installed scripts.
460 # Any parameters passed to this function will be appended
461 # to the setup.py invocation (i.e. as options to the 'install' command).
462 distutils-r1_python_install() {
463 debug-print-function ${FUNCNAME} "${@}"
464
465 local flags
466
467 case "${EPYTHON}" in
468 jython*)
469 flags=(--compile);;
470 *)
471 flags=(--compile -O2);;
472 esac
473 debug-print "${FUNCNAME}: [${EPYTHON}] flags: ${flags}"
474
475 # enable compilation for the install phase.
476 local -x PYTHONDONTWRITEBYTECODE
477
478 # python likes to compile any module it sees, which triggers sandbox
479 # failures if some packages haven't compiled their modules yet.
480 addpredict "$(python_get_sitedir)"
481 addpredict /usr/lib/portage/pym
482
483 local root=${D}/_${EPYTHON}
484 [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D}
485 flags+=( --root="${root}" )
486
487 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]] && _python_want_python_exec2
488 then
489 local PYTHON_SCRIPTDIR
490 python_export PYTHON_SCRIPTDIR
491 flags+=( --install-scripts="${PYTHON_SCRIPTDIR}" )
492 fi
493
494 esetup.py install "${flags[@]}" "${@}"
495
496 if [[ -d ${root}$(python_get_sitedir)/tests ]]; then
497 die "Package installs 'tests' package, file collisions likely."
498 fi
499
500 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
501 _distutils-r1_wrap_scripts "${root}"
502 multibuild_merge_root "${root}" "${D}"
503 fi
504 }
505
506 # @FUNCTION: distutils-r1_python_install_all
507 # @DESCRIPTION:
508 # The default python_install_all(). It installs the documentation.
509 distutils-r1_python_install_all() {
510 debug-print-function ${FUNCNAME} "${@}"
511
512 einstalldocs
513
514 if declare -p EXAMPLES &>/dev/null; then
515 local INSDESTTREE=/usr/share/doc/${PF}/examples
516 doins -r "${EXAMPLES[@]}"
517 docompress -x "${INSDESTTREE}"
518 fi
519
520 _DISTUTILS_DEFAULT_CALLED=1
521 }
522
523 # @FUNCTION: distutils-r1_run_phase
524 # @USAGE: [<argv>...]
525 # @INTERNAL
526 # @DESCRIPTION:
527 # Run the given command.
528 #
529 # If out-of-source builds are used, the phase function is run in source
530 # directory, with BUILD_DIR pointing at the build directory
531 # and PYTHONPATH having an entry for the module build directory.
532 #
533 # If in-source builds are used, the command is executed in the directory
534 # holding the per-implementation copy of sources. BUILD_DIR points
535 # to the 'build' subdirectory.
536 distutils-r1_run_phase() {
537 debug-print-function ${FUNCNAME} "${@}"
538
539 if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
540 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
541 pushd "${BUILD_DIR}" >/dev/null || die
542 fi
543 local BUILD_DIR=${BUILD_DIR}/build
544 fi
545 local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
546
547 local -x TMPDIR=${T}/${EPYTHON}
548 local -x HOME=${TMPDIR}/home
549
550 mkdir -p "${TMPDIR}" "${HOME}" || die
551
552 "${@}"
553
554 if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
555 then
556 popd >/dev/null || die
557 fi
558 }
559
560 # @FUNCTION: _distutils-r1_run_common_phase
561 # @USAGE: [<argv>...]
562 # @INTERNAL
563 # @DESCRIPTION:
564 # Run the given command, restoring the best-implementation state.
565 #
566 # If in-source build is used, the command will be run in the copy
567 # of sources made for the best Python interpreter.
568 _distutils-r1_run_common_phase() {
569 local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR}
570
571 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
572 local MULTIBUILD_VARIANTS
573 _python_obtain_impls
574
575 multibuild_for_best_variant _python_multibuild_wrapper \
576 distutils-r1_run_phase "${@}"
577 else
578 # semi-hack, be careful.
579 _distutils-r1_run_foreach_impl "${@}"
580 fi
581 }
582
583 # @FUNCTION: _distutils-r1_run_foreach_impl
584 # @INTERNAL
585 # @DESCRIPTION:
586 # Run the given phase for each implementation if multiple implementations
587 # are enabled, once otherwise.
588 _distutils-r1_run_foreach_impl() {
589 debug-print-function ${FUNCNAME} "${@}"
590
591 set -- distutils-r1_run_phase "${@}"
592
593 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
594 if [[ ${DISTUTILS_NO_PARALLEL_BUILD} || ${DISTUTILS_SINGLE_IMPL} ]]
595 then
596 python_foreach_impl "${@}"
597 else
598 python_parallel_foreach_impl "${@}"
599 fi
600 else
601 if [[ ! ${EPYTHON} ]]; then
602 die "EPYTHON unset, python-single-r1_pkg_setup not called?!"
603 fi
604 local BUILD_DIR=${BUILD_DIR:-${S}}
605 BUILD_DIR=${BUILD_DIR%%/}_${EPYTHON}
606
607 "${@}"
608 fi
609 }
610
611 distutils-r1_src_prepare() {
612 debug-print-function ${FUNCNAME} "${@}"
613
614 local _DISTUTILS_DEFAULT_CALLED
615
616 # common preparations
617 if declare -f python_prepare_all >/dev/null; then
618 python_prepare_all
619 else
620 distutils-r1_python_prepare_all
621 fi
622
623 if [[ ! ${_DISTUTILS_DEFAULT_CALLED} ]]; then
624 eqawarn "QA warning: python_prepare_all() didn't call distutils-r1_python_prepare_all"
625 fi
626
627 if declare -f python_prepare >/dev/null; then
628 _distutils-r1_run_foreach_impl python_prepare
629 fi
630 }
631
632 distutils-r1_src_configure() {
633 if declare -f python_configure >/dev/null; then
634 _distutils-r1_run_foreach_impl python_configure
635 fi
636
637 if declare -f python_configure_all >/dev/null; then
638 _distutils-r1_run_common_phase python_configure_all
639 fi
640 }
641
642 distutils-r1_src_compile() {
643 debug-print-function ${FUNCNAME} "${@}"
644
645 if declare -f python_compile >/dev/null; then
646 _distutils-r1_run_foreach_impl python_compile
647 else
648 _distutils-r1_run_foreach_impl distutils-r1_python_compile
649 fi
650
651 if declare -f python_compile_all >/dev/null; then
652 _distutils-r1_run_common_phase python_compile_all
653 fi
654 }
655
656 distutils-r1_src_test() {
657 debug-print-function ${FUNCNAME} "${@}"
658
659 if declare -f python_test >/dev/null; then
660 _distutils-r1_run_foreach_impl python_test
661 fi
662
663 if declare -f python_test_all >/dev/null; then
664 _distutils-r1_run_common_phase python_test_all
665 fi
666 }
667
668 distutils-r1_src_install() {
669 debug-print-function ${FUNCNAME} "${@}"
670
671 if declare -f python_install >/dev/null; then
672 _distutils-r1_run_foreach_impl python_install
673 else
674 _distutils-r1_run_foreach_impl distutils-r1_python_install
675 fi
676
677 local _DISTUTILS_DEFAULT_CALLED
678
679 if declare -f python_install_all >/dev/null; then
680 _distutils-r1_run_common_phase python_install_all
681 else
682 _distutils-r1_run_common_phase distutils-r1_python_install_all
683 fi
684
685 if [[ ! ${_DISTUTILS_DEFAULT_CALLED} ]]; then
686 eqawarn "QA warning: python_install_all() didn't call distutils-r1_python_install_all"
687 fi
688 }
689
690 _DISTUTILS_R1=1
691 fi

  ViewVC Help
Powered by ViewVC 1.1.20