Hi, Since you didn't like the previous hacky idea, here's a new one.
The basic flags correspond to features and are used if the relevant
support is optional:
avcodec - Enables audio/video decoding support via libavcodec
(ffmpeg/libav)
postproc - Enable image post-processing via libpostproc
(ffmpeg/libpostproc)
The extended flags correspond to implementations and are used
if the package in question supports more than one implementation.
ffmpeg - Prefer ffmpeg as libavcodec/libpostproc provider
libav - Prefer libav and libpostproc as libavcodec and libpostproc
providers respectively
So a package supporting both providers has:
IUSE="ffmpeg libav"
RDEPEND="
ffmpeg? ( media-video/ffmpeg:= )
libav? ( media-video/libav:= [media-libs/libpostproc:=] )"
REQUIRED_USE="^^ ( ffmpeg libav )"
And a package with optional support for both ends up like:
IUSE="avcodec postproc ffmpeg libav"
RDEPEND="
avcodec? (
ffmpeg? ( media-video/ffmpeg:= )
libav? ( media-video/libav:= )
)
postproc? (
ffmpeg? ( media-video/ffmpeg:= )
libav? ( media-libs/libpostproc:= )
)"
REQUIRED_USE="
avcodec? ( ^^ ( ffmpeg libav ) )
postproc? ( ^^ ( ffmpeg libav ) )
ffmpeg? ( || ( avcodec postproc ) )
libav? ( || ( avcodec postproc ) )"
Of course, if only one of the libs is needed or if both are controlled
by the same switch everything gets much simpler :).
This is likely the most verbose and fool-proof solution. People will
still be able to set USE=ffmpeg or USE=libav globally to express their
preferences, and Portage will suggest USE=avcodec as appropriate.
It should be noted that USE=avcodec follows suit of USE=postproc used
in 5 packages, and is already a local flag in media-video/vlc.
What do you think now?
--
Best regards,
Michał Górny
pgpES7cBFTe4O.pgp
Description: OpenPGP digital signature
