1 |
Rich Freeman posted on Sat, 12 Sep 2015 06:48:13 -0400 as excerpted: |
2 |
|
3 |
> On Sat, Sep 12, 2015 at 6:00 AM, Duncan <1i5t5.duncan@×××.net> wrote: |
4 |
>> |
5 |
>> Just bite the bullet and create entire USE flag families such that an |
6 |
>> ebuild can choose the flag appropriate to how it actually uses it. |
7 |
>> AFAIK this would need EAPI help, for reasons given below, but it should |
8 |
>> be doable. |
9 |
>> |
10 |
>> gui |
11 |
>> gui-gtk |
12 |
>> gui-gtk-2 |
13 |
>> gui-gtk-3 |
14 |
>> gui-qt |
15 |
>> gui-qt-4 |
16 |
>> gui-qt-5 |
17 |
> |
18 |
> I'm going to have to read the rest of your email about 14 times to fully |
19 |
> grok it, |
20 |
|
21 |
LOL. I started with a paragraph describing each setting, and very |
22 |
quickly decided /that/ wasn't going to work! I was "in a maze of twisty |
23 |
passages, all different!"[1] So I tried the matrix/table. That was bad |
24 |
enough, but at least with the table, I could cover all possibilities |
25 |
systematically without losing track of where I was. |
26 |
|
27 |
Luckily, the logic can be written once and used by many. Additionally, |
28 |
once setup, ordinary ebuild maintainers won't have to worry about the |
29 |
logic matrix, they'll simply setup the vars describing the candidates, |
30 |
call the function, get a result, and act on it. To ordinary ebuild |
31 |
maintainers it can be as effectively black-box as a call to any EAPI/PM |
32 |
supplied function is, today. |
33 |
|
34 |
> but one thing that strikes me about this approach, and perhaps |
35 |
> mine as well, is that this assumes that USE=-gui should imply USE="-gtk |
36 |
> -qt" or similar. |
37 |
> |
38 |
> What if qt or gtk is used for more than just the GUI. What if the |
39 |
> console version of the program still uses other functions in these |
40 |
> toolkits besides window decoration/etc? |
41 |
|
42 |
You're expanding my realm of possibilities here, thanks! =:^) |
43 |
|
44 |
Good point, particularly since qt5 is modularized with the specific |
45 |
intent of making it useful for CLI-only as well. Except that no, the |
46 |
proposal does /not/ necessarily assume USE=-gui means USE=-qt and -gtk as |
47 |
well. While my example had nothing suggesting CLI, keep in mind that |
48 |
these are effectively hierarchy flags, with gui-* used as the example. |
49 |
|
50 |
This was a (possibly abridged, there's other GUI toolkits...) example of |
51 |
the use and logic of the gui-* flags, but use of other flags and flag- |
52 |
families in the same ebuild would certainly be possible. Presumably one |
53 |
such flag (and perhaps eventually flag-family, if called for) could be |
54 |
cli-qt-5. |
55 |
|
56 |
Meanwhile, keep in mind that as described, the ebuild would set the |
57 |
candidates, then call a function which would return the selected |
58 |
candidates to build. But that doesn't prevent the ebuild from using |
59 |
further logic with other flags, etc. |
60 |
|
61 |
So taking your example, the ebuild would do the whole gui-* flag family |
62 |
thing as I described, get the results for that, and could then either do |
63 |
another family setup and get more results, or could throw in more |
64 |
conventional flags. And one such flag, possibly individual at first, |
65 |
wold be cli-qt-5, controlling this option separately. If later there |
66 |
were enough such flags to make a cli-* family, existing ebuilds using cli- |
67 |
qt-5 would continue to use that individual flag, while revision-bumps or |
68 |
new versions could start using the cli-* family, setting it up using UH-* |
69 |
variables and calling the function again, getting a CLI result which |
70 |
could be used, just as they got a GUI result to use. |
71 |
|
72 |
--- |
73 |
[1] https://en.wikipedia.org/wiki/Colossal_Cave_Adventure |
74 |
|
75 |
-- |
76 |
Duncan - List replies preferred. No HTML msgs. |
77 |
"Every nonfree program has a lord, a master -- |
78 |
and if you use the program, he is your master." Richard Stallman |