Quoting Georgi Georgiev <[EMAIL PROTECTED]>:

Quoting "Kevin F. Quinn" <[EMAIL PROTECTED]>:

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

The example given in ebuild(5) is:

   || (
       sdl? ( media-libs/libsdl )
       svga? ( media-libs/svgalib )
       opengl? ( virtual/opengl )
       ggi? ( media-libs/libggi )
       virtual/x
   )

Took me a while to figure out why anyone would want to write that; the
key is that ebuild(5) says only one of the conditions is satisfied;
i.e. even if all the dependencies are present on the system, the
package will build only against the first matching dependency.

The way I see it, the ebuild has to cater for the dynamic situation
anyway, for example doing something like:

   src_configure() {
       use sdl &&
       has_version media-libs/libsdl &&
       vid_conf="--enable sdl" ||
           use svga &&
           has_version media-libs/svgalib &&
           vid_conf="--enable svga" ||
               use opengl &&
               has_version virtual/opengl &&
               vid_conf="--enable opengl" ||
                   use ggi &&
                   has_version media-libs/libggi &&
                   vid_conf="--enable ggi" ||
                       vid_conf="--enable x11"
       ...
       econf ${vid_conf} ...
   }

So the dependency could be re-written as:

    sdl? ( media-libs/libsdl )
    !sdl? ( svga? ( media-libs/svgalib )
            !svga? ( opengl? ( virtual/opengl )
                     !opengl? ( ggi? ( media-libs/libggi )
                                !ggi? ( virtual/x ) ) ) )

What you wrote for the ebuild-side of the dephandling does not match the expanded DEPEND string.

If you have all mentioned flags enabled, opengl already installed and libsdl not installed then the || () would be satisfied by "opengl? ( virtual/opengl )". Your src_configure() example above properly sets --enable-opengl. However, the DEPEND string that you quoted pulls libsdl instead.

Of course, since the DEPEND pulls libsdl, the src_configure() snippet would set --enable-sdl instead. My bad, but if that really was your intention there would have been no need for the has_version calls.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

--
[email protected] mailing list

Reply via email to