Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: Brian Dolbec <dolsen@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] Global USE=gui
Date: Thu, 09 Jun 2016 16:32:41
Message-Id: 20160609183224.55697534.mgorny@gentoo.org
In Reply to: Re: [gentoo-dev] [RFC] Global USE=gui by Brian Dolbec
1 On Tue, 7 Jun 2016 12:03:16 -0700
2 Brian Dolbec <dolsen@g.o> wrote:
3
4 > We instead implement something along the lines of:
5 >
6 > an ordered list of the gui toolkits in their preferred order of
7 > desirability. This should be an all inclusive list. Note: these are
8 > subject to package.use setting overrides.
9 >
10 > PREFERRED_GUIS="gtk2 qt4 qt5 x wxwidgets X ... ncurses tty -gkt3"
11 >
12 > In the above it means that if gtk2 is an option, then choose it, mask
13 > (de-select) the others.
14 > In there it also means DO NOT SELECT gtk3!!!! So if you want a pkg and
15 > it NEEDS gtk3, then the PM will puke it back at you saying you can't
16 > have one without the other...
17 > So, then you have to fix it manually via package.use settings. Accept
18 > gtk3 for this pkg only (not that it doesn't likely have other gtk3
19 > deps that will also need this...)
20 >
21 > In the general case it will pick the first toolkit in order of
22 > preference (left to right) and only that toolkit that the pkg is capable
23 > of using.
24 >
25 > For pkgs capable of multiple simultaneous toolkits installed, then
26 > again, manual intervention would be needed to set package.use.
27 >
28 > This would also have to be a package manager feature and run similar to
29 > the auto-unmask feature.
30 >
31 > FEATURES="preferred-guis"
32 >
33 > Let's try and keep things as simple as possible.
34 > From what I've gleaned form the emails I have read, is that what the
35 > general user wants to happen, select the toolkit in the order of their
36 > preference.
37
38 Could we please try to stay generic and not invent specific ugly hacks
39 for specific hardcoded flag names? We're trying hard to kill those
40 things, and I'd really feel bad if Portage got more of them.
41
42
43 That said, I think we could go with some generic idea like this
44 (assumes new GUI expand is being used):
45
46 1. Packages use IUSE defaults to set the preferred GUI:
47
48 IUSE="gui_gtk2 +gui_gtk3 ..."
49
50 2. Packages use REQUIRED_USE to force an appropriate choice.
51
52 3. The default is GUI="", and users who don't care get the choice taken
53 by IUSE defaults.
54
55 4. For those who care, we implement one of the two mechanisms. Either:
56
57 a. flag preference lists -- i.e. something like '|| ( gtk3 gtk2 ... )'
58 in package.use,
59
60 b. or flag 'toggling' notes -- like 'gtk3 -gtk2~ -qt5~~ ...'.
61
62 Both solutions provide directions for the PM in case REQUIRED_USE
63 constraints fail.
64
65
66 I think the preference lists are more obvious. For example:
67
68 */* GUI: || ( gtk3 gtk2 )
69
70 would mean that by default GUI=gtk3. However, if a package fails to
71 meet REQUIRED_USE, it is retried with GUI=gtk2. If that one fails as
72 well, user is asked to take action.
73
74 The main problem I see with this, is how to combine multiple
75 package.use entries (i.e. the global flags with local flags).
76
77
78 The 'toggling' notes are a little more complex. Basically, the idea is
79 that '~' indicator means that the flag can be toggled in order to
80 attempt to solve REQUIRED_USE. The more '~'s, the less preferred
81 toggling is. For example:
82
83 */* GUI: gtk3 qt5~ -gtk2~~
84
85 means that:
86
87 a) gtk3 is always ON, and can't be toggled (however, it may not be
88 in IUSE),
89
90 b) qt5 is ON by default but can be toggled off if REQUIRED_USE conflict
91 occurs,
92
93 c) gtk2 is OFF by default but can be toggled on (as second attempt) if
94 REQUIRED_USE fails.
95
96 Basically the idea is that PM tries the default set first, then
97 attempts to toggle flags with '~', then with '~~', then possibly '~' +
98 '~~'...
99
100 In this case, the idea would be that the user prefers having both gtk3
101 and qt5. But if that's impossible, he prefers gtk3 only. if that's
102 impossible, PM should try 'gtk3 qt5 gtk2', then 'gtk3 gtk2'... And if
103 all '~'s don't help, REQUIRED_USE is left for user invention.
104
105 --
106 Best regards,
107 Michał Górny
108 <http://dev.gentoo.org/~mgorny/>

Replies

Subject Author
Re: [gentoo-dev] [RFC] Global USE=gui Ulrich Mueller <ulm@g.o>