eclass: Exchange obsolete and depreacted Python ABIs in documentation
[gentoo.git] / eclass / python-r1.eclass
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 # @ECLASS: python-r1.eclass
6 # @MAINTAINER:
7 # Python team <python@gentoo.org>
8 # @AUTHOR:
9 # Author: Michał Górny <mgorny@gentoo.org>
10 # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org>
11 # @BLURB: A common, simple eclass for Python packages.
12 # @DESCRIPTION:
13 # A common eclass providing helper functions to build and install
14 # packages supporting being installed for multiple Python
15 # implementations.
16 #
17 # This eclass sets correct IUSE. Modification of REQUIRED_USE has to
18 # be done by the author of the ebuild (but PYTHON_REQUIRED_USE is
19 # provided for convenience, see below). python-r1 exports PYTHON_DEPS
20 # and PYTHON_USEDEP so you can create correct dependencies for your
21 # package easily. It also provides methods to easily run a command for
22 # each enabled Python implementation and duplicate the sources for them.
23 #
24 # Please note that python-r1 will always inherit python-utils-r1 as
25 # well. Thus, all the functions defined there can be used
26 # in the packages using python-r1, and there is no need ever to inherit
27 # both.
28 #
29 # For more information, please see the wiki:
30 # https://wiki.gentoo.org/wiki/Project:Python/python-r1
31
32 case "${EAPI:-0}" in
33         0|1|2|3)
34                 die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
35                 ;;
36         4)
37                 # EAPI=4 is only allowed on legacy packages
38                 if [[ ${CATEGORY}/${P} == dev-python/pyelftools-0.2[123] ]]; then
39                         :
40                 elif [[ ${CATEGORY}/${P} == sys-apps/file-5.22 ]]; then
41                         :
42                 elif [[ ${CATEGORY}/${P} == sys-apps/i2c-tools-3.1.1 ]]; then
43                         :
44                 elif [[ ${CATEGORY}/${P} == sys-libs/cracklib-2.9.[12] ]]; then
45                         :
46                 else
47                         die "Unsupported EAPI=${EAPI:-4} (too old, allowed only on restricted set of packages) for ${ECLASS}"
48                 fi
49                 ;;
50         5)
51                 # EAPI=5 is required for sane USE_EXPAND dependencies
52                 ;;
53         *)
54                 die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
55                 ;;
56 esac
57
58 if [[ ! ${_PYTHON_R1} ]]; then
59
60 if [[ ${_PYTHON_SINGLE_R1} ]]; then
61         die 'python-r1.eclass can not be used with python-single-r1.eclass.'
62 elif [[ ${_PYTHON_ANY_R1} ]]; then
63         die 'python-r1.eclass can not be used with python-any-r1.eclass.'
64 fi
65
66 inherit multibuild python-utils-r1
67
68 # @ECLASS-VARIABLE: PYTHON_COMPAT
69 # @REQUIRED
70 # @DESCRIPTION:
71 # This variable contains a list of Python implementations the package
72 # supports. It must be set before the `inherit' call. It has to be
73 # an array.
74 #
75 # Example:
76 # @CODE
77 # PYTHON_COMPAT=( python2_7 python3_3 python3_4} )
78 # @CODE
79 #
80 # Please note that you can also use bash brace expansion if you like:
81 # @CODE
82 # PYTHON_COMPAT=( python2_7 python3_{3,4} )
83 # @CODE
84 if ! declare -p PYTHON_COMPAT &>/dev/null; then
85         die 'PYTHON_COMPAT not declared.'
86 fi
87
88 # @ECLASS-VARIABLE: PYTHON_COMPAT_OVERRIDE
89 # @INTERNAL
90 # @DESCRIPTION:
91 # This variable can be used when working with ebuilds to override
92 # the in-ebuild PYTHON_COMPAT. It is a string listing all
93 # the implementations which package will be built for. It need be
94 # specified in the calling environment, and not in ebuilds.
95 #
96 # It should be noted that in order to preserve metadata immutability,
97 # PYTHON_COMPAT_OVERRIDE does not affect IUSE nor dependencies.
98 # The state of PYTHON_TARGETS is ignored, and all the implementations
99 # in PYTHON_COMPAT_OVERRIDE are built. Dependencies need to be satisfied
100 # manually.
101 #
102 # Example:
103 # @CODE
104 # PYTHON_COMPAT_OVERRIDE='pypy python3_3' emerge -1v dev-python/foo
105 # @CODE
106
107 # @ECLASS-VARIABLE: PYTHON_REQ_USE
108 # @DEFAULT_UNSET
109 # @DESCRIPTION:
110 # The list of USEflags required to be enabled on the chosen Python
111 # implementations, formed as a USE-dependency string. It should be valid
112 # for all implementations in PYTHON_COMPAT, so it may be necessary to
113 # use USE defaults.
114 #
115 # This should be set before calling `inherit'.
116 #
117 # Example:
118 # @CODE
119 # PYTHON_REQ_USE="gdbm,ncurses(-)?"
120 # @CODE
121 #
122 # It will cause the Python dependencies to look like:
123 # @CODE
124 # python_targets_pythonX_Y? ( dev-lang/python:X.Y[gdbm,ncurses(-)?] )
125 # @CODE
126
127 # @ECLASS-VARIABLE: PYTHON_DEPS
128 # @DESCRIPTION:
129 # This is an eclass-generated Python dependency string for all
130 # implementations listed in PYTHON_COMPAT.
131 #
132 # Example use:
133 # @CODE
134 # RDEPEND="${PYTHON_DEPS}
135 #       dev-foo/mydep"
136 # DEPEND="${RDEPEND}"
137 # @CODE
138 #
139 # Example value:
140 # @CODE
141 # dev-lang/python-exec:=
142 # python_targets_python2_7? ( dev-lang/python:2.7[gdbm] )
143 # python_targets_pypy? ( virtual/pypy[gdbm] )
144 # @CODE
145
146 # @ECLASS-VARIABLE: PYTHON_USEDEP
147 # @DESCRIPTION:
148 # This is an eclass-generated USE-dependency string which can be used to
149 # depend on another Python package being built for the same Python
150 # implementations.
151 #
152 # The generate USE-flag list is compatible with packages using python-r1
153 # and python-distutils-ng eclasses. It must not be used on packages
154 # using python.eclass.
155 #
156 # Example use:
157 # @CODE
158 # RDEPEND="dev-python/foo[${PYTHON_USEDEP}]"
159 # @CODE
160 #
161 # Example value:
162 # @CODE
163 # python_targets_python2_7(-)?,python_targets_python3_4(-)?
164 # @CODE
165
166 # @ECLASS-VARIABLE: PYTHON_REQUIRED_USE
167 # @DESCRIPTION:
168 # This is an eclass-generated required-use expression which ensures at
169 # least one Python implementation has been enabled.
170 #
171 # This expression should be utilized in an ebuild by including it in
172 # REQUIRED_USE, optionally behind a use flag.
173 #
174 # Example use:
175 # @CODE
176 # REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
177 # @CODE
178 #
179 # Example value:
180 # @CODE
181 # || ( python_targets_python2_7 python_targets_python3_4 )
182 # @CODE
183
184 _python_set_globals() {
185         local impls=()
186
187         PYTHON_DEPS=
188         local i PYTHON_PKG_DEP
189         for i in "${PYTHON_COMPAT[@]}"; do
190                 _python_impl_supported "${i}" || continue
191
192                 python_export "${i}" PYTHON_PKG_DEP
193                 PYTHON_DEPS+="python_targets_${i}? ( ${PYTHON_PKG_DEP} ) "
194
195                 impls+=( "${i}" )
196         done
197
198         if [[ ${#impls[@]} -eq 0 ]]; then
199                 die "No supported implementation in PYTHON_COMPAT."
200         fi
201
202         local flags=( "${impls[@]/#/python_targets_}" )
203         local optflags=${flags[@]/%/(-)?}
204
205         # A nice QA trick here. Since a python-single-r1 package has to have
206         # at least one PYTHON_SINGLE_TARGET enabled (REQUIRED_USE),
207         # the following check will always fail on those packages. Therefore,
208         # it should prevent developers from mistakenly depending on packages
209         # not supporting multiple Python implementations.
210
211         local flags_st=( "${impls[@]/#/-python_single_target_}" )
212         optflags+=,${flags_st[@]/%/(-)}
213
214         IUSE=${flags[*]}
215         PYTHON_REQUIRED_USE="|| ( ${flags[*]} )"
216         PYTHON_USEDEP=${optflags// /,}
217
218         # 1) well, python-exec would suffice as an RDEP
219         # but no point in making this overcomplex, BDEP doesn't hurt anyone
220         # 2) python-exec should be built with all targets forced anyway
221         # but if new targets were added, we may need to force a rebuild
222         # 3) use whichever python-exec slot installed in EAPI 5. For EAPI 4,
223         # just fix :2 since := deps are not supported.
224         if [[ ${_PYTHON_WANT_PYTHON_EXEC2} == 0 ]]; then
225                 die "python-exec:0 is no longer supported, please fix your ebuild to work with python-exec:2"
226         elif [[ ${EAPI} != 4 ]]; then
227                 PYTHON_DEPS+=">=dev-lang/python-exec-2:=[${PYTHON_USEDEP}]"
228         else
229                 PYTHON_DEPS+="dev-lang/python-exec:2[${PYTHON_USEDEP}]"
230         fi
231 }
232 _python_set_globals
233
234 # @FUNCTION: _python_validate_useflags
235 # @INTERNAL
236 # @DESCRIPTION:
237 # Enforce the proper setting of PYTHON_TARGETS.
238 _python_validate_useflags() {
239         debug-print-function ${FUNCNAME} "${@}"
240
241         local i
242
243         for i in "${PYTHON_COMPAT[@]}"; do
244                 _python_impl_supported "${i}" || continue
245
246                 use "python_targets_${i}" && return 0
247         done
248
249         eerror "No Python implementation selected for the build. Please add one"
250         eerror "of the following values to your PYTHON_TARGETS (in make.conf):"
251         eerror
252         eerror "${PYTHON_COMPAT[@]}"
253         echo
254         die "No supported Python implementation in PYTHON_TARGETS."
255 }
256
257 # @FUNCTION: python_gen_usedep
258 # @USAGE: <pattern> [...]
259 # @DESCRIPTION:
260 # Output a USE dependency string for Python implementations which
261 # are both in PYTHON_COMPAT and match any of the patterns passed
262 # as parameters to the function.
263 #
264 # Remember to escape or quote the patterns to prevent shell filename
265 # expansion.
266 #
267 # When all implementations are requested, please use ${PYTHON_USEDEP}
268 # instead. Please also remember to set an appropriate REQUIRED_USE
269 # to avoid ineffective USE flags.
270 #
271 # Example:
272 # @CODE
273 # PYTHON_COMPAT=( python{2_7,3_4} )
274 # DEPEND="doc? ( dev-python/epydoc[$(python_gen_usedep 'python2*')] )"
275 # @CODE
276 #
277 # It will cause the dependency to look like:
278 # @CODE
279 # DEPEND="doc? ( dev-python/epydoc[python_targets_python2_7?] )"
280 # @CODE
281 python_gen_usedep() {
282         debug-print-function ${FUNCNAME} "${@}"
283
284         local impl pattern
285         local matches=()
286
287         for impl in "${PYTHON_COMPAT[@]}"; do
288                 _python_impl_supported "${impl}" || continue
289
290                 for pattern; do
291                         if [[ ${impl} == ${pattern} ]]; then
292                                 matches+=(
293                                         "python_targets_${impl}(-)?"
294                                         "-python_single_target_${impl}(-)"
295                                 )
296                                 break
297                         fi
298                 done
299         done
300
301         [[ ${matches[@]} ]] || die "No supported implementations match python_gen_usedep patterns: ${@}"
302
303         local out=${matches[@]}
304         echo "${out// /,}"
305 }
306
307 # @FUNCTION: python_gen_useflags
308 # @USAGE: <pattern> [...]
309 # @DESCRIPTION:
310 # Output a list of USE flags for Python implementations which
311 # are both in PYTHON_COMPAT and match any of the patterns passed
312 # as parameters to the function.
313 #
314 # Example:
315 # @CODE
316 # PYTHON_COMPAT=( python{2_7,3_4} )
317 # REQUIRED_USE="doc? ( || ( $(python_gen_useflags python2*) ) )"
318 # @CODE
319 #
320 # It will cause the variable to look like:
321 # @CODE
322 # REQUIRED_USE="doc? ( || ( python_targets_python2_7 ) )"
323 # @CODE
324 python_gen_useflags() {
325         debug-print-function ${FUNCNAME} "${@}"
326
327         local impl pattern
328         local matches=()
329
330         for impl in "${PYTHON_COMPAT[@]}"; do
331                 _python_impl_supported "${impl}" || continue
332
333                 for pattern; do
334                         if [[ ${impl} == ${pattern} ]]; then
335                                 matches+=( "python_targets_${impl}" )
336                                 break
337                         fi
338                 done
339         done
340
341         echo "${matches[@]}"
342 }
343
344 # @FUNCTION: python_gen_cond_dep
345 # @USAGE: <dependency> <pattern> [...]
346 # @DESCRIPTION:
347 # Output a list of <dependency>-ies made conditional to USE flags
348 # of Python implementations which are both in PYTHON_COMPAT and match
349 # any of the patterns passed as the remaining parameters.
350 #
351 # In order to enforce USE constraints on the packages, verbatim
352 # '${PYTHON_USEDEP}' (quoted!) may be placed in the dependency
353 # specification. It will get expanded within the function into a proper
354 # USE dependency string.
355 #
356 # Example:
357 # @CODE
358 # PYTHON_COMPAT=( python{2_7,3_{3,4}} pypy )
359 # RDEPEND="$(python_gen_cond_dep \
360 #   'dev-python/unittest2[${PYTHON_USEDEP}]' python2_7 pypy )"
361 # @CODE
362 #
363 # It will cause the variable to look like:
364 # @CODE
365 # RDEPEND="python_targets_python2_7? (
366 #     dev-python/unittest2[python_targets_python2_7?] )
367 #       python_targets_pypy? (
368 #     dev-python/unittest2[python_targets_pypy?] )"
369 # @CODE
370 python_gen_cond_dep() {
371         debug-print-function ${FUNCNAME} "${@}"
372
373         local impl pattern
374         local matches=()
375
376         local dep=${1}
377         shift
378
379         for impl in "${PYTHON_COMPAT[@]}"; do
380                 _python_impl_supported "${impl}" || continue
381
382                 for pattern; do
383                         if [[ ${impl} == ${pattern} ]]; then
384                                 # substitute ${PYTHON_USEDEP} if used
385                                 # (since python_gen_usedep() will not return ${PYTHON_USEDEP}
386                                 #  the code is run at most once)
387                                 if [[ ${dep} == *'${PYTHON_USEDEP}'* ]]; then
388                                         local PYTHON_USEDEP=$(python_gen_usedep "${@}")
389                                         dep=${dep//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}}
390                                 fi
391
392                                 matches+=( "python_targets_${impl}? ( ${dep} )" )
393                                 break
394                         fi
395                 done
396         done
397
398         echo "${matches[@]}"
399 }
400
401 # @ECLASS-VARIABLE: BUILD_DIR
402 # @DESCRIPTION:
403 # The current build directory. In global scope, it is supposed to
404 # contain an initial build directory; if unset, it defaults to ${S}.
405 #
406 # In functions run by python_foreach_impl(), the BUILD_DIR is locally
407 # set to an implementation-specific build directory. That path is
408 # created through appending a hyphen and the implementation name
409 # to the final component of the initial BUILD_DIR.
410 #
411 # Example value:
412 # @CODE
413 # ${WORKDIR}/foo-1.3-python2_7
414 # @CODE
415
416 # @FUNCTION: python_copy_sources
417 # @DESCRIPTION:
418 # Create a single copy of the package sources for each enabled Python
419 # implementation.
420 #
421 # The sources are always copied from initial BUILD_DIR (or S if unset)
422 # to implementation-specific build directory matching BUILD_DIR used by
423 # python_foreach_abi().
424 python_copy_sources() {
425         debug-print-function ${FUNCNAME} "${@}"
426
427         local MULTIBUILD_VARIANTS
428         _python_obtain_impls
429
430         multibuild_copy_sources
431 }
432
433 # @FUNCTION: _python_obtain_impls
434 # @INTERNAL
435 # @DESCRIPTION:
436 # Set up the enabled implementation list.
437 _python_obtain_impls() {
438         if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then
439                 if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then
440                         ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect. The following Python"
441                         ewarn "implementations will be enabled:"
442                         ewarn
443                         ewarn " ${PYTHON_COMPAT_OVERRIDE}"
444                         ewarn
445                         ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be ignored."
446                         _PYTHON_COMPAT_OVERRIDE_WARNED=1
447                 fi
448
449                 MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} )
450                 return
451         fi
452
453         _python_validate_useflags
454
455         MULTIBUILD_VARIANTS=()
456
457         for impl in "${_PYTHON_ALL_IMPLS[@]}"; do
458                 if has "${impl}" "${PYTHON_COMPAT[@]}" \
459                         && use "python_targets_${impl}"
460                 then
461                         MULTIBUILD_VARIANTS+=( "${impl}" )
462                 fi
463         done
464 }
465
466 # @FUNCTION: _python_multibuild_wrapper
467 # @USAGE: <command> [<args>...]
468 # @INTERNAL
469 # @DESCRIPTION:
470 # Initialize the environment for Python implementation selected
471 # for multibuild.
472 _python_multibuild_wrapper() {
473         debug-print-function ${FUNCNAME} "${@}"
474
475         local -x EPYTHON PYTHON
476         local -x PATH=${PATH} PKG_CONFIG_PATH=${PKG_CONFIG_PATH}
477         python_export "${MULTIBUILD_VARIANT}" EPYTHON PYTHON
478         python_wrapper_setup
479
480         "${@}"
481 }
482
483 # @FUNCTION: python_foreach_impl
484 # @USAGE: <command> [<args>...]
485 # @DESCRIPTION:
486 # Run the given command for each of the enabled Python implementations.
487 # If additional parameters are passed, they will be passed through
488 # to the command.
489 #
490 # The function will return 0 status if all invocations succeed.
491 # Otherwise, the return code from first failing invocation will
492 # be returned.
493 #
494 # For each command being run, EPYTHON, PYTHON and BUILD_DIR are set
495 # locally, and the former two are exported to the command environment.
496 python_foreach_impl() {
497         debug-print-function ${FUNCNAME} "${@}"
498
499         local MULTIBUILD_VARIANTS
500         _python_obtain_impls
501
502         multibuild_foreach_variant _python_multibuild_wrapper "${@}"
503 }
504
505 # @FUNCTION: python_parallel_foreach_impl
506 # @USAGE: <command> [<args>...]
507 # @DESCRIPTION:
508 # Run the given command for each of the enabled Python implementations.
509 # If additional parameters are passed, they will be passed through
510 # to the command.
511 #
512 # The function will return 0 status if all invocations succeed.
513 # Otherwise, the return code from first failing invocation will
514 # be returned.
515 #
516 # For each command being run, EPYTHON, PYTHON and BUILD_DIR are set
517 # locally, and the former two are exported to the command environment.
518 #
519 # This command used to be the parallel variant of python_foreach_impl.
520 # However, the parallel run support has been removed to simplify
521 # the eclasses and make them more predictable and therefore it is now
522 # only a deprecated alias to python_foreach_impl.
523 python_parallel_foreach_impl() {
524         debug-print-function ${FUNCNAME} "${@}"
525
526         if [[ ! ${_PYTHON_PARALLEL_WARNED} ]]; then
527                 eqawarn "python_parallel_foreach_impl() is no longer meaningful. All runs"
528                 eqawarn "are non-parallel now. Please replace the call with python_foreach_impl."
529
530                 _PYTHON_PARALLEL_WARNED=1
531         fi
532
533         local MULTIBUILD_VARIANTS
534         _python_obtain_impls
535         multibuild_foreach_variant _python_multibuild_wrapper "${@}"
536 }
537
538 # @FUNCTION: python_setup
539 # @USAGE: [<impl-pattern>...]
540 # @DESCRIPTION:
541 # Find the best (most preferred) Python implementation that is enabled
542 # and matches at least one of the patterns passed (or '*' if no patterns
543 # passed). Set the Python build environment up for that implementation.
544 #
545 # This function needs to be used when Python is being called outside
546 # of python_foreach_impl calls (e.g. for shared processes like doc
547 # building). python_foreach_impl sets up the build environment itself.
548 #
549 # If the specific commands support only a subset of Python
550 # implementations, patterns need to be passed to restrict the allowed
551 # implementations.
552 #
553 # Example:
554 # @CODE
555 # DEPEND="doc? ( dev-python/epydoc[$(python_gen_usedep 'python2*')] )"
556 #
557 # src_compile() {
558 #   #...
559 #   if use doc; then
560 #     python_setup 'python2*'
561 #     make doc
562 #   fi
563 # }
564 # @CODE
565 python_setup() {
566         debug-print-function ${FUNCNAME} "${@}"
567
568         local best_impl patterns=( "${@-*}" )
569         _python_try_impl() {
570                 local pattern
571                 for pattern in "${patterns[@]}"; do
572                         if [[ ${EPYTHON} == ${pattern} ]]; then
573                                 best_impl=${EPYTHON}
574                         fi
575                 done
576         }
577         python_foreach_impl _python_try_impl
578
579         if [[ ! ${best_impl} ]]; then
580                 eerror "${FUNCNAME}: none of the enabled implementation matched the patterns."
581                 eerror "  patterns: ${@-'(*)'}"
582                 eerror "Likely a REQUIRED_USE constraint (possibly USE-conditional) is missing."
583                 eerror "  suggested: || ( \$(python_gen_useflags ${@}) )"
584                 eerror "(remember to quote all the patterns with '')"
585                 die "${FUNCNAME}: no enabled implementation satisfy requirements"
586         fi
587
588         python_export "${best_impl}" EPYTHON PYTHON
589         python_wrapper_setup
590 }
591
592 # @FUNCTION: python_export_best
593 # @USAGE: [<variable>...]
594 # @DESCRIPTION:
595 # Find the best (most preferred) Python implementation enabled
596 # and export given variables for it. If no variables are provided,
597 # EPYTHON & PYTHON will be exported.
598 python_export_best() {
599         debug-print-function ${FUNCNAME} "${@}"
600
601         eqawarn "python_export_best() is deprecated. Please use python_setup instead,"
602         eqawarn "combined with python_export if necessary."
603
604         [[ ${#} -gt 0 ]] || set -- EPYTHON PYTHON
605
606         local best MULTIBUILD_VARIANTS
607         _python_obtain_impls
608
609         _python_set_best() {
610                 best=${MULTIBUILD_VARIANT}
611         }
612         multibuild_for_best_variant _python_set_best
613
614         debug-print "${FUNCNAME}: Best implementation is: ${best}"
615         python_export "${best}" "${@}"
616         python_wrapper_setup
617 }
618
619 # @FUNCTION: python_replicate_script
620 # @USAGE: <path>...
621 # @DESCRIPTION:
622 # Copy the given script to variants for all enabled Python
623 # implementations, then replace it with a symlink to the wrapper.
624 #
625 # All specified files must start with a 'python' shebang. A file not
626 # having a matching shebang will be refused.
627 python_replicate_script() {
628         debug-print-function ${FUNCNAME} "${@}"
629
630         _python_replicate_script() {
631                 local _PYTHON_FIX_SHEBANG_QUIET=1
632
633                 local PYTHON_SCRIPTDIR
634                 python_export PYTHON_SCRIPTDIR
635
636                 (
637                         exeinto "${PYTHON_SCRIPTDIR#${EPREFIX}}"
638                         doexe "${files[@]}"
639                 )
640
641                 python_fix_shebang -q \
642                         "${files[@]/*\//${D%/}/${PYTHON_SCRIPTDIR}/}"
643         }
644
645         local files=( "${@}" )
646         python_foreach_impl _python_replicate_script
647
648         # install the wrappers
649         local f
650         for f; do
651                 _python_ln_rel "${ED%/}/usr/lib/python-exec/python-exec2" "${f}" || die
652         done
653 }
654
655 _PYTHON_R1=1
656 fi