On Thu, 22 Feb 2007 19:08:48 +0000, Ciaran McCreesh
<[EMAIL PROTECTED]> wrote:

> As has been discussed in the past, the only correct way of handling
> this from an ebuild perspective is lots of use && has_version calls

Which sounds like trying to mimic whatever the deps solver logic may
have been, no?  So, why not just let the dep solver itself give the
right answer to the ebuild?  It could well set a resolved DEPEND
variable (lets call it $RESOLVED_DEPEND for instance) in the ebuild
env, that one could query with some helper functions.

Example:

 - DEPEND="cat/foo
    || (  
        sdl? ( media-libs/libsdl )    
        svga? ( media-libs/svgalib )
        opengl? ( virtual/opengl )
        ggi? ( media-libs/libggi )
        virtual/x
    )
    bar? ( cat/baz )"

 - USE="sdl -svga opengl -ggi bar"

 - media-libs/libsdl not installed, but virtual/opengl already
satisfied.


==> RESOLVED_DEPEND="cat/foo virtual/opengl cat/baz"

And in the ebuild:
   if has_dep media-libs/libsdl ; then
      myconf="${myconf} --enable-sdl"
   elif has_dep media-libs/svgalib ; then
      myconf="${myconf} --enable-svgalib"

Or even:
   myconf="
      $(dep_enable media-libs/libsdl sdl)
      $(dep_enable media-libs/svgalib)
      ..."

(where has_dep() and dep_enable() are helper functions, similar to
use() and use_enable() but for querying the $RESOLVED_DEPEND var)


> So, is there a legitimate reason for this complication to exist? Or
> should use? blocks being direct children of || ( ) be forbidden?

It's not clear to me what would be your prefered DEPEND syntax for the
ebuild(5) example you've quoted.  Something like this maybe?:
  sdl? ( media-libs/libsdl )
  !sdl? (
     svga? ( media-libs/svgalib )
     !svga? ( 
        ...

(which is not really equivalent)

--
TGL.
-- 
[email protected] mailing list

Reply via email to