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 ) ) ) )
and you have the same result, which means the originally quoted syntax
is redundant. The only advantage it has is that it looks a little bit
prettier - but I'd argue the logic is clearer in the re-written version.
I guess the question remains, though - should that syntax be in EAPI=0
or not...
--
Kevin F. Quinn
signature.asc
Description: PGP signature
