Rich Freeman posted on Sat, 12 Sep 2015 06:48:13 -0400 as excerpted:

> On Sat, Sep 12, 2015 at 6:00 AM, Duncan <1i5t5.dun...@cox.net> wrote:
>>
>> Just bite the bullet and create entire USE flag families such that an
>> ebuild can choose the flag appropriate to how it actually uses it. 
>> AFAIK this would need EAPI help, for reasons given below, but it should
>> be doable.
>>
>> gui
>> gui-gtk
>> gui-gtk-2
>> gui-gtk-3
>> gui-qt
>> gui-qt-4
>> gui-qt-5
> 
> I'm going to have to read the rest of your email about 14 times to fully
> grok it,

LOL.  I started with a paragraph describing each setting, and very 
quickly decided /that/ wasn't going to work!  I was "in a maze of twisty 
passages, all different!"[1]  So I tried the matrix/table.  That was bad 
enough, but at least with the table, I could cover all possibilities 
systematically without losing track of where I was.

Luckily, the logic can be written once and used by many.  Additionally, 
once setup, ordinary ebuild maintainers won't have to worry about the 
logic matrix, they'll simply setup the vars describing the candidates, 
call the function, get a result, and act on it.  To ordinary ebuild 
maintainers it can be as effectively black-box as a call to any EAPI/PM 
supplied function is, today.

> but one thing that strikes me about this approach, and perhaps
> mine as well, is that this assumes that USE=-gui should imply USE="-gtk
> -qt" or similar.
> 
> What if qt or gtk is used for more than just the GUI.  What if the
> console version of the program still uses other functions in these
> toolkits besides window decoration/etc?

You're expanding my realm of possibilities here, thanks! =:^)

Good point, particularly since qt5 is modularized with the specific 
intent of making it useful for CLI-only as well.  Except that no, the 
proposal does /not/ necessarily assume USE=-gui means USE=-qt and -gtk as 
well.  While my example had nothing suggesting CLI, keep in mind that 
these are effectively hierarchy flags, with gui-* used as the example.  

This was a (possibly abridged, there's other GUI toolkits...) example of 
the use and logic of the gui-* flags, but use of other flags and flag-
families in the same ebuild would certainly be possible.  Presumably one 
such flag (and perhaps eventually flag-family, if called for) could be 
cli-qt-5.

Meanwhile, keep in mind that as described, the ebuild would set the 
candidates, then call a function which would return the selected 
candidates to build.  But that doesn't prevent the ebuild from using 
further logic with other flags, etc.

So taking your example, the ebuild would do the whole gui-* flag family 
thing as I described, get the results for that, and could then either do 
another family setup and get more results, or could throw in more 
conventional flags.  And one such flag, possibly individual at first, 
wold be cli-qt-5, controlling this option separately.  If later there 
were enough such flags to make a cli-* family, existing ebuilds using cli-
qt-5 would continue to use that individual flag, while revision-bumps or 
new versions could start using the cli-* family, setting it up using UH-* 
variables and calling the function again, getting a CLI result which 
could be used, just as they got a GUI result to use.

---
[1] https://en.wikipedia.org/wiki/Colossal_Cave_Adventure

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


Reply via email to