Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: hasufell@g.o
Subject: Re: [gentoo-dev] python-distutils-ng.eclass: allow useflag dependencies for python
Date: Thu, 06 Sep 2012 20:59:18
Message-Id: 20120906225815.0bd3dab4@pomiocik.lan
In Reply to: [gentoo-dev] python-distutils-ng.eclass: allow useflag dependencies for python by hasufell
1 On Thu, 06 Sep 2012 22:44:34 +0200
2 hasufell <hasufell@g.o> wrote:
3
4 > --- python-distutils-ng.eclass
5 > +++ python-distutils-ng.eclass
6 > @@ -59,6 +59,25 @@
7 > # Set to any value to disable automatic reinstallation of scripts in
8 > bin # directories. See python-distutils-ng_src_install function.
9 >
10 > +# @ECLASS-VARIABLE: PYTHON_USE
11 > +# @DEFAULT_UNSET
12 > +# @DESCRIPTION:
13 > +# comma seperated list of useflags needed for python
14 > +# this is directly substituted into dev-lang/python[${PYTHON_USE}]
15 > thus allowing +# all valid useflag dependencies
16 > +# example 1: PYTHON_USE="xml,sqlite"
17 > +# example 2: PYTHON_USE="xml?,threads?,-foo"
18 > +
19 > +# @ECLASS-VARIABLE: JYTHON_USE
20 > +# @DEFAULT_UNSET
21 > +# @DESCRIPTION:
22 > +# same as PYTHON_USE just for JYTHON
23 > +
24 > +# @ECLASS-VARIABLE: PYPY_USE
25 > +# @DEFAULT_UNSET
26 > +# @DESCRIPTION:
27 > +# same as PYTHON_USE just for PYPY
28 > +
29
30 Why I feel like we're close to PYTHON2_USE, PYTHON3_USE,
31 PYTHON3NG_USE...
32
33 > EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test
34 > src_install
35 > case "${EAPI}" in
36 > @@ -107,16 +126,22 @@
37 > fi
38 > unset required_use_str
39 >
40 > +# avoid empty use deps
41 > +[[ -n ${PYTHON_USE} ]] && _PYTHON_USE="[${PYTHON_USE}]" ||
42 > _PYTHON_USE="" +[[ -n ${JYTHON_USE} ]] &&
43 > _JYTHON_USE="[${JYTHON_USE}]" || _JYTHON_USE="" +[[ -n ${PYPY_USE} ]]
44 > && _PYPY_USE="[${PYPY_USE}]" || _PYPY_USE="" +
45 > +# set python DEPEND and RDEPEND
46 > for impl in ${PYTHON_COMPAT}; do
47 > IUSE+=" python_targets_${impl}"
48 > dep_str="${impl/_/.}"
49 > case "${dep_str}" in
50 > python?.?)
51 > - dep_str="dev-lang/python:${dep_str: -3}" ;;
52 > + dep_str="dev-lang/python:${dep_str:
53 > -3}${_PYTHON_USE}" ;; jython?.?)
54 > - dep_str="dev-java/jython:${dep_str: -3}" ;;
55 > + dep_str="dev-java/jython:${dep_str:
56 > -3}${_JYTHON_USE}" ;; pypy?.?)
57 > - dep_str="dev-python/pypy:${dep_str: -3}" ;;
58 > + dep_str="dev-python/pypy:${dep_str:
59 > -3}${_PYPY_USE}" ;; *)
60 > die "Unsupported implementation: ${impl}" ;;
61 > esac
62
63 I have to think more about this.
64
65 Where are your use cases?
66
67 --
68 Best regards,
69 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies