1 |
Hi, |
2 |
|
3 |
Since you didn't like the previous hacky idea, here's a new one. |
4 |
|
5 |
The basic flags correspond to features and are used if the relevant |
6 |
support is optional: |
7 |
|
8 |
avcodec - Enables audio/video decoding support via libavcodec |
9 |
(ffmpeg/libav) |
10 |
postproc - Enable image post-processing via libpostproc |
11 |
(ffmpeg/libpostproc) |
12 |
|
13 |
The extended flags correspond to implementations and are used |
14 |
if the package in question supports more than one implementation. |
15 |
|
16 |
ffmpeg - Prefer ffmpeg as libavcodec/libpostproc provider |
17 |
libav - Prefer libav and libpostproc as libavcodec and libpostproc |
18 |
providers respectively |
19 |
|
20 |
|
21 |
So a package supporting both providers has: |
22 |
|
23 |
IUSE="ffmpeg libav" |
24 |
RDEPEND=" |
25 |
ffmpeg? ( media-video/ffmpeg:= ) |
26 |
libav? ( media-video/libav:= [media-libs/libpostproc:=] )" |
27 |
REQUIRED_USE="^^ ( ffmpeg libav )" |
28 |
|
29 |
And a package with optional support for both ends up like: |
30 |
|
31 |
IUSE="avcodec postproc ffmpeg libav" |
32 |
RDEPEND=" |
33 |
avcodec? ( |
34 |
ffmpeg? ( media-video/ffmpeg:= ) |
35 |
libav? ( media-video/libav:= ) |
36 |
) |
37 |
postproc? ( |
38 |
ffmpeg? ( media-video/ffmpeg:= ) |
39 |
libav? ( media-libs/libpostproc:= ) |
40 |
)" |
41 |
REQUIRED_USE=" |
42 |
avcodec? ( ^^ ( ffmpeg libav ) ) |
43 |
postproc? ( ^^ ( ffmpeg libav ) ) |
44 |
ffmpeg? ( || ( avcodec postproc ) ) |
45 |
libav? ( || ( avcodec postproc ) )" |
46 |
|
47 |
Of course, if only one of the libs is needed or if both are controlled |
48 |
by the same switch everything gets much simpler :). |
49 |
|
50 |
|
51 |
This is likely the most verbose and fool-proof solution. People will |
52 |
still be able to set USE=ffmpeg or USE=libav globally to express their |
53 |
preferences, and Portage will suggest USE=avcodec as appropriate. |
54 |
|
55 |
It should be noted that USE=avcodec follows suit of USE=postproc used |
56 |
in 5 packages, and is already a local flag in media-video/vlc. |
57 |
|
58 |
What do you think now? |
59 |
|
60 |
-- |
61 |
Best regards, |
62 |
Michał Górny |