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

Contents of /eclass/distutils-r1.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.53 - (show annotations) (download)
Mon Feb 11 09:46:07 2013 UTC (19 months, 1 week ago) by mgorny
Branch: MAIN
Changes since 1.52: +5 -2 lines
Support DOCS=() to disable installing documentation.

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.52 2013/02/10 16:15:05 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 fi
102
103 # @ECLASS-VARIABLE: DISTUTILS_JOBS
104 # @DEFAULT_UNSET
105 # @DESCRIPTION:
106 # The number of parallel jobs to run for distutils-r1 parallel builds.
107 # If unset, the job-count in ${MAKEOPTS} will be used.
108 #
109 # This variable is intended to be set in make.conf.
110
111 # @ECLASS-VARIABLE: PATCHES
112 # @DEFAULT_UNSET
113 # @DESCRIPTION:
114 # An array containing patches to be applied to the sources before
115 # copying them.
116 #
117 # If unset, no custom patches will be applied.
118 #
119 # Please note, however, that at some point the eclass may apply
120 # additional distutils patches/quirks independently of this variable.
121 #
122 # Example:
123 # @CODE
124 # PATCHES=( "${FILESDIR}"/${P}-make-gentoo-happy.patch )
125 # @CODE
126
127 # @ECLASS-VARIABLE: DOCS
128 # @DEFAULT_UNSET
129 # @DESCRIPTION:
130 # An array containing documents installed using dodoc. The files listed
131 # there must exist in the directory from which
132 # distutils-r1_python_install_all() is run (${S} by default).
133 #
134 # If unset, the function will instead look up files matching default
135 # filename pattern list (from the Package Manager Specification),
136 # and install those found.
137 #
138 # Example:
139 # @CODE
140 # DOCS=( NEWS README )
141 # @CODE
142
143 # @ECLASS-VARIABLE: HTML_DOCS
144 # @DEFAULT_UNSET
145 # @DESCRIPTION:
146 # An array containing documents installed using dohtml. The files
147 # and directories listed there must exist in the directory from which
148 # distutils-r1_python_install_all() is run (${S} by default).
149 #
150 # If unset, no HTML docs will be installed.
151 #
152 # Example:
153 # @CODE
154 # HTML_DOCS=( doc/html/ )
155 # @CODE
156
157 # @ECLASS-VARIABLE: DISTUTILS_IN_SOURCE_BUILD
158 # @DEFAULT_UNSET
159 # @DESCRIPTION:
160 # If set to a non-null value, in-source builds will be enabled.
161 # If unset, the default is to use in-source builds when python_prepare()
162 # is declared, and out-of-source builds otherwise.
163 #
164 # If in-source builds are used, the eclass will create a copy of package
165 # sources for each Python implementation in python_prepare_all(),
166 # and work on that copy afterwards.
167 #
168 # If out-of-source builds are used, the eclass will instead work
169 # on the sources directly, prepending setup.py arguments with
170 # 'build --build-base ${BUILD_DIR}' to enforce keeping & using built
171 # files in the specific root.
172
173 # @ECLASS-VARIABLE: DISTUTILS_NO_PARALLEL_BUILD
174 # @DEFAULT_UNSET
175 # @DESCRIPTION:
176 # If set to a non-null value, the parallel build feature will
177 # be disabled.
178 #
179 # When parallel builds are used, the implementation-specific sub-phases
180 # for selected Python implementation will be run in parallel. This will
181 # increase build efficiency with distutils which does not do parallel
182 # builds.
183 #
184 # This variable can be used to disable the afore-mentioned feature
185 # in case it causes issues with the package.
186
187 # @ECLASS-VARIABLE: mydistutilsargs
188 # @DEFAULT_UNSET
189 # @DESCRIPTION:
190 # An array containing options to be passed to setup.py.
191 #
192 # Example:
193 # @CODE
194 # python_configure_all() {
195 # mydistutilsargs=( --enable-my-hidden-option )
196 # }
197 # @CODE
198
199 # @FUNCTION: esetup.py
200 # @USAGE: [<args>...]
201 # @DESCRIPTION:
202 # Run the setup.py using currently selected Python interpreter
203 # (if ${PYTHON} is set; fallback 'python' otherwise). The setup.py will
204 # be passed default ${mydistutilsargs[@]}, then any parameters passed
205 # to this command and optionally a standard option set (e.g. the build
206 # directory in an ebuild using out-of-source builds).
207 #
208 # This command dies on failure.
209 esetup.py() {
210 debug-print-function ${FUNCNAME} "${@}"
211
212 local add_args=()
213 if [[ ! ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
214 if [[ ! ${BUILD_DIR} ]]; then
215 die 'Out-of-source build requested, yet BUILD_DIR unset.'
216 fi
217
218 # if setuptools is used, adjust egg_info path as well
219 # (disabled since it causes build not to install scripts)
220 # if "${PYTHON:-python}" setup.py --help egg_info &>/dev/null; then
221 # add_args+=(
222 # egg_info --egg-base "${BUILD_DIR}"
223 # )
224 # fi
225
226 add_args+=(
227 build
228 --build-base "${BUILD_DIR}"
229 # using a single directory for them helps us export ${PYTHONPATH}
230 --build-lib "${BUILD_DIR}/lib"
231 # make the ebuild writer lives easier
232 --build-scripts "${BUILD_DIR}/scripts"
233 )
234 fi
235
236 set -- "${PYTHON:-python}" setup.py \
237 "${mydistutilsargs[@]}" "${@}" "${add_args[@]}"
238
239 echo "${@}" >&2
240 "${@}" || die
241 }
242
243 # @FUNCTION: distutils_install_for_testing
244 # @USAGE: [<args>...]
245 # @DESCRIPTION:
246 # Install the package into a temporary location for running tests.
247 # Update PYTHONPATH appropriately and set TEST_DIR to the test
248 # installation root. The Python packages will be installed in 'lib'
249 # subdir, and scripts in 'scripts' subdir (like in BUILD_DIR).
250 #
251 # Please note that this function should be only used if package uses
252 # namespaces (and therefore proper install needs to be done to enforce
253 # PYTHONPATH) or tests rely on the results of install command.
254 # For most of the packages, tests built in BUILD_DIR are good enough.
255 distutils_install_for_testing() {
256 debug-print-function ${FUNCNAME} "${@}"
257
258 # A few notes:
259 # 1) because of namespaces, we can't use 'install --root',
260 # 2) 'install --home' is terribly broken on pypy, so we need
261 # to override --install-lib and --install-scripts,
262 # 3) non-root 'install' complains about PYTHONPATH and missing dirs,
263 # so we need to set it properly and mkdir them,
264 # 4) it runs a bunch of commands which write random files to cwd,
265 # in order to avoid that, we need to run them ourselves to pass
266 # alternate build paths,
267 # 5) 'install' needs to go before 'bdist_egg' or the latter would
268 # re-set install paths.
269
270 if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
271 # use 'build' subdirectory to reduce the risk of collisions
272 local BUILD_DIR=${BUILD_DIR}/build
273 fi
274
275 TEST_DIR=${BUILD_DIR}/test
276 local bindir=${TEST_DIR}/scripts
277 local libdir=${TEST_DIR}/lib
278 PYTHONPATH=${libdir}:${PYTHONPATH}
279
280 local add_args=(
281 install
282 --home="${TEST_DIR}"
283 --install-lib="${libdir}"
284 --install-scripts="${bindir}"
285 )
286
287 if "${PYTHON:-python}" setup.py --help bdist_egg &>/dev/null; then
288 add_args+=(
289 bdist_egg --dist-dir="${TEST_DIR}"
290 )
291 fi
292
293 mkdir -p "${libdir}" || die
294 esetup.py "${add_args[@]}"
295 }
296
297 # @FUNCTION: distutils-r1_python_prepare_all
298 # @DESCRIPTION:
299 # The default python_prepare_all(). It applies the patches from PATCHES
300 # array, then user patches and finally calls python_copy_sources to
301 # create copies of resulting sources for each Python implementation.
302 #
303 # At some point in the future, it may also apply eclass-specific
304 # distutils patches and/or quirks.
305 distutils-r1_python_prepare_all() {
306 debug-print-function ${FUNCNAME} "${@}"
307
308 [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
309
310 epatch_user
311
312 # by default, use in-source build if python_prepare() is used
313 if [[ ! ${DISTUTILS_IN_SOURCE_BUILD+1} ]]; then
314 if declare -f python_prepare >/dev/null; then
315 DISTUTILS_IN_SOURCE_BUILD=1
316 fi
317 fi
318
319 if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
320 then
321 # create source copies for each implementation
322 python_copy_sources
323 fi
324 }
325
326 # @FUNCTION: distutils-r1_python_prepare
327 # @DESCRIPTION:
328 # The default python_prepare(). A no-op.
329 distutils-r1_python_prepare() {
330 debug-print-function ${FUNCNAME} "${@}"
331
332 :
333 }
334
335 # @FUNCTION: distutils-r1_python_configure
336 # @DESCRIPTION:
337 # The default python_configure(). A no-op.
338 distutils-r1_python_configure() {
339 debug-print-function ${FUNCNAME} "${@}"
340
341 :
342 }
343
344 # @FUNCTION: distutils-r1_python_compile
345 # @USAGE: [additional-args...]
346 # @DESCRIPTION:
347 # The default python_compile(). Runs 'esetup.py build'. Any parameters
348 # passed to this function will be appended to setup.py invocation,
349 # i.e. passed as options to the 'build' command.
350 distutils-r1_python_compile() {
351 debug-print-function ${FUNCNAME} "${@}"
352
353 esetup.py build "${@}"
354 }
355
356 # @FUNCTION: distutils-r1_python_test
357 # @DESCRIPTION:
358 # The default python_test(). A no-op.
359 distutils-r1_python_test() {
360 debug-print-function ${FUNCNAME} "${@}"
361
362 :
363 }
364
365 # @FUNCTION: _distutils-r1_rename_scripts
366 # @USAGE: <path>
367 # @INTERNAL
368 # @DESCRIPTION:
369 # Renames installed Python scripts to be implementation-suffixed.
370 # ${EPYTHON} needs to be set to the implementation name.
371 #
372 # All executable scripts having shebang referencing ${EPYTHON}
373 # in given path will be renamed.
374 _distutils-r1_rename_scripts() {
375 debug-print-function ${FUNCNAME} "${@}"
376
377 local path=${1}
378 [[ ${path} ]] || die "${FUNCNAME}: no path given"
379
380 local f
381 while IFS= read -r -d '' f; do
382 debug-print "${FUNCNAME}: found executable at ${f#${D}/}"
383
384 if [[ "$(head -n 1 "${f}")" == '#!'*${EPYTHON}* ]]
385 then
386 debug-print "${FUNCNAME}: matching shebang: $(head -n 1 "${f}")"
387
388 local newf=${f}-${EPYTHON}
389 debug-print "${FUNCNAME}: renaming to ${newf#${D}/}"
390 mv "${f}" "${newf}" || die
391
392 debug-print "${FUNCNAME}: installing wrapper at ${f#${D}/}"
393 _python_ln_rel "${path}${EPREFIX}"/usr/bin/python-exec "${f}" || die
394 fi
395 done < <(find "${path}" -type f -executable -print0)
396 }
397
398 # @FUNCTION: distutils-r1_python_install
399 # @USAGE: [additional-args...]
400 # @DESCRIPTION:
401 # The default python_install(). Runs 'esetup.py install', appending
402 # the optimization flags. Then renames the installed scripts.
403 # Any parameters passed to this function will be appended
404 # to the setup.py invocation (i.e. as options to the 'install' command).
405 distutils-r1_python_install() {
406 debug-print-function ${FUNCNAME} "${@}"
407
408 local flags
409
410 case "${EPYTHON}" in
411 jython*)
412 flags=(--compile);;
413 *)
414 flags=(--compile -O2);;
415 esac
416 debug-print "${FUNCNAME}: [${EPYTHON}] flags: ${flags}"
417
418 # enable compilation for the install phase.
419 local PYTHONDONTWRITEBYTECODE
420 export PYTHONDONTWRITEBYTECODE
421
422 # python likes to compile any module it sees, which triggers sandbox
423 # failures if some packages haven't compiled their modules yet.
424 addpredict "$(python_get_sitedir)"
425 addpredict /usr/lib/portage/pym
426
427 local root=${D}/_${EPYTHON}
428 [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D}
429
430 esetup.py install "${flags[@]}" --root="${root}" "${@}"
431
432 if [[ -d ${root}$(python_get_sitedir)/tests ]]; then
433 die "Package installs 'tests' package, file collisions likely."
434 fi
435
436 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
437 _distutils-r1_rename_scripts "${root}"
438 _distutils-r1_merge_root "${root}" "${D}"
439 fi
440 }
441
442 # @FUNCTION: distutils-r1_merge_root
443 # @USAGE: <src-root> <dest-root>
444 # @INTERNAL
445 # @DESCRIPTION:
446 # Merge the directory tree from <src-root> to <dest-root>, removing
447 # the <src-root> in the process.
448 _distutils-r1_merge_root() {
449 local src=${1}
450 local dest=${2}
451
452 local lockfile=${T}/distutils-r1-merge-lock
453
454 if type -P lockf &>/dev/null; then
455 # On BSD, we have 'lockf' wrapper.
456 tar -C "${src}" -f - -c . \
457 | lockf "${lockfile}" tar -x -f - -C "${dest}"
458 else
459 local lock_fd
460 if type -P flock &>/dev/null; then
461 # On Linux, we have 'flock' which can lock fd.
462 redirect_alloc_fd lock_fd "${lockfile}" '>>'
463 flock ${lock_fd}
464 else
465 ewarn "distutils-r1: no locking service found, please report."
466 fi
467
468 cp -a -l -n "${src}"/. "${dest}"/
469
470 if [[ ${lock_fd} ]]; then
471 # Close the lock file when we are done with it.
472 # Prevents deadlock if we aren't in a subshell.
473 eval "exec ${lock_fd}>&-"
474 fi
475 fi
476 [[ ${?} == 0 ]] || die "Merging ${EPYTHON} image failed."
477
478 rm -rf "${src}"
479 }
480
481 # @FUNCTION: distutils-r1_python_install_all
482 # @DESCRIPTION:
483 # The default python_install_all(). It installs the documentation.
484 distutils-r1_python_install_all() {
485 debug-print-function ${FUNCNAME} "${@}"
486
487 if declare -p DOCS &>/dev/null; then
488 # an empty list == don't install anything
489 if [[ ${DOCS[@]} ]]; then
490 dodoc -r "${DOCS[@]}" || die "dodoc failed"
491 fi
492 else
493 local f
494 # same list as in PMS
495 for f in README* ChangeLog AUTHORS NEWS TODO CHANGES \
496 THANKS BUGS FAQ CREDITS CHANGELOG; do
497 if [[ -s ${f} ]]; then
498 dodoc "${f}" || die "(default) dodoc ${f} failed"
499 fi
500 done
501 fi
502
503 if declare -p HTML_DOCS &>/dev/null; then
504 dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
505 fi
506 }
507
508 # @FUNCTION: distutils-r1_run_phase
509 # @USAGE: [<argv>...]
510 # @INTERNAL
511 # @DESCRIPTION:
512 # Run the given command.
513 #
514 # If out-of-source builds are used, the phase function is run in source
515 # directory, with BUILD_DIR pointing at the build directory
516 # and PYTHONPATH having an entry for the module build directory.
517 #
518 # If in-source builds are used, the command is executed in the BUILD_DIR
519 # (the directory holding per-implementation copy of sources).
520 distutils-r1_run_phase() {
521 debug-print-function ${FUNCNAME} "${@}"
522
523 if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
524 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
525 pushd "${BUILD_DIR}" >/dev/null || die
526 fi
527 else
528 local PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
529 export PYTHONPATH
530 fi
531
532 local TMPDIR=${T}/${EPYTHON}
533
534 mkdir -p "${TMPDIR}" || die
535
536 if [[ ${DISTUTILS_NO_PARALLEL_BUILD} || ${DISTUTILS_SINGLE_IMPL} ]]
537 then
538 "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log"
539 else
540 (
541 multijob_child_init
542 "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log"
543 ) &
544 multijob_post_fork
545 fi
546
547 if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
548 then
549 popd >/dev/null || die
550 fi
551
552 # Store them for reuse.
553 _DISTUTILS_BEST_IMPL=(
554 "${EPYTHON}" "${PYTHON}" "${BUILD_DIR}" "${PYTHONPATH}"
555 )
556 }
557
558 # @FUNCTION: _distutils-r1_run_common_phase
559 # @USAGE: [<argv>...]
560 # @INTERNAL
561 # @DESCRIPTION:
562 # Run the given command, restoring the best-implementation state.
563 _distutils-r1_run_common_phase() {
564 local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR}
565
566 local EPYTHON=${_DISTUTILS_BEST_IMPL[0]}
567 local PYTHON=${_DISTUTILS_BEST_IMPL[1]}
568 local BUILD_DIR=${_DISTUTILS_BEST_IMPL[2]}
569 local PYTHONPATH=${_DISTUTILS_BEST_IMPL[3]}
570
571 export EPYTHON PYTHON PYTHONPATH
572
573 einfo "common: running ${1}"
574 "${@}"
575 }
576
577 # @FUNCTION: _distutils-r1_multijob_init
578 # @INTERNAL
579 # @DESCRIPTION:
580 # Init multijob, taking the job-count from ${DISTUTILS_JOBS}.
581 _distutils-r1_multijob_init() {
582 debug-print-function ${FUNCNAME} "${@}"
583
584 if [[ ! ${DISTUTILS_NO_PARALLEL_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
585 then
586 local opts
587 if [[ ${DISTUTILS_JOBS} ]]; then
588 opts=-j${DISTUTILS_JOBS}
589 else
590 opts=${MAKEOPTS}
591 fi
592
593 multijob_init "${opts}"
594 fi
595 }
596
597 # @FUNCTION: _distutils-r1_multijob_finish
598 # @INTERNAL
599 # @DESCRIPTION:
600 # Finish multijob if used.
601 _distutils-r1_multijob_finish() {
602 debug-print-function ${FUNCNAME} "${@}"
603
604 if [[ ! ${DISTUTILS_NO_PARALLEL_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
605 then
606 multijob_finish
607 fi
608 }
609
610 # @FUNCTION: _distutils-r1_run_foreach_impl
611 # @INTERNAL
612 # @DESCRIPTION:
613 # Run the given phase for each implementation if multiple implementations
614 # are enabled, once otherwise.
615 _distutils-r1_run_foreach_impl() {
616 debug-print-function ${FUNCNAME} "${@}"
617
618 set -- distutils-r1_run_phase "${@}"
619
620 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
621 python_foreach_impl "${@}"
622 else
623 if [[ ! ${EPYTHON} ]]; then
624 die "EPYTHON unset, python-single-r1_pkg_setup not called?!"
625 fi
626 local BUILD_DIR=${BUILD_DIR:-${S}}
627 BUILD_DIR=${BUILD_DIR%%/}_${EPYTHON}
628
629 "${@}"
630 fi
631 }
632
633 distutils-r1_src_prepare() {
634 debug-print-function ${FUNCNAME} "${@}"
635
636 # common preparations
637 if declare -f python_prepare_all >/dev/null; then
638 python_prepare_all
639 else
640 distutils-r1_python_prepare_all
641 fi
642
643 _distutils-r1_multijob_init
644 if declare -f python_prepare >/dev/null; then
645 _distutils-r1_run_foreach_impl python_prepare
646 fi
647 _distutils-r1_multijob_finish
648 }
649
650 distutils-r1_src_configure() {
651 _distutils-r1_multijob_init
652 if declare -f python_configure >/dev/null; then
653 _distutils-r1_run_foreach_impl python_configure
654 fi
655 _distutils-r1_multijob_finish
656
657 if declare -f python_configure_all >/dev/null; then
658 _distutils-r1_run_common_phase python_configure_all
659 fi
660 }
661
662 distutils-r1_src_compile() {
663 debug-print-function ${FUNCNAME} "${@}"
664
665 _distutils-r1_multijob_init
666 if declare -f python_compile >/dev/null; then
667 _distutils-r1_run_foreach_impl python_compile
668 else
669 _distutils-r1_run_foreach_impl distutils-r1_python_compile
670 fi
671 _distutils-r1_multijob_finish
672
673 if declare -f python_compile_all >/dev/null; then
674 _distutils-r1_run_common_phase python_compile_all
675 fi
676 }
677
678 distutils-r1_src_test() {
679 debug-print-function ${FUNCNAME} "${@}"
680
681 _distutils-r1_multijob_init
682 if declare -f python_test >/dev/null; then
683 _distutils-r1_run_foreach_impl python_test
684 fi
685 _distutils-r1_multijob_finish
686
687 if declare -f python_test_all >/dev/null; then
688 _distutils-r1_run_common_phase python_test_all
689 fi
690 }
691
692 distutils-r1_src_install() {
693 debug-print-function ${FUNCNAME} "${@}"
694
695 _distutils-r1_multijob_init
696 if declare -f python_install >/dev/null; then
697 _distutils-r1_run_foreach_impl python_install
698 else
699 _distutils-r1_run_foreach_impl distutils-r1_python_install
700 fi
701 _distutils-r1_multijob_finish
702
703 if declare -f python_install_all >/dev/null; then
704 _distutils-r1_run_common_phase python_install_all
705 else
706 _distutils-r1_run_common_phase distutils-r1_python_install_all
707 fi
708 }
709
710 _DISTUTILS_R1=1
711 fi

  ViewVC Help
Powered by ViewVC 1.1.20