Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-python] [PATCH 3/6] [python-utils-r1] Reorder PYTHON_PKG_DEP gen.
Date: Mon, 22 Jul 2013 09:51:20
Message-Id: 1374486679-15887-3-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-python] [PATCH] Eclass support for pypy-bin by "Michał Górny"
1 Prepare the suffix first, and append it to individual deps. This will
2 make adding pypy-bin a piece of cake.
3 ---
4 gx86/eclass/python-utils-r1.eclass | 25 +++++++++++++------------
5 1 file changed, 13 insertions(+), 12 deletions(-)
6
7 diff --git a/gx86/eclass/python-utils-r1.eclass b/gx86/eclass/python-utils-r1.eclass
8 index 3565879..4450618 100644
9 --- a/gx86/eclass/python-utils-r1.eclass
10 +++ b/gx86/eclass/python-utils-r1.eclass
11 @@ -336,26 +336,27 @@ python_export() {
12 debug-print "${FUNCNAME}: PYTHON_LIBS = ${PYTHON_LIBS}"
13 ;;
14 PYTHON_PKG_DEP)
15 - local d
16 + local suffix
17 +
18 + # slot
19 + suffix=:${impl##*[a-z-]}
20 +
21 + # use-dep
22 + if [[ ${PYTHON_REQ_USE} ]]; then
23 + suffix+="[${PYTHON_REQ_USE}]"
24 + fi
25 +
26 case ${impl} in
27 python*)
28 - PYTHON_PKG_DEP='dev-lang/python';;
29 + PYTHON_PKG_DEP="dev-lang/python${suffix}";;
30 jython*)
31 - PYTHON_PKG_DEP='dev-java/jython';;
32 + PYTHON_PKG_DEP="dev-java/jython${suffix}";;
33 pypy*)
34 - PYTHON_PKG_DEP='dev-python/pypy';;
35 + PYTHON_PKG_DEP="dev-python/pypy${suffix}";;
36 *)
37 die "Invalid implementation: ${impl}"
38 esac
39
40 - # slot
41 - PYTHON_PKG_DEP+=:${impl##*[a-z-]}
42 -
43 - # use-dep
44 - if [[ ${PYTHON_REQ_USE} ]]; then
45 - PYTHON_PKG_DEP+=[${PYTHON_REQ_USE}]
46 - fi
47 -
48 export PYTHON_PKG_DEP
49 debug-print "${FUNCNAME}: PYTHON_PKG_DEP = ${PYTHON_PKG_DEP}"
50 ;;
51 --
52 1.8.3.2