Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 30968 - Wrong use of gtk and gtk2 USE flags in freeciv (all versions)
Summary: Wrong use of gtk and gtk2 USE flags in freeciv (all versions)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-12 05:59 UTC by Sven Blumenstein (RETIRED)
Modified: 2003-10-13 15:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Freeciv-gtk.patch (Freeciv-gtk.patch,1.63 KB, patch)
2003-10-12 14:54 UTC, Spider (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Blumenstein (RETIRED) gentoo-dev 2003-10-12 05:59:01 UTC
Hi,
I just noticed that the USE of gtk and gtk2 USE flags is wrong in freeciv. 
From use.desc:

gtk - Adds support for x11-libs/gtk+ (The GIMP Toolkit)
gtk2 - Use gtk+-2.0.0 over gtk+-1.2 in cases where a program supports both. 

And here's what happens (gtk2 is already installed on my system):

root@mel freeciv # USE="gtk gtk2" emerge -p freeciv

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] x11-libs/gtk+-1.2.10-r10  
[ebuild  N    ] media-libs/giflib-4.1.0-r3  
[ebuild  N    ] media-libs/tiff-3.6.0  
[ebuild  N    ] media-libs/imlib-1.9.14-r1  
[ebuild  N    ] games-strategy/freeciv-1.14.1_beta1  

root@mel freeciv # USE="gtk" emerge -p freeciv

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] x11-libs/gtk+-1.2.10-r10  
[ebuild  N    ] media-libs/giflib-4.1.0-r3  
[ebuild  N    ] media-libs/tiff-3.6.0  
[ebuild  N    ] media-libs/imlib-1.9.14-r1  
[ebuild  N    ] games-strategy/freeciv-1.14.1_beta1  

^[[Aroot@mel freeciv # USE="-gtk gtk2" emerge -p freeciv

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild  N    ] games-strategy/freeciv-1.14.1_beta1  

root@mel freeciv # 

Expected result is:

USE="gtk" emerge freeciv should emerge with gtk 1.x interface
USE="gtk2" emerge freeciv should emerge with no interface (server only mode)
USE="gtk gtk2" emerge freeciv should emerge with gtk 2.x interface
USE="-gtk gtk2" emerge freeciv should emerge with no interface (server only mode)
USE="-gtk -gtk2" emerge freeciv should emerge with no interface (server only mode)
Comment 1 Spider (RETIRED) gentoo-dev 2003-10-12 14:54:03 UTC
Created attachment 19148 [details, diff]
Freeciv-gtk.patch

This is a patch against the ebuild that should fix the logic. The flow diagram
for depencenies in this case are :
want gtk?
  do I prefer gtk2?  -- enable gtk2 , disable gtk 1.2
  do I not prefer gtk2?  -- enable gtk 1.2 , disable gtk2 
not?
   disable both.
Comment 2 David Nielsen 2003-10-12 15:47:10 UTC
I was informed once when I asked Lisa to do the same on the distcc ebuild
that it is, the by the developers, preferred way of doing things.

gtk to indicated gtk support
gtk2 to indicated preference of gtk2 over gtk1 when you have a choice.

Thus we can't set -gtk +gtk2 to get a gtk1 free system, since we use gtk
to indicate the use of any kind of gtk and only gtk2 when there's a doubt
which version the user wants. I tried lobbying at that time to have it changed
but I didn't have much luck sadly.

Sorry,

- Lovechild
Comment 3 SpanKY gentoo-dev 2003-10-12 16:04:42 UTC
yeah, it does seem the current gtk1/gtk2 setup is a little screwy ...
i think a better definition would be to have 3 gtk USE flags:
gtk: i want gtk baby !
gtk1: i prefer gtk1
gtk2: i prefer gtk2

if you feel like lobbying for something, i would suggest that ... start it
up on the gentoo-dev mailing list

for now, freeciv wont change ... that is, if you have gtk2 in your USE flags,
you're gonna get gtk2 support
Comment 4 Spider (RETIRED) gentoo-dev 2003-10-12 22:21:37 UTC
Actually This is just the case where we want gtk2 USE flag to work as documented.
 

In cases where -multiple- gtk interfaces are avaiable, the gtk2 flag decides
-which- of the two to be installed.

In cases where there just is gtk 2 or nothing, it will do just nothing, because
the gtk USE flag will decide which of them to use.

prettier logic would be this:

use gtk && use gtk2 \
		&& myconf="${myconf} --enable-client=gtk-2.0" \
		|| myconf="${myconf} --disable-client=gtk-2.0"
use gtk \
		&& myconf="${myconf} --enable-client=gtk --enable-gtktest" \
		|| myconf="${myconf} --disable-client=gtk --disable-gtktest" 
Comment 5 Sven Blumenstein (RETIRED) gentoo-dev 2003-10-12 23:33:43 UTC
>for now, freeciv wont change ... that is, if you have gtk2 in your USE flags,
>you're gonna get gtk2 support

You noticed that you _have_ to set '-gtk gtk2' to get gtk2 in freeciv?
That breaks almost all other apps I have installed here which support either
two gtk version or gtk2 as an additional interface.

Best example: distcc 

If I set USE='-gtk gtk2' to get a updated freeciv (with gtk2), I have to
change my USE flags again to get the gtk2 GUI in distcc. Doesnt sound like
the best solution IMO.

Comment 6 SpanKY gentoo-dev 2003-10-13 15:12:21 UTC
fixed in cvs then ...
    if [ `use gtk2` ] ; then
        myconf="${myconf} --enable-client=gtk-2.0 --enable-gtktest"
    elif [ `use gtk` ] ; then
        myconf="${myconf} --enable-client=gtk --enable-gtktest"
    else
        myconf="${myconf} --disable-client --disable-gtktest"
    fi