1 |
On Mon, 09 Dec 2013 08:25:19 +0200 |
2 |
Nikos Chantziaras <realnc@×××××.com> wrote: |
3 |
|
4 |
> There are some global USE flags that allow users to pick alternative |
5 |
> methods of implementing the same thing. For example, packages that |
6 |
> offer a GUI might do so through the "qt" or "gtk" USE flag. Or audio |
7 |
> support, where you can choose "alsa" or "pulseaudio". |
8 |
> |
9 |
> Now, if I wanted to, for example, always choose PulseAudio support |
10 |
> instead of ALSA and a Qt GUI instead of a Gtk+ one, one would think |
11 |
> that I could just do: |
12 |
> |
13 |
> USE="pulseaudio qt -alsa -gtk" |
14 |
> |
15 |
> in my make.conf. But, that doesn't work. That's because some packages |
16 |
> don't offer an alternative at all. Some package might only support |
17 |
> ALSA for audio, and disabling that would lead to the package not |
18 |
> offering any audio output at all. Or it might only offer a Gtk+ GUI, |
19 |
> not a Qt one, and disabling the "gtk" flag will make the package not |
20 |
> building its GUI component at all. |
21 |
> |
22 |
> So what's needed here, is a way to tell Portage to only disable a |
23 |
> global USE flag for packages that also offer another one, specified |
24 |
> by the user. Like this pseudo make.conf syntax: |
25 |
> |
26 |
> USE="pulseaudio pulseaudio?(-alsa) qt qt?(-gtk)" |
27 |
> |
28 |
> Is something like this already possible? Right now, the only way to |
29 |
> painstakingly go through every single package that comes up on an |
30 |
> 'USE=use_flags_here emerge -pDN @world' and insert them individually |
31 |
> into package.use. |
32 |
> |
33 |
> There should be a proper way of doing this. |
34 |
|
35 |
I like this idea, I think it could be especially useful in the context |
36 |
of PYTHON_SINGLE_TARGET. |
37 |
|
38 |
I'm not sure I like all the details in the suggestion, though. In |
39 |
particular, the flags you mention have widely varying meaning throughout |
40 |
the tree, for example mkvtoolnix has wxwidgets and qt4 use flags that |
41 |
enable independent and completely different things. |
42 |
|
43 |
Perhaps it would be better to implement this as a new analogue to |
44 |
USE_EXPAND always expands to the first item in the user configuration |
45 |
that is also in IUSE for the package? This would then exclusively be |
46 |
used for "pick one of these options" style settings, like the gui of |
47 |
*some* packages, TLS implemetation, PYTHON_SINGLE_TARGET and so on. |
48 |
|
49 |
I think this could be preferable to the many packages that currently |
50 |
just arbitrarily picks one choice when two mutually exclusive flags are |
51 |
enabled. It might be necessary to expand this with some form of "light |
52 |
masking" for ebuilds that want to *strongly* suggest one choice over |
53 |
another. |
54 |
|
55 |
Example: |
56 |
User sets (in make.conf): |
57 |
TLS_IMPL_PREF="openssl gnutls" |
58 |
|
59 |
Ebuild with IUSE="tls_impl_pref_gnutls tls_impl_pref_openssl" sees |
60 |
tls_impl_pref_gnutls as disabled and tls_impl_pref_openssl as enabled. |
61 |
|
62 |
Ebuild with IUSE="tls_impl_pref_gnutls" sees tls_impl_pref_gnutls as |
63 |
enabled. |
64 |
|
65 |
-- |
66 |
eroen |