dev-cpp/pangomm: stable 2.42.1 for hppa, bug #717144
[gentoo.git] / eclass / python-single-r1.eclass
index 87e1cb97deda6d9f62b788585805074dcc3dbdf4..d516e3629696b502a1b42fddc44697697e55f107 100644 (file)
@@ -22,7 +22,7 @@
 # The eclass exports PYTHON_SINGLE_USEDEP that is suitable for depending
 # on other packages using the eclass.  Dependencies on packages using
 # python-r1 should be created via python_gen_cond_dep() function,
-# using PYTHON_MULTI_USEDEP placeholder.
+# using PYTHON_USEDEP placeholder.
 #
 # Please note that packages support multiple Python implementations
 # (using python-r1 eclass) can not depend on packages not supporting
@@ -146,7 +146,7 @@ EXPORT_FUNCTIONS pkg_setup
 # Python implementations.
 #
 # If you need to depend on a multi-impl (python-r1) package, use
-# python_gen_cond_dep with PYTHON_MULTI_USEDEP placeholder instead.
+# python_gen_cond_dep with PYTHON_USEDEP placeholder instead.
 #
 # Example use:
 # @CODE
@@ -158,7 +158,7 @@ EXPORT_FUNCTIONS pkg_setup
 # python_single_target_python3_4(-)?
 # @CODE
 
-# @ECLASS-VARIABLE: PYTHON_MULTI_USEDEP
+# @ECLASS-VARIABLE: PYTHON_USEDEP
 # @DESCRIPTION:
 # This is a placeholder variable supported by python_gen_cond_dep,
 # in order to depend on python-r1 packages built for the same Python
@@ -167,7 +167,7 @@ EXPORT_FUNCTIONS pkg_setup
 # Example use:
 # @CODE
 # RDEPEND="$(python_gen_cond_dep '
-#     dev-python/foo[${PYTHON_MULTI_USEDEP}]
+#     dev-python/foo[${PYTHON_USEDEP}]
 #   ')"
 # @CODE
 #
@@ -176,6 +176,11 @@ EXPORT_FUNCTIONS pkg_setup
 # python_targets_python3_4(-)
 # @CODE
 
+# @ECLASS-VARIABLE: PYTHON_MULTI_USEDEP
+# @DESCRIPTION:
+# This is a backwards-compatibility placeholder.  Use PYTHON_USEDEP
+# instead.
+
 # @ECLASS-VARIABLE: PYTHON_REQUIRED_USE
 # @DESCRIPTION:
 # This is an eclass-generated required-use expression which ensures
@@ -213,7 +218,7 @@ _python_single_set_globals() {
 
        local deps= i PYTHON_PKG_DEP
        for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
-               python_export "${i}" PYTHON_PKG_DEP
+               _python_export "${i}" PYTHON_PKG_DEP
                # 1) well, python-exec would suffice as an RDEP
                # but no point in making this overcomplex, BDEP doesn't hurt anyone
                # 2) python-exec should be built with all targets forced anyway
@@ -249,7 +254,7 @@ _python_single_set_globals() {
        else
                PYTHON_DEPS=${deps}
                PYTHON_REQUIRED_USE=${requse}
-               PYTHON_USEDEP='%PYTHON_USEDEP-HAS-BEEN-REMOVED%'
+               PYTHON_USEDEP='%PYTHON_USEDEP-NEEDS-TO-BE-USED-IN-PYTHON_GEN_COND_DEP%'
                PYTHON_SINGLE_USEDEP=${single_usedep}
                readonly PYTHON_DEPS PYTHON_REQUIRED_USE PYTHON_SINGLE_USEDEP \
                        PYTHON_USEDEP
@@ -345,7 +350,7 @@ python_gen_useflags() {
 # to prevent accidental shell filename expansion.
 #
 # In order to enforce USE constraints on the packages, verbatim
-# '${PYTHON_SINGLE_USEDEP}' and '${PYTHON_MULTI_USEDEP}' (quoted!) may
+# '${PYTHON_SINGLE_USEDEP}' and '${PYTHON_USEDEP}' (quoted!) may
 # be placed in the dependency specification. It will get expanded within
 # the function into a proper USE dependency string.
 #
@@ -353,7 +358,7 @@ python_gen_useflags() {
 # @CODE
 # PYTHON_COMPAT=( python{2_7,3_{3,4}} pypy )
 # RDEPEND="$(python_gen_cond_dep \
-#   'dev-python/unittest2[${PYTHON_MULTI_USEDEP}]' python2_7 pypy )"
+#   'dev-python/unittest2[${PYTHON_USEDEP}]' python2_7 pypy )"
 # @CODE
 #
 # It will cause the variable to look like:
@@ -382,8 +387,9 @@ python_gen_cond_dep() {
                        fi
                        local multi_usedep="python_targets_${impl}(-)"
 
+                       local subdep=${dep//\$\{PYTHON_MULTI_USEDEP\}/${multi_usedep}}
                        matches+=( "python_single_target_${impl}? (
-                               ${dep//\$\{PYTHON_MULTI_USEDEP\}/${multi_usedep}} )" )
+                               ${subdep//\$\{PYTHON_USEDEP\}/${multi_usedep}} )" )
                fi
        done
 
@@ -436,7 +442,7 @@ python_gen_impl_dep() {
        for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
                if _python_impl_matches "${impl}" "${@}"; then
                        local PYTHON_PKG_DEP
-                       python_export "${impl}" PYTHON_PKG_DEP
+                       _python_export "${impl}" PYTHON_PKG_DEP
                        matches+=( "python_single_target_${impl}? ( ${PYTHON_PKG_DEP} )" )
                fi
        done
@@ -465,8 +471,9 @@ python_setup() {
                ewarn
                ewarn "Dependencies won't be satisfied, and PYTHON_SINGLE_TARGET flags will be ignored."
 
-               python_export "${impls[0]}" EPYTHON PYTHON
-               python_wrapper_setup
+               _python_export "${impls[0]}" EPYTHON PYTHON
+               _python_wrapper_setup
+               einfo "Using ${EPYTHON} to build"
                return
        fi
 
@@ -482,8 +489,9 @@ python_setup() {
                                die "More than one implementation in PYTHON_SINGLE_TARGET."
                        fi
 
-                       python_export "${impl}" EPYTHON PYTHON
-                       python_wrapper_setup
+                       _python_export "${impl}" EPYTHON PYTHON
+                       _python_wrapper_setup
+                       einfo "Using ${EPYTHON} to build"
                fi
        done