Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Any good way to pick global USE flag alternatives?
Date: Mon, 09 Dec 2013 06:56:29
Message-Id: 52A56995.9040402@gmail.com
In Reply to: [gentoo-user] Any good way to pick global USE flag alternatives? by Nikos Chantziaras
1 On 09/12/2013 08:25, Nikos Chantziaras wrote:
2 > Can't come up with a more descriptive title for this one. The issue is
3 > this:
4 >
5 > There are some global USE flags that allow users to pick alternative
6 > methods of implementing the same thing. For example, packages that offer
7 > a GUI might do so through the "qt" or "gtk" USE flag. Or audio support,
8 > where you can choose "alsa" or "pulseaudio".
9 >
10 > Now, if I wanted to, for example, always choose PulseAudio support
11 > instead of ALSA and a Qt GUI instead of a Gtk+ one, one would think that
12 > I could just do:
13 >
14 > USE="pulseaudio qt -alsa -gtk"
15 >
16 > in my make.conf. But, that doesn't work. That's because some packages
17 > don't offer an alternative at all. Some package might only support ALSA
18 > for audio, and disabling that would lead to the package not offering any
19 > audio output at all. Or it might only offer a Gtk+ GUI, not a Qt one,
20 > and disabling the "gtk" flag will make the package not building its GUI
21 > component at all.
22 >
23 > So what's needed here, is a way to tell Portage to only disable a global
24 > USE flag for packages that also offer another one, specified by the
25 > user. Like this pseudo make.conf syntax:
26 >
27 > USE="pulseaudio pulseaudio?(-alsa) qt qt?(-gtk)"
28 >
29 > Is something like this already possible? Right now, the only way to
30 > painstakingly go through every single package that comes up on an
31 > 'USE=use_flags_here emerge -pDN @world' and insert them individually
32 > into package.use.
33 >
34 > There should be a proper way of doing this.
35
36
37 There is no extant way to do what you want to do. USE flags operate in
38 isolation and their end result is strictly limited to their own scope.
39
40 Doing what you suggest leads to horrible breakage as the flag is no
41 longer doing what you think it is doing, it is now possibly doing
42 something quite different.
43
44 Portage is already doing this properly.
45
46 The correct way to deal with this (if there is such a thing) is in the
47 package's own build system. That so few do such things is in itself telling.
48
49
50 --
51 Alan McKinnon
52 alan.mckinnon@×××××.com

Replies

Subject Author
[gentoo-user] Re: Any good way to pick global USE flag alternatives? Nikos Chantziaras <realnc@×××××.com>