On Tue, 7 Jun 2016 12:03:16 -0700 Brian Dolbec <dol...@gentoo.org> wrote:
> We instead implement something along the lines of: > > an ordered list of the gui toolkits in their preferred order of > desirability. This should be an all inclusive list. Note: these are > subject to package.use setting overrides. > > PREFERRED_GUIS="gtk2 qt4 qt5 x wxwidgets X ... ncurses tty -gkt3" > > In the above it means that if gtk2 is an option, then choose it, mask > (de-select) the others. > In there it also means DO NOT SELECT gtk3!!!! So if you want a pkg and > it NEEDS gtk3, then the PM will puke it back at you saying you can't > have one without the other... > So, then you have to fix it manually via package.use settings. Accept > gtk3 for this pkg only (not that it doesn't likely have other gtk3 > deps that will also need this...) > > In the general case it will pick the first toolkit in order of > preference (left to right) and only that toolkit that the pkg is capable > of using. > > For pkgs capable of multiple simultaneous toolkits installed, then > again, manual intervention would be needed to set package.use. > > This would also have to be a package manager feature and run similar to > the auto-unmask feature. > > FEATURES="preferred-guis" > > Let's try and keep things as simple as possible. > From what I've gleaned form the emails I have read, is that what the > general user wants to happen, select the toolkit in the order of their > preference. Could we please try to stay generic and not invent specific ugly hacks for specific hardcoded flag names? We're trying hard to kill those things, and I'd really feel bad if Portage got more of them. That said, I think we could go with some generic idea like this (assumes new GUI expand is being used): 1. Packages use IUSE defaults to set the preferred GUI: IUSE="gui_gtk2 +gui_gtk3 ..." 2. Packages use REQUIRED_USE to force an appropriate choice. 3. The default is GUI="", and users who don't care get the choice taken by IUSE defaults. 4. For those who care, we implement one of the two mechanisms. Either: a. flag preference lists -- i.e. something like '|| ( gtk3 gtk2 ... )' in package.use, b. or flag 'toggling' notes -- like 'gtk3 -gtk2~ -qt5~~ ...'. Both solutions provide directions for the PM in case REQUIRED_USE constraints fail. I think the preference lists are more obvious. For example: */* GUI: || ( gtk3 gtk2 ) would mean that by default GUI=gtk3. However, if a package fails to meet REQUIRED_USE, it is retried with GUI=gtk2. If that one fails as well, user is asked to take action. The main problem I see with this, is how to combine multiple package.use entries (i.e. the global flags with local flags). The 'toggling' notes are a little more complex. Basically, the idea is that '~' indicator means that the flag can be toggled in order to attempt to solve REQUIRED_USE. The more '~'s, the less preferred toggling is. For example: */* GUI: gtk3 qt5~ -gtk2~~ means that: a) gtk3 is always ON, and can't be toggled (however, it may not be in IUSE), b) qt5 is ON by default but can be toggled off if REQUIRED_USE conflict occurs, c) gtk2 is OFF by default but can be toggled on (as second attempt) if REQUIRED_USE fails. Basically the idea is that PM tries the default set first, then attempts to toggle flags with '~', then with '~~', then possibly '~' + '~~'... In this case, the idea would be that the user prefers having both gtk3 and qt5. But if that's impossible, he prefers gtk3 only. if that's impossible, PM should try 'gtk3 qt5 gtk2', then 'gtk3 gtk2'... And if all '~'s don't help, REQUIRED_USE is left for user invention. -- Best regards, Michał Górny <http://dev.gentoo.org/~mgorny/>
pgp6_zPgu1PxE.pgp
Description: OpenPGP digital signature