# 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
# 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
# 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
# Example use:
# @CODE
# RDEPEND="$(python_gen_cond_dep '
-# dev-python/foo[${PYTHON_MULTI_USEDEP}]
+# dev-python/foo[${PYTHON_USEDEP}]
# ')"
# @CODE
#
# 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
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
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
# 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.
#
# @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:
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
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
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
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