1 |
begin quote |
2 |
On Fri, 21 Nov 2003 18:18:04 -0800 |
3 |
Jason Rhinelander <jason@××××××××××××××××.com> wrote: |
4 |
|
5 |
> I have a question regarding the gtk/gtk2 use flags - I recall a |
6 |
> discussion recently that, if memory serves, basically said "gtk2 |
7 |
> should be completely ignored if -gtk is present." |
8 |
|
9 |
Yes. The logic should be : |
10 |
|
11 |
|
12 |
if ( use gtk ) |
13 |
then ( use gtk2 ) |
14 |
do gtk 2.x stuff |
15 |
else |
16 |
do gtk 1.2 stuff |
17 |
fi |
18 |
|
19 |
So it should never even consider the "gtk2" USE flag if "-gtk" is an |
20 |
option. |
21 |
|
22 |
However, in cases where there is a choice of : |
23 |
gtk 1.2 or gtk 2 , and nothing else, then the "gtk2" flag is the -only- |
24 |
variable to be checked, as it doesn't matter if the user sets "gtk" or |
25 |
not. its a "hard" dependency. |
26 |
|
27 |
|
28 |
|
29 |
> Did I misinterpret this? Shouldn't USE="-gtk gtk2" be acceptable? It |
30 |
> seems to me that "gtk" is used to say "I want gtk support when it is |
31 |
> optional" and "gtk2" means "When both gtk-1 and gtk-2 support is |
32 |
> available, use gtk2." So, to this end, "-gtk gtk2" should mean "if a |
33 |
> package doesn't require gtk (of any version), don't build it. If it |
34 |
> does require gtk, use gtk2 support if possible." |
35 |
|
36 |
No, "-gtk gtk2" Should mean " Dont ever build me a gtk interface. |
37 |
But if a program has only gtk 1.2 or 2.0 , choose 2.0. |
38 |
|
39 |
|
40 |
However, in almost all the cases I've pointed out here, the whole logic |
41 |
tree is flawed, and DEPEND point at both, no matter what. |
42 |
|
43 |
in the case where a program has only "gtk" and "gtk2" support. (Sylpheed |
44 |
+ gtk2 patch for example ) The logic will look like this : |
45 |
|
46 |
# We need gtk, so we assume it is set. |
47 |
DEPEND="gtk2? ( =x11-libs/gtk+-2.0* ) |
48 |
!gtk2? ( =x11-libs/gtk+-1.2* ) |
49 |
other/deps " |
50 |
|
51 |
|
52 |
src_compile () { |
53 |
use gtk2 && myconf="--with-gtk=2" || myconf="--with-gtk=1.2" |
54 |
} |
55 |
|
56 |
------ |
57 |
|
58 |
However, if we have curses, gtk and gtk2 the tree must look like this: |
59 |
|
60 |
DEPEND="gtk? ( |
61 |
gtk2? ( =x11-libs/gtk+-2.0* ) |
62 |
!gtk2? ( =x11-libs/gtk+-1.2* ) |
63 |
) |
64 |
!gtk ( sys-libs/ncurses )" |
65 |
|
66 |
src_compile () { |
67 |
if [ `use gtk`] ; then |
68 |
use gtk2 && myconf="--with-ui=gtk2" || myconf="--with-ui=gtk1" |
69 |
else |
70 |
myconf="--with-ui=curses" |
71 |
fi |
72 |
} |
73 |
|
74 |
|
75 |
In a case like this USE="-gtk gtk2" will be undefined, and if the |
76 |
ebuild has logic that allows this combination, it is -broken- |
77 |
|
78 |
|
79 |
|
80 |
> |
81 |
> Did I misunderstand the previous discussion, or is the above |
82 |
> assumption correct? |
83 |
|
84 |
I hope the current explination shows it well enough. |
85 |
|
86 |
|
87 |
Correct behaviour is that "gtk2" is a -PREFERENCE- flag. If you set it, |
88 |
you indicate that if given the choice between old and new, you choose |
89 |
new. |
90 |
|
91 |
gtk2 is not an -enabling- flag. if you have "gtk+ 2.0 based, or qt |
92 |
based" Then you should -NOT- use gtk2 USE flag, but "gtk" USE flag. |
93 |
|
94 |
|
95 |
I hope I'm not confusing people further. |
96 |
|
97 |
|
98 |
//Spider |
99 |
-- |
100 |
begin .signature |
101 |
This is a .signature virus! Please copy me into your .signature! |
102 |
See Microsoft KB Article Q265230 for more information. |
103 |
end |