Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 2/3] Generate PYTHON_USEDEP for use in cross-package deps.
Date: Wed, 19 Sep 2012 21:45:51
Message-Id: 1348090988-2801-2-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/3] Generate python depstrings in python-r1 (updated). by "Michał Górny"
1 This is based on a suggestion from Ian Stakenvicius.
2 ---
3 gx86/eclass/python-r1.eclass | 18 ++++++++++++++++--
4 1 file changed, 16 insertions(+), 2 deletions(-)
5
6 diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass
7 index 957db68..487b5e0 100644
8 --- a/gx86/eclass/python-r1.eclass
9 +++ b/gx86/eclass/python-r1.eclass
10 @@ -56,11 +56,25 @@ _PYTHON_ALL_IMPLS=(
11 # DEPEND="${RDEPEND}"
12 # @CODE
13
14 +# @ECLASS-VARIABLE: PYTHON_USEDEP
15 +# @DESCRIPTION:
16 +# This is an eclass-generated USE-dependency string which can be used to
17 +# depend on another Python package being built for the same Python
18 +# implementations. It should be used like:
19 +#
20 +# @CODE
21 +# RDEPEND="dev-python/foo[${PYTHON_USEDEP}]"
22 +# @CODE
23 +
24 PYTHON_COMPAT=( ${PYTHON_COMPAT[@]} )
25
26 _python_set_globals() {
27 - IUSE=${PYTHON_COMPAT[@]/#/python_targets_}
28 - REQUIRED_USE="|| ( ${IUSE} )"
29 + local flags=( "${PYTHON_COMPAT[@]/#/python_targets_}" )
30 + local optflags=${flags[@]/%/?}
31 +
32 + IUSE=${flags}
33 + REQUIRED_USE="|| ( ${flags} )"
34 + PYTHON_USEDEP=${optflags// /,}
35
36 PYTHON_DEPS=
37 local i
38 --
39 1.7.12