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

Contents of /eclass/distutils-r1.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.48 - (hide annotations) (download)
Sun Jan 27 16:39:23 2013 UTC (14 months, 3 weeks ago) by mgorny
Branch: MAIN
Changes since 1.47: +90 -26 lines
Support using distutils-r1 along with python-single-r1.

1 mgorny 1.35 # Copyright 1999-2013 Gentoo Foundation
2 mgorny 1.1 # Distributed under the terms of the GNU General Public License v2
3 mgorny 1.48 # $Header: /var/cvsroot/gentoo-x86/eclass/distutils-r1.eclass,v 1.47 2013/01/27 16:37:28 mgorny Exp $
4 mgorny 1.1
5     # @ECLASS: distutils-r1
6     # @MAINTAINER:
7 mgorny 1.35 # Python team <python@gentoo.org>
8 mgorny 1.1 # @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 mgorny 1.5 # 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 mgorny 1.19 #
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 mgorny 1.1
46 mgorny 1.19 case "${EAPI:-0}" in
47 mgorny 1.1 0|1|2|3)
48 mgorny 1.19 die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
49 mgorny 1.1 ;;
50 mgorny 1.3 4|5)
51 mgorny 1.1 ;;
52     *)
53     die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
54     ;;
55     esac
56    
57 mgorny 1.47 # @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 mgorny 1.48 # @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 mgorny 1.19 if [[ ! ${_DISTUTILS_R1} ]]; then
81    
82 mgorny 1.48 inherit eutils
83    
84     if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
85     inherit multiprocessing python-r1
86     else
87     inherit python-single-r1
88     fi
89 mgorny 1.1
90 mgorny 1.20 fi
91    
92 mgorny 1.47 if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
93     EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
94     fi
95 mgorny 1.1
96 mgorny 1.20 if [[ ! ${_DISTUTILS_R1} ]]; then
97    
98 mgorny 1.47 if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
99     RDEPEND=${PYTHON_DEPS}
100     DEPEND=${PYTHON_DEPS}
101     fi
102 mgorny 1.1
103 mgorny 1.38 # @ECLASS-VARIABLE: DISTUTILS_JOBS
104     # @DEFAULT_UNSET
105 jlec 1.45 # @DESCRIPTION:
106 mgorny 1.38 # 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 mgorny 1.5 # @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 mgorny 1.1 # @ECLASS-VARIABLE: DOCS
128     # @DEFAULT_UNSET
129     # @DESCRIPTION:
130 mgorny 1.5 # 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 mgorny 1.1 #
134 mgorny 1.5 # 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 mgorny 1.1 #
138     # Example:
139     # @CODE
140     # DOCS=( NEWS README )
141     # @CODE
142    
143     # @ECLASS-VARIABLE: HTML_DOCS
144     # @DEFAULT_UNSET
145     # @DESCRIPTION:
146 mgorny 1.5 # 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 mgorny 1.1 #
152     # Example:
153     # @CODE
154     # HTML_DOCS=( doc/html/ )
155     # @CODE
156    
157 mgorny 1.14 # @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 mgorny 1.24 # @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 mgorny 1.13 # @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 mgorny 1.43 # 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 mgorny 1.13 #
208     # This command dies on failure.
209     esetup.py() {
210     debug-print-function ${FUNCNAME} "${@}"
211    
212 mgorny 1.43 local add_args=()
213 mgorny 1.14 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 mgorny 1.43 add_args+=(
219 mgorny 1.16 build
220     --build-base "${BUILD_DIR}"
221     # using a single directory for them helps us export ${PYTHONPATH}
222     --build-lib "${BUILD_DIR}/lib"
223 mgorny 1.34 # make the ebuild writer lives easier
224     --build-scripts "${BUILD_DIR}/scripts"
225 mgorny 1.16 )
226 mgorny 1.14 fi
227    
228 mgorny 1.13 set -- "${PYTHON:-python}" setup.py \
229 mgorny 1.43 "${mydistutilsargs[@]}" "${@}" "${add_args[@]}"
230 mgorny 1.13
231     echo "${@}" >&2
232     "${@}" || die
233     }
234    
235 mgorny 1.1 # @FUNCTION: distutils-r1_python_prepare_all
236     # @DESCRIPTION:
237     # The default python_prepare_all(). It applies the patches from PATCHES
238     # array, then user patches and finally calls python_copy_sources to
239     # create copies of resulting sources for each Python implementation.
240 mgorny 1.5 #
241     # At some point in the future, it may also apply eclass-specific
242     # distutils patches and/or quirks.
243 mgorny 1.1 distutils-r1_python_prepare_all() {
244     debug-print-function ${FUNCNAME} "${@}"
245    
246     [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
247    
248     epatch_user
249    
250 mgorny 1.14 # by default, use in-source build if python_prepare() is used
251     if [[ ! ${DISTUTILS_IN_SOURCE_BUILD+1} ]]; then
252     if declare -f python_prepare >/dev/null; then
253     DISTUTILS_IN_SOURCE_BUILD=1
254     fi
255     fi
256    
257 mgorny 1.48 if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
258     then
259 mgorny 1.14 # create source copies for each implementation
260     python_copy_sources
261     fi
262 mgorny 1.1 }
263    
264     # @FUNCTION: distutils-r1_python_prepare
265     # @DESCRIPTION:
266 mgorny 1.43 # The default python_prepare(). A no-op.
267 mgorny 1.1 distutils-r1_python_prepare() {
268     debug-print-function ${FUNCNAME} "${@}"
269    
270     :
271     }
272    
273     # @FUNCTION: distutils-r1_python_configure
274     # @DESCRIPTION:
275 mgorny 1.43 # The default python_configure(). A no-op.
276 mgorny 1.1 distutils-r1_python_configure() {
277     debug-print-function ${FUNCNAME} "${@}"
278    
279     :
280     }
281    
282     # @FUNCTION: distutils-r1_python_compile
283     # @USAGE: [additional-args...]
284     # @DESCRIPTION:
285 mgorny 1.13 # The default python_compile(). Runs 'esetup.py build'. Any parameters
286 mgorny 1.43 # passed to this function will be appended to setup.py invocation,
287     # i.e. passed as options to the 'build' command.
288 mgorny 1.1 distutils-r1_python_compile() {
289     debug-print-function ${FUNCNAME} "${@}"
290    
291 mgorny 1.13 esetup.py build "${@}"
292 mgorny 1.1 }
293    
294     # @FUNCTION: distutils-r1_python_test
295     # @DESCRIPTION:
296 mgorny 1.43 # The default python_test(). A no-op.
297 mgorny 1.1 distutils-r1_python_test() {
298     debug-print-function ${FUNCNAME} "${@}"
299    
300     :
301     }
302    
303 mgorny 1.21 # @FUNCTION: _distutils-r1_rename_scripts
304     # @USAGE: <path>
305     # @INTERNAL
306 mgorny 1.1 # @DESCRIPTION:
307     # Renames installed Python scripts to be implementation-suffixed.
308 mgorny 1.21 # ${EPYTHON} needs to be set to the implementation name.
309     #
310     # All executable scripts having shebang referencing ${EPYTHON}
311     # in given path will be renamed.
312     _distutils-r1_rename_scripts() {
313 mgorny 1.1 debug-print-function ${FUNCNAME} "${@}"
314    
315 mgorny 1.21 local path=${1}
316     [[ ${path} ]] || die "${FUNCNAME}: no path given"
317    
318 mgorny 1.1 local f
319 mgorny 1.21 while IFS= read -r -d '' f; do
320     debug-print "${FUNCNAME}: found executable at ${f#${D}/}"
321    
322     if [[ "$(head -n 1 "${f}")" == '#!'*${EPYTHON}* ]]
323     then
324     debug-print "${FUNCNAME}: matching shebang: $(head -n 1 "${f}")"
325    
326     local newf=${f}-${EPYTHON}
327 mgorny 1.23 debug-print "${FUNCNAME}: renaming to ${newf#${D}/}"
328 mgorny 1.21 mv "${f}" "${newf}" || die
329 mgorny 1.23
330     debug-print "${FUNCNAME}: installing wrapper at ${f#${D}/}"
331 mgorny 1.31 _python_ln_rel "${path}${EPREFIX}"/usr/bin/python-exec "${f}" || die
332 mgorny 1.1 fi
333 mgorny 1.21 done < <(find "${path}" -type f -executable -print0)
334 mgorny 1.1 }
335    
336     # @FUNCTION: distutils-r1_python_install
337     # @USAGE: [additional-args...]
338     # @DESCRIPTION:
339 mgorny 1.13 # The default python_install(). Runs 'esetup.py install', appending
340 mgorny 1.21 # the optimization flags. Then renames the installed scripts.
341 mgorny 1.43 # Any parameters passed to this function will be appended
342     # to the setup.py invocation (i.e. as options to the 'install' command).
343 mgorny 1.1 distutils-r1_python_install() {
344     debug-print-function ${FUNCNAME} "${@}"
345    
346     local flags
347    
348     case "${EPYTHON}" in
349     jython*)
350     flags=(--compile);;
351     *)
352     flags=(--compile -O2);;
353     esac
354     debug-print "${FUNCNAME}: [${EPYTHON}] flags: ${flags}"
355    
356 mgorny 1.15 # enable compilation for the install phase.
357 mgorny 1.18 local PYTHONDONTWRITEBYTECODE
358     export PYTHONDONTWRITEBYTECODE
359 mgorny 1.1
360 mgorny 1.32 # python likes to compile any module it sees, which triggers sandbox
361     # failures if some packages haven't compiled their modules yet.
362     addpredict "$(python_get_sitedir)"
363 floppym 1.36 addpredict /usr/lib/portage/pym
364 mgorny 1.32
365 mgorny 1.22 local root=${D}/_${EPYTHON}
366 mgorny 1.48 [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D}
367 mgorny 1.1
368 mgorny 1.22 esetup.py install "${flags[@]}" --root="${root}" "${@}"
369    
370 mgorny 1.48 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
371     _distutils-r1_rename_scripts "${root}"
372     _distutils-r1_merge_root "${root}" "${D}"
373     fi
374 mgorny 1.39 }
375    
376     # @FUNCTION: distutils-r1_merge_root
377     # @USAGE: <src-root> <dest-root>
378     # @INTERNAL
379     # @DESCRIPTION:
380     # Merge the directory tree from <src-root> to <dest-root>, removing
381     # the <src-root> in the process.
382     _distutils-r1_merge_root() {
383     local src=${1}
384     local dest=${2}
385    
386     local lockfile=${T}/distutils-r1-merge-lock
387    
388     if type -P lockf &>/dev/null; then
389     # On BSD, we have 'lockf' wrapper.
390     tar -C "${src}" -f - -c . \
391     | lockf "${lockfile}" tar -x -f - -C "${dest}"
392     else
393 floppym 1.40 local lock_fd
394 mgorny 1.39 if type -P flock &>/dev/null; then
395     # On Linux, we have 'flock' which can lock fd.
396     redirect_alloc_fd lock_fd "${lockfile}" '>>'
397     flock ${lock_fd}
398     else
399     ewarn "distutils-r1: no locking service found, please report."
400     fi
401    
402     cp -a -l -n "${src}"/. "${dest}"/
403 floppym 1.40
404     if [[ ${lock_fd} ]]; then
405     # Close the lock file when we are done with it.
406     # Prevents deadlock if we aren't in a subshell.
407     eval "exec ${lock_fd}>&-"
408     fi
409 mgorny 1.39 fi
410     [[ ${?} == 0 ]] || die "Merging ${EPYTHON} image failed."
411    
412     rm -rf "${src}"
413 mgorny 1.1 }
414    
415     # @FUNCTION: distutils-r1_python_install_all
416     # @DESCRIPTION:
417 mgorny 1.23 # The default python_install_all(). It installs the documentation.
418 mgorny 1.1 distutils-r1_python_install_all() {
419     debug-print-function ${FUNCNAME} "${@}"
420    
421     if declare -p DOCS &>/dev/null; then
422 mgorny 1.42 dodoc -r "${DOCS[@]}" || die "dodoc failed"
423 mgorny 1.1 else
424     local f
425     # same list as in PMS
426     for f in README* ChangeLog AUTHORS NEWS TODO CHANGES \
427     THANKS BUGS FAQ CREDITS CHANGELOG; do
428     if [[ -s ${f} ]]; then
429     dodoc "${f}" || die "(default) dodoc ${f} failed"
430     fi
431     done
432     fi
433    
434     if declare -p HTML_DOCS &>/dev/null; then
435     dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
436     fi
437     }
438    
439 mgorny 1.8 # @FUNCTION: distutils-r1_run_phase
440     # @USAGE: [<argv>...]
441     # @INTERNAL
442     # @DESCRIPTION:
443 mgorny 1.17 # Run the given command.
444     #
445     # If out-of-source builds are used, the phase function is run in source
446     # directory, with BUILD_DIR pointing at the build directory
447     # and PYTHONPATH having an entry for the module build directory.
448     #
449     # If in-source builds are used, the command is executed in the BUILD_DIR
450     # (the directory holding per-implementation copy of sources).
451 mgorny 1.8 distutils-r1_run_phase() {
452     debug-print-function ${FUNCNAME} "${@}"
453    
454 mgorny 1.14 if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
455 mgorny 1.48 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
456     pushd "${BUILD_DIR}" >/dev/null || die
457     fi
458 mgorny 1.17 else
459     local PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
460     export PYTHONPATH
461 mgorny 1.14 fi
462    
463 mgorny 1.30 local TMPDIR=${T}/${EPYTHON}
464    
465     mkdir -p "${TMPDIR}" || die
466    
467 mgorny 1.48 if [[ ${DISTUTILS_NO_PARALLEL_BUILD} || ${DISTUTILS_SINGLE_IMPL} ]]
468     then
469 mgorny 1.37 "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log"
470 mgorny 1.24 else
471 mgorny 1.28 (
472     multijob_child_init
473     "${@}" 2>&1 | tee -a "${T}/build-${EPYTHON}.log"
474     ) &
475     multijob_post_fork
476 mgorny 1.24 fi
477 mgorny 1.14
478 mgorny 1.48 if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
479     then
480 mgorny 1.46 popd >/dev/null || die
481 mgorny 1.14 fi
482 mgorny 1.25
483     # Store them for reuse.
484     _DISTUTILS_BEST_IMPL=(
485     "${EPYTHON}" "${PYTHON}" "${BUILD_DIR}" "${PYTHONPATH}"
486     )
487     }
488    
489     # @FUNCTION: _distutils-r1_run_common_phase
490     # @USAGE: [<argv>...]
491     # @INTERNAL
492     # @DESCRIPTION:
493     # Run the given command, restoring the best-implementation state.
494     _distutils-r1_run_common_phase() {
495 mgorny 1.44 local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR}
496    
497 mgorny 1.25 local EPYTHON=${_DISTUTILS_BEST_IMPL[0]}
498     local PYTHON=${_DISTUTILS_BEST_IMPL[1]}
499 mgorny 1.44 local BUILD_DIR=${_DISTUTILS_BEST_IMPL[2]}
500 mgorny 1.25 local PYTHONPATH=${_DISTUTILS_BEST_IMPL[3]}
501    
502     export EPYTHON PYTHON PYTHONPATH
503    
504 mgorny 1.29 einfo "common: running ${1}"
505 mgorny 1.25 "${@}"
506 mgorny 1.8 }
507    
508 mgorny 1.38 # @FUNCTION: _distutils-r1_multijob_init
509     # @INTERNAL
510     # @DESCRIPTION:
511     # Init multijob, taking the job-count from ${DISTUTILS_JOBS}.
512     _distutils-r1_multijob_init() {
513     debug-print-function ${FUNCNAME} "${@}"
514    
515 mgorny 1.48 if [[ ! ${DISTUTILS_NO_PARALLEL_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
516     then
517     local opts
518     if [[ ${DISTUTILS_JOBS} ]]; then
519     opts=-j${DISTUTILS_JOBS}
520     else
521     opts=${MAKEOPTS}
522     fi
523    
524     multijob_init "${opts}"
525     fi
526     }
527    
528     # @FUNCTION: _distutils-r1_multijob_finish
529     # @INTERNAL
530     # @DESCRIPTION:
531     # Finish multijob if used.
532     _distutils-r1_multijob_finish() {
533     debug-print-function ${FUNCNAME} "${@}"
534    
535     if [[ ! ${DISTUTILS_NO_PARALLEL_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]
536     then
537     multijob_finish
538     fi
539     }
540    
541     # @FUNCTION: _distutils-r1_run_foreach_impl
542     # @INTERNAL
543     # @DESCRIPTION:
544     # Run the given phase for each implementation if multiple implementations
545     # are enabled, once otherwise.
546     _distutils-r1_run_foreach_impl() {
547     debug-print-function ${FUNCNAME} "${@}"
548    
549     set -- distutils-r1_run_phase "${@}"
550    
551     if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
552     python_foreach_impl "${@}"
553 mgorny 1.38 else
554 mgorny 1.48 if [[ ! ${EPYTHON} ]]; then
555     die "EPYTHON unset, python-single-r1_pkg_setup not called?!"
556     fi
557     local BUILD_DIR=${BUILD_DIR:-${S}}
558     BUILD_DIR=${BUILD_DIR%%/}_${EPYTHON}
559    
560     "${@}"
561 mgorny 1.38 fi
562     }
563    
564 mgorny 1.1 distutils-r1_src_prepare() {
565     debug-print-function ${FUNCNAME} "${@}"
566    
567     # common preparations
568     if declare -f python_prepare_all >/dev/null; then
569     python_prepare_all
570     else
571     distutils-r1_python_prepare_all
572     fi
573    
574 mgorny 1.38 _distutils-r1_multijob_init
575 mgorny 1.1 if declare -f python_prepare >/dev/null; then
576 mgorny 1.48 _distutils-r1_run_foreach_impl python_prepare
577 mgorny 1.1 fi
578 mgorny 1.48 _distutils-r1_multijob_finish
579 mgorny 1.1 }
580    
581     distutils-r1_src_configure() {
582 mgorny 1.38 _distutils-r1_multijob_init
583 mgorny 1.1 if declare -f python_configure >/dev/null; then
584 mgorny 1.48 _distutils-r1_run_foreach_impl python_configure
585 mgorny 1.1 fi
586 mgorny 1.48 _distutils-r1_multijob_finish
587 mgorny 1.1
588     if declare -f python_configure_all >/dev/null; then
589 mgorny 1.25 _distutils-r1_run_common_phase python_configure_all
590 mgorny 1.1 fi
591     }
592    
593     distutils-r1_src_compile() {
594     debug-print-function ${FUNCNAME} "${@}"
595    
596 mgorny 1.38 _distutils-r1_multijob_init
597 mgorny 1.1 if declare -f python_compile >/dev/null; then
598 mgorny 1.48 _distutils-r1_run_foreach_impl python_compile
599 mgorny 1.1 else
600 mgorny 1.48 _distutils-r1_run_foreach_impl distutils-r1_python_compile
601 mgorny 1.1 fi
602 mgorny 1.48 _distutils-r1_multijob_finish
603 mgorny 1.1
604     if declare -f python_compile_all >/dev/null; then
605 mgorny 1.25 _distutils-r1_run_common_phase python_compile_all
606 mgorny 1.1 fi
607     }
608    
609     distutils-r1_src_test() {
610     debug-print-function ${FUNCNAME} "${@}"
611    
612 mgorny 1.38 _distutils-r1_multijob_init
613 mgorny 1.1 if declare -f python_test >/dev/null; then
614 mgorny 1.48 _distutils-r1_run_foreach_impl python_test
615 mgorny 1.1 fi
616 mgorny 1.48 _distutils-r1_multijob_finish
617 mgorny 1.1
618     if declare -f python_test_all >/dev/null; then
619 mgorny 1.25 _distutils-r1_run_common_phase python_test_all
620 mgorny 1.1 fi
621     }
622    
623     distutils-r1_src_install() {
624     debug-print-function ${FUNCNAME} "${@}"
625    
626 mgorny 1.38 _distutils-r1_multijob_init
627 mgorny 1.1 if declare -f python_install >/dev/null; then
628 mgorny 1.48 _distutils-r1_run_foreach_impl python_install
629 mgorny 1.1 else
630 mgorny 1.48 _distutils-r1_run_foreach_impl distutils-r1_python_install
631 mgorny 1.1 fi
632 mgorny 1.48 _distutils-r1_multijob_finish
633 mgorny 1.1
634     if declare -f python_install_all >/dev/null; then
635 mgorny 1.25 _distutils-r1_run_common_phase python_install_all
636 mgorny 1.1 else
637 mgorny 1.25 _distutils-r1_run_common_phase distutils-r1_python_install_all
638 mgorny 1.1 fi
639     }
640 mgorny 1.19
641     _DISTUTILS_R1=1
642     fi

  ViewVC Help
Powered by ViewVC 1.1.20