Gentoo Archives: gentoo-dev

From: Ian Stakenvicius <axs@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH 6/6] Generate python depstrings in python-r1.
Date: Wed, 19 Sep 2012 13:02:00
Message-Id: 5059C201.5070408@gentoo.org
In Reply to: [gentoo-dev] [PATCH 6/6] Generate python depstrings in python-r1. by "Michał Górny"
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA256
3
4 On 19/09/12 06:00 AM, Micha? Górny wrote:
5 > --- gx86/eclass/python-distutils-ng.eclass | 20
6 > ++------------------ gx86/eclass/python-r1.eclass | 28
7 > ++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 20
8 > deletions(-)
9 >
10 > diff --git a/gx86/eclass/python-distutils-ng.eclass
11 > b/gx86/eclass/python-distutils-ng.eclass index 5df965c..bffe563
12 > 100644 --- a/gx86/eclass/python-distutils-ng.eclass +++
13 > b/gx86/eclass/python-distutils-ng.eclass @@ -74,24 +74,8 @@
14 > _python-distutils-ng_get_binary_for_implementation() { esac }
15 >
16 > -for impl in ${PYTHON_COMPAT[@]}; do - dep_str="${impl/_/.}" - case
17 > "${dep_str}" in - python?.?) -
18 > dep_str="dev-lang/python:${dep_str: -3}" ;; - jython?.?) -
19 > dep_str="dev-java/jython:${dep_str: -3}" ;; - pypy?.?) -
20 > dep_str="dev-python/pypy:${dep_str: -3}" ;; - *) - die
21 > "Unsupported implementation: ${impl}" ;; - esac -
22 > dep_str="python_targets_${impl}? ( ${dep_str} )" - -
23 > RDEPEND="${RDEPEND} ${dep_str}" - DEPEND="${DEPEND} ${dep_str}" -
24 > unset dep_str -done +RDEPEND=${PYTHON_DEPEND}
25 > +DEPEND=${PYTHON_DEPEND}
26 >
27 > _PACKAGE_SPECIFIC_S="${S#${WORKDIR}/}"
28 >
29 > diff --git a/gx86/eclass/python-r1.eclass
30 > b/gx86/eclass/python-r1.eclass index 18f9246..3017dd8 100644 ---
31 > a/gx86/eclass/python-r1.eclass +++ b/gx86/eclass/python-r1.eclass
32 > @@ -40,14 +40,38 @@ _PYTHON_ALL_IMPLS=( # a package supports. It
33 > must be set before the `inherit' call. # The default is to enable
34 > all implementations. # -# PYTHON_COMPAT can be either a scalar or
35 > an array. If it's a scalar, the eclass -# will implicitly convert
36 > it to an array. +# PYTHON_COMPAT can be either a scalar or an
37 > array. If it's a scalar, +# the eclass will implicitly convert it
38 > to an array. : ${PYTHON_COMPAT:=${_PYTHON_ALL_IMPLS[@]}}
39 >
40 > +# @ECLASS-VARIABLE: PYTHON_DEPEND +# @DESCRIPTION: +# This is an
41 > eclass-generated Python dependency string for all +#
42 > implementations listed in PYTHON_COMPAT. + PYTHON_COMPAT=(
43 > ${PYTHON_COMPAT[@]} )
44 >
45 > _python_set_globals() { IUSE=${PYTHON_COMPAT[@]/#/python_targets_}
46 > REQUIRED_USE="|| ( ${IUSE} )" + + PYTHON_DEPEND= + local i + for i
47 > in ${PYTHON_COMPAT[@]}; do + local d + case ${i} in + python*)
48 > + d='dev-lang/python';; + jython*) + d='dev-java/jython';;
49 > + pypy*) + d='dev-python/pypy';; + *) + die "Invalid
50 > implementation: ${i}" + esac + + local v=${i##*[a-z]} +
51 > PYTHON_DEPEND+=" python_targets_${i}? ( ${d}:${v/_/.} )" + done }
52 > _python_set_globals
53
54
55 I think we really need to use a different variable than
56 "PYTHON_DEPEND". There are ebuilds that inherit both python.eclass
57 and python-distutils-ng.eclass and so this will obviously break those
58 cases.. (that said, I do think that python-r1.eclass should gain
59 whatever bits it is missing so said inherit on python.eclass isn't
60 necessary, but that's beside the point)
61
62
63 -----BEGIN PGP SIGNATURE-----
64 Version: GnuPG v2.0.19 (GNU/Linux)
65
66 iF4EAREIAAYFAlBZwgEACgkQ2ugaI38ACPAYCQD/UP8eEcsQygtNdNaXR6fXF1Ef
67 p4IYbkg/S16F372FM7MBAJkib9wdbK+3Txbvwxik5xxgtfTNmKh9iQl5DHmXRiSC
68 =Djl7
69 -----END PGP SIGNATURE-----

Replies

Subject Author
Re: [gentoo-dev] [PATCH 6/6] Generate python depstrings in python-r1. "Michał Górny" <mgorny@g.o>