Gentoo Archives: gentoo-dev

From: Thomas de Grenier de Latour <degrenier@×××××××××××.fr>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Reliance upon || ( use? ( ) ) behaviour
Date: Thu, 22 Feb 2007 21:10:45
Message-Id: 20070222220556.1bff03ea@eusebe
In Reply to: [gentoo-dev] Reliance upon || ( use? ( ) ) behaviour by Ciaran McCreesh
1 On Thu, 22 Feb 2007 19:08:48 +0000, Ciaran McCreesh
2 <ciaranm@×××××××.org> wrote:
3
4 > As has been discussed in the past, the only correct way of handling
5 > this from an ebuild perspective is lots of use && has_version calls
6
7 Which sounds like trying to mimic whatever the deps solver logic may
8 have been, no? So, why not just let the dep solver itself give the
9 right answer to the ebuild? It could well set a resolved DEPEND
10 variable (lets call it $RESOLVED_DEPEND for instance) in the ebuild
11 env, that one could query with some helper functions.
12
13 Example:
14
15 - DEPEND="cat/foo
16 || (
17 sdl? ( media-libs/libsdl )
18 svga? ( media-libs/svgalib )
19 opengl? ( virtual/opengl )
20 ggi? ( media-libs/libggi )
21 virtual/x
22 )
23 bar? ( cat/baz )"
24
25 - USE="sdl -svga opengl -ggi bar"
26
27 - media-libs/libsdl not installed, but virtual/opengl already
28 satisfied.
29
30
31 ==> RESOLVED_DEPEND="cat/foo virtual/opengl cat/baz"
32
33 And in the ebuild:
34 if has_dep media-libs/libsdl ; then
35 myconf="${myconf} --enable-sdl"
36 elif has_dep media-libs/svgalib ; then
37 myconf="${myconf} --enable-svgalib"
38
39 Or even:
40 myconf="
41 $(dep_enable media-libs/libsdl sdl)
42 $(dep_enable media-libs/svgalib)
43 ..."
44
45 (where has_dep() and dep_enable() are helper functions, similar to
46 use() and use_enable() but for querying the $RESOLVED_DEPEND var)
47
48
49 > So, is there a legitimate reason for this complication to exist? Or
50 > should use? blocks being direct children of || ( ) be forbidden?
51
52 It's not clear to me what would be your prefered DEPEND syntax for the
53 ebuild(5) example you've quoted. Something like this maybe?:
54 sdl? ( media-libs/libsdl )
55 !sdl? (
56 svga? ( media-libs/svgalib )
57 !svga? (
58 ...
59
60 (which is not really equivalent)
61
62 --
63 TGL.
64 --
65 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Reliance upon || ( use? ( ) ) behaviour Ciaran McCreesh <ciaranm@×××××××.org>