begin  quote
On Fri, 21 Nov 2003 18:18:04 -0800
Jason Rhinelander <[EMAIL PROTECTED]> wrote:

> I have a question regarding the gtk/gtk2 use flags - I recall a 
> discussion recently that, if memory serves, basically said "gtk2
> should  be completely ignored if -gtk is present."

Yes. The logic should be :


if ( use gtk )
   then ( use gtk2 )
      do gtk 2.x stuff
   else
     do gtk 1.2 stuff
fi

So it should never even consider the "gtk2" USE flag if "-gtk" is an
option. 

However, in cases where there is a choice of :
gtk 1.2  or gtk 2 , and nothing else, then the "gtk2" flag is the -only-
variable to be checked, as it doesn't matter if the user sets "gtk" or
not. its a "hard" dependency.



> Did I misinterpret this?  Shouldn't USE="-gtk gtk2" be acceptable?  It
> seems to me that "gtk" is used to say "I want gtk support when it is 
> optional" and "gtk2" means "When both gtk-1 and gtk-2 support is 
> available, use gtk2."  So, to this end, "-gtk gtk2" should mean "if a 
> package doesn't require gtk (of any version), don't build it.  If it 
> does require gtk, use gtk2 support if possible."

No, "-gtk gtk2" Should mean " Dont ever build me a gtk interface. 
 But if a program has only gtk 1.2 or 2.0 , choose 2.0.


However, in almost all the cases I've pointed out here, the whole logic
tree is flawed, and DEPEND point at both, no matter what.

in the case where a program has only "gtk" and "gtk2" support. (Sylpheed
+ gtk2 patch for example )  The logic will look like this :

# We need gtk, so we assume it is set.
DEPEND="gtk2? ( =x11-libs/gtk+-2.0* )
        !gtk2? ( =x11-libs/gtk+-1.2* )
        other/deps "


src_compile () {
        use gtk2 &&  myconf="--with-gtk=2" || myconf="--with-gtk=1.2"
}

------

However, if we have curses, gtk and gtk2  the tree must look like this:

DEPEND="gtk? ( 
                gtk2? ( =x11-libs/gtk+-2.0* )
                !gtk2? (  =x11-libs/gtk+-1.2* )
        )
        !gtk ( sys-libs/ncurses )"

src_compile () {
        if [ `use gtk`] ; then
                use gtk2 && myconf="--with-ui=gtk2" || myconf="--with-ui=gtk1"
        else
                myconf="--with-ui=curses"
        fi
}


In a case like this USE="-gtk gtk2"  will be undefined, and if the
ebuild has logic that allows this combination, it is -broken-



> 
> Did I misunderstand the previous discussion, or is the above
> assumption correct?

I hope the current explination shows it well enough.


Correct behaviour is that "gtk2" is a -PREFERENCE- flag.  If you set it,
you indicate that if given the choice between old and new, you choose
new.

gtk2 is not an -enabling- flag.   if you have "gtk+ 2.0 based, or qt
based" Then you should -NOT- use gtk2 USE flag, but "gtk" USE flag.


   I hope I'm not confusing people further.


//Spider
-- 
begin  .signature
This is a .signature virus! Please copy me into your .signature!
See Microsoft KB Article Q265230 for more information.
end

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to