1 |
Hi, |
2 |
|
3 |
While writing and using some ebuilds, I had to deal with (pseudo) USE |
4 |
flags requirements. For example, if you install mplayer with |
5 |
USE="encode" the result will depend on other USE flags: if you have |
6 |
USE="encode mp3", it will install lame for example. I know a few ebuilds |
7 |
behave like that in the tree. We can also see some ebuilds that will |
8 |
force an option if you set another one: if you set USE="-foo +bar" and |
9 |
bar needs foo, it will silently set --enable-foo. Finally, they are some |
10 |
ebuilds like >=ekiga-3 that will just fail if you have two USE flags |
11 |
"conflicting": kontact needs kde so USE="kde -kontact" and USE="kde |
12 |
kontact" are okay but USE="-kde kontact" will fail. |
13 |
|
14 |
In my opinion, we can't keep auto-enabling some options because the user |
15 |
has enabled another option without telling him and without telling the |
16 |
package manager. For example, I'm a lambda user, I've set USE=kontact |
17 |
but I don't know it's related to KDE, I don't have a KDE desktop and I |
18 |
don't want one. With the regular behavior in the tree, kde will be |
19 |
enabled silently and the user will don't have a clue about it like the |
20 |
package manager. This last one is even worst because if we imagine a |
21 |
library ebuild with this behavior used by other ebuilds in the tree, |
22 |
EAPI-2 use dependencies will break. (foo ebuild depends on ekiga[kde], |
23 |
user will have to rebuild ekiga if it has been built with USE="-kde |
24 |
kontact" even if ekiga has been built with kde support or foo ebuild |
25 |
depends on mplayer[mp3] should be mplayer[encode,mp3]. |
26 |
|
27 |
However, dying is probably not the best solution too. |
28 |
So I think we should add a new feature in PMS already used in Exherbo |
29 |
EAPI, USE flags requirements [1]. That means an ebuild should be able to |
30 |
say a USE flag is available only if some other ones are in a specific state. |
31 |
Let's take the mplayer example, if we have a line like this: |
32 |
USE_REQUIREMENTS="encode? ( mp2 mp3 faac x264 xvid )", PM should be able |
33 |
to show the user USE="mp3" will be ignored because he didn't set |
34 |
USE="encode" and the PM will disable this USE flag by himself. |
35 |
The same way, for ekiga: |
36 |
USE_REQUIREMENTS="kde? ( kontact )", PM should be able to show the user |
37 |
if he set USE="kontact", kde USE flag is enabled and the PM will enable |
38 |
this USE flag by himself. |
39 |
|
40 |
I think this new feature should help everyones life. We can also imagine |
41 |
great features like a minimal USE-flag that will be something like: |
42 |
USE_REQUIREMENTS="minimal? ( foo bar )" to set a list of USE flags to |
43 |
disable if minimal USE flag is enabled. Combined to EAPI-1 auto-enabled |
44 |
USE flags, it could help disabling all auto-enabled USE flags for some |
45 |
uses... That's just an idea. |
46 |
|
47 |
I'm not writing a GLEP draft so don't try to found an issue in the |
48 |
syntax used, it's only to know if this kind of feature will be |
49 |
appreciated by other users/devs than me and if it could be added to |
50 |
EAPI-4 and worth to work on it. |
51 |
I can write the GLEP and implement the feature in portage. |
52 |
|
53 |
[1] http://www.exherbo.org/docs/exheres-for-smarties.html#myoptions |
54 |
|
55 |
Thanks, |
56 |
Mounir |