Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 39931 - wxGTK needs to be slotted on the "gtk2" USE-flag
Summary: wxGTK needs to be slotted on the "gtk2" USE-flag
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Gentoo wxWidgets project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 51749
  Show dependency tree
 
Reported: 2004-01-30 20:23 UTC by bdonlan
Modified: 2004-08-19 09:34 UTC (History)
7 users (show)

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


Attachments
wxwidgets.eclass (wxwidgets.eclass,959 bytes, text/plain)
2004-07-28 13:34 UTC, Rob Cakebread (RETIRED)
Details
wxGTK-2.4.2-r2.ebuild (wxGTK-2.4.2-r2.ebuild,3.43 KB, text/plain)
2004-07-28 13:35 UTC, Rob Cakebread (RETIRED)
Details
bochs-2.1.1-r1.ebuild (bochs-2.1.1-r1.ebuild,2.27 KB, text/plain)
2004-07-28 13:36 UTC, Rob Cakebread (RETIRED)
Details
audacity-1.2.1.ebuild (audacity-1.2.1.ebuild,2.09 KB, text/plain)
2004-07-28 13:36 UTC, Rob Cakebread (RETIRED)
Details
wxwidgets.eclass (wxwidgets.eclass,1.06 KB, text/plain)
2004-07-29 14:29 UTC, Rob Cakebread (RETIRED)
Details
wxGTK-2.4.2-r2.ebuild (wxGTK-2.4.2-r2.ebuild,3.33 KB, text/plain)
2004-07-29 14:30 UTC, Rob Cakebread (RETIRED)
Details
bochs-2.1.1-r1.ebuild (bochs-2.1.1-r1.ebuild,2.11 KB, text/plain)
2004-07-29 14:34 UTC, Rob Cakebread (RETIRED)
Details
audacity-1.2.1.ebuild (audacity-1.2.1.ebuild,2.07 KB, text/plain)
2004-07-29 14:35 UTC, Rob Cakebread (RETIRED)
Details
amule-2.0.0_rc5.ebuild (amule-2.0.0_rc5.ebuild,1.31 KB, text/plain)
2004-07-29 14:35 UTC, Rob Cakebread (RETIRED)
Details
wxwidgets.eclass (wxwidgets.eclass,1.08 KB, text/plain)
2004-07-29 16:49 UTC, Rob Cakebread (RETIRED)
Details
amule 2.0.0 rc5 ebuild (amule-2.0.0_rc5.ebuild,1.48 KB, text/plain)
2004-07-29 17:17 UTC, Giacomo Perale
Details
amule-2.0.0_rc5.ebuild (amule-2.0.0_rc5.ebuild,1.64 KB, text/plain)
2004-07-29 18:02 UTC, Giacomo Perale
Details
amule-2.0.0_rc5.ebuild (amule-2.0.0_rc5-r1.ebuild,1.55 KB, text/plain)
2004-07-31 20:02 UTC, Giacomo Perale
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bdonlan 2004-01-30 20:23:51 UTC
wxGTK when compiled with the "gtk2" USE-flag is incompatible with applications compiled against a wxGTK without a "gtk2" USE-flag. wxGTK should be slotted so both -gtk2 and +gtk2 versions can be installed simeltaneously, thus allowing programs using each version to coexist.
Comment 1 SpanKY gentoo-dev 2004-01-31 12:28:27 UTC
changing a SLOT doesnt mean the package will magically start working the way you want it to ...

we'd have to move around libraries so that the GTK1 ones dont overwrite the GTK2 ones ... why not re-emerge the ones that are breaking ?
Comment 2 bdonlan 2004-01-31 14:15:22 UTC
They already have different names - libwx_gtk_* vs libwx_gtk2_* IIRC. I don't know of a way to identify which *installed* packages depend on wxGTK, so I can't easily remerge them. For now, I've switched wxGTK and wxPython back to gtk [wxPython failed to tell me that changing wxGTK would break things when it told me to switch it...]
Comment 3 Mart Raudsepp gentoo-dev 2004-03-18 12:38:11 UTC
The reason why you can't have multiple instances of wxWidgets (formerly known as wxWindows) easilly installed is wx-config. Maybe we could append the version to wx-config and write a wrapper named wx-config :?
Though the possibility of a wrapper sounds quite impossible as configuration scripts just call it, perhaps we could sed/patch programs using wxGTK use a different wx-config, let's say wx-config-gtk2 if a gtk2 USE flag is there?

The same goes for unicode builds too.

wx-config-gtk2-uni, wx-config gtk1-uni, wx-config-gtk2, wx-config-gtk1 (default, wx-config symlinks to it?)... ?
Comment 4 Alo Sarv 2004-03-27 13:54:20 UTC
Actually, you _can_ have multiple wxWidgets libraries installed w/o any problems, _as_long_ as you do not install dynamic/static versions over each other. Proof:

ls -l /data/wx/dynamic/2.5.2/bin
lrwxr-xr-x    1 madcat   users          21 Mar 26 07:26 wx-config -> wxx11univd-2.4-config
-rwxr-xr-x    1 madcat   users        5075 Mar 26 05:04 wxgtk-2.4-config
-rwxr-xr-x    1 madcat   users        5240 Mar 26 05:10 wxgtk2-2.4-config
-rwxr-xr-x    1 madcat   users        5239 Mar 26 05:24 wxgtk2d-2.4-config
-rwxr-xr-x    1 madcat   users        5245 Mar 26 05:15 wxgtk2u-2.4-config
-rwxr-xr-x    1 madcat   users        5244 Mar 26 05:28 wxgtk2ud-2.4-config
-rwxr-xr-x    1 madcat   users        5074 Mar 26 05:19 wxgtkd-2.4-config
-rwxr-xr-x    1 madcat   users        5087 Mar 26 07:26 wxx11univd-2.4-config

All working together. There is no need to write some wrapper for wx-config script, since there already is separate wx**-config for each wxWidgets library installed.
Comment 5 Alastair Tse (RETIRED) gentoo-dev 2004-03-28 07:45:07 UTC
if someone can come up with a robust scheme for doing this. i'm not a fan of splitting it up into multiple packages.
Comment 6 Vaclav Slavik 2004-06-30 12:41:57 UTC
> if someone can come up with a robust scheme for doing this. i'm not a fan of 
> splitting it up into multiple packages.

Why? It is still the same package, only configured differently. Why don't you install both (say) gtk1 and gtk2 versions side by side instead (only if gtk2 flag is used, of course)? There are packages that can work with *any* build of wxGTK, e.g. poEdit, and having multiple packages  for same wxGTK library would make writing ebuilds for them quite a hell. That would take care of bug #55658  as well.
Comment 7 Rob Cakebread (RETIRED) gentoo-dev 2004-07-28 13:31:02 UTC
I think I've come up with a solution. If any of you could test this out and give feedback, I'd appreciate it.

I've attached a wxGTK-2.4.2-r2.ebuild which can build up to three libraries:
gtk1, gtk2 or gtk2 with unicode.
All three can be installed at once, or any 1 or 2, or their debug versions.

To get all three versions compiled, emerge it with USE='gtk1 gtk2 unicode"
(The gtk1 flag isn't official and will probably be changed soon)

I've created a wxwidgets eclass (see attachment) and two test ebuilds that use the eclass. app-emulation/bochs and media-sound/audacity. 

To use the eclass you "inherit wxwidgets" then use one of the following:
need-wxwidgets wx-gtk1 (for gtk)
need-wxwidgets wx-gtk2 (for gtk2)
need-wxwidgets wx-gtk2u (for gtk2 with unicode)

This will then set $WX_CONFIG to the proper /usr/bin/wxgtk-*-config so most wxGTK apps' configure script will pick it up.

If you only have debug versions installed, the eclass will find it automatically, theres no separate wx-gtk2d use flag etc.



Comment 8 Rob Cakebread (RETIRED) gentoo-dev 2004-07-28 13:34:29 UTC
Created attachment 36345 [details]
wxwidgets.eclass
Comment 9 Rob Cakebread (RETIRED) gentoo-dev 2004-07-28 13:35:24 UTC
Created attachment 36346 [details]
wxGTK-2.4.2-r2.ebuild
Comment 10 Rob Cakebread (RETIRED) gentoo-dev 2004-07-28 13:36:11 UTC
Created attachment 36347 [details]
bochs-2.1.1-r1.ebuild
Comment 11 Rob Cakebread (RETIRED) gentoo-dev 2004-07-28 13:36:49 UTC
Created attachment 36348 [details]
audacity-1.2.1.ebuild
Comment 12 Aaron Peterson 2004-07-28 17:52:27 UTC
unicode is my concern
Comment 13 Rob Cakebread (RETIRED) gentoo-dev 2004-07-29 14:29:24 UTC
Created attachment 36419 [details]
wxwidgets.eclass
Comment 14 Rob Cakebread (RETIRED) gentoo-dev 2004-07-29 14:30:41 UTC
Created attachment 36420 [details]
wxGTK-2.4.2-r2.ebuild
Comment 15 Rob Cakebread (RETIRED) gentoo-dev 2004-07-29 14:34:27 UTC
Created attachment 36421 [details]
bochs-2.1.1-r1.ebuild
Comment 16 Rob Cakebread (RETIRED) gentoo-dev 2004-07-29 14:35:12 UTC
Created attachment 36423 [details]
audacity-1.2.1.ebuild
Comment 17 Rob Cakebread (RETIRED) gentoo-dev 2004-07-29 14:35:55 UTC
Created attachment 36424 [details]
amule-2.0.0_rc5.ebuild
Comment 18 Rob Cakebread (RETIRED) gentoo-dev 2004-07-29 14:45:20 UTC
I've simplified wxwidgets.eclass to use the existing gtk, gtk2 or unicode flags instead of new USE flags. Installing wxGTK will always install the gtk version by default, and optionally gtk2 and gtk2+unicode.

amule only works with gtk1, and simply needs:
inherit wxwidgets
need-wxwidgets gtk (in src_compile)

Audacity and Bochs don't work with unicode but can use gtk or gtk2.
Check the attached ebuilds for examples of using the wxwidgets eclass to take care of this.

There are currently two USE flags in /usr/portage/profiles/use.desc, wxwin and wxwindows, both should be removed and replaced with 'wxwidgets'.

Comments welcomed.
Comment 19 Giacomo Perale 2004-07-29 16:30:19 UTC
aMule is being tested against gtk2 with masked development snapshot wxGTK 2.5.1 and it seems to work flawlessy for many users, so it could be useful to add a gtk2 USE with a dependency to wxGTK 2.5.1.
Could this be done with this new eclass? I read a "export wxgtk_ver=2.4", could this cause problems?
Comment 20 Rob Cakebread (RETIRED) gentoo-dev 2004-07-29 16:42:41 UTC
>> I read a "export wxgtk_ver=2.4", could this cause problems?

Yes, it will. Its easy to fix though since wxGTK-2.5 will install a /usr/bin/wxconfig-2.5-config. I'll add a function to the eclass to detect if you're running 2.4 or 2.5 and grab the right one.

p.s. I'll add a hard masked 2.5.2 since that is the current development version.

Comment 21 Rob Cakebread (RETIRED) gentoo-dev 2004-07-29 16:49:51 UTC
Created attachment 36442 [details]
wxwidgets.eclass

This will detect 2.4 or 2.5 now using:
local wxgtk_ver=`/usr/bin/wx-config --release`

instead of:
local wxgtk_ver='2.4'
Comment 22 Giacomo Perale 2004-07-29 17:17:00 UTC
Created attachment 36443 [details]
amule 2.0.0 rc5 ebuild

I haven't tried yet but it should be ok, amule-2.0.0_rc5.ebuild with gtk2 USE.

wxGTK 2.5.2 is very different from wxGTK 2.5.1 and AFAIK amule don't work with
it, so it would be better to leave 2.5.1 in portage too, and I I've made amule
depend from =x11-libs/wxGTK-2.5.1 instead of >=x11-libs/wxGTK-2.5.1
Comment 23 Giacomo Perale 2004-07-29 18:02:36 UTC
Created attachment 36448 [details]
amule-2.0.0_rc5.ebuild

Added a check in pkg_setup to avoid use of both remote and gtk2 USEs, but I'm
not so sure this is the best place to put it.
Comment 24 Giacomo Perale 2004-07-31 20:02:40 UTC
Created attachment 36552 [details]
amule-2.0.0_rc5.ebuild

fixed wxwidgets.eclass-compliant aMule 2.0.0rc5 ebuild.

tested with wxGTK 2.5.1
Comment 25 Giacomo Perale 2004-08-05 11:09:39 UTC
tested with wxGTK 2.4.2 too, at present I've got wxPython and vlc compiled with wxGTK linked to gtk2 and amule compiled with wxgtk linked to gtk1. No problem for now.

P.S. for vlc no need of workaround like in amule ebuild, configure uses right version just adding "need-wxwidgets gtk" or "need-wxwidgets gtk2" to the ebuild.
Comment 26 Rob Cakebread (RETIRED) gentoo-dev 2004-08-06 21:39:19 UTC
Ok, the new wxwidgets eclass and wxGTK-2.4.2-r2 are in CVS now. The eclass has more informative error messages. You can have these combinations installed:
Just gtk:
USE='-gtk2'
gtk2 and gtk:
USE='gtk2'
gtk2 and unicode:
USE='gtk2 unicode'
If you don't want gtk use USE='no_wxgtk1'. 
(or alternately 'debug' versions)

I added a local use flag to wxGTK (no_wxgtk1) which should give the ultimate flexibility without messing with the intent of the global gtk and gtk2 flags. 

Giacomo, your last version of amule doesn't look right. If you want to allow any of the three versions (gtk, gtk2 or unicode(gtk2)) change your src_compile like this:

if ! use gtk2; then 
      	    need-wxwidgets gtk || die "gtk version of wxGTK not emerged"
elif use unicode; then
	    need-wxwidgets unicode || die "unicode version of wxGTK not emerged"
else use gtk2; then
	    need-wxwidgets gtk2 || die "gtk2 version of wxGTK not emerged"
fi

Make sense?
Comment 27 Giacomo Perale 2004-08-07 02:11:35 UTC
Yes, my fault. I'll submit an ebuild with all three cases in a new bug report. wxGTK 2.5.1 ebuild should be upgraded too. :)
Comment 28 Genady Okrain 2004-08-10 08:11:35 UTC
What about bittornado? i can't start the gui :(

wxPython is either not installed or has not been installed properly.
Traceback (most recent call last):
  File "/usr/bin/btdownloadgui.py", line 24, in ?
    sys.exit(1)
NameError: name 'sys' is not defined
Comment 29 Giacomo Perale 2004-08-10 09:31:32 UTC
try re-emerging wxpython with the USEs you prefer and then re-emerging bittornado

+gtk2 works for me
Comment 30 Genady Okrain 2004-08-10 09:58:14 UTC
nope its not working :(
Comment 31 Giacomo Perale 2004-08-10 13:30:31 UTC
Don't know why, it works for me, http://ghepeu.altervista.org/immagini/bittornado.jpg

root@KazeNoTani ghepeu # etcat -u wxpython
[ Colour Code : set unset ]
[ Legend   : (U) Col 1 - Current USE flags        ]
[          : (I) Col 2 - Installed With USE flags ]

 U I [ Found these USE variables in : dev-python/wxpython-2.4.2.4 ]
 + + gtk2    : Use gtk+-2.0.0 over gtk+-1.2 in cases where a program supports both.
 - - unicode : Adds support for Unicode
 + + opengl  : Adds support for OpenGL
 + + tiff    : Adds support for the tiff image format
 + + jpeg    : Adds JPEG image support
 + + png     : Adds support for libpng (PNG images)
root@KazeNoTani ghepeu # etcat -u bittornado
[ Colour Code : set unset ]
[ Legend   : (U) Col 1 - Current USE flags        ]
[          : (I) Col 2 - Installed With USE flags ]

 U I [ Found these USE variables in : net-p2p/bittornado-0.3.7 ]
 + + X : Adds support for X11


try a revdep-rebuild.
Comment 32 Rob Cakebread (RETIRED) gentoo-dev 2004-08-10 14:59:48 UTC
Genady, what happens when you do this from the shell? Any error message?
python -c "from wxPython.wx import *"
Comment 33 Joël 2004-08-11 00:58:55 UTC
Just a question: can these wxGTK improvements solve that bug ?  (http://bugs.gentoo.org/show_bug.cgi?id=58284)

I haven't been able to compile mkvtoolnix with a unicode-enabled wxGTK so far
Comment 34 Rob Cakebread (RETIRED) gentoo-dev 2004-08-11 10:03:00 UTC
Jo
Comment 35 Rob Cakebread (RETIRED) gentoo-dev 2004-08-11 10:03:00 UTC
Joël, I uploaded a new ebuild and patch for mkvtoolnix on bug #58284. Thanks for the info.
Comment 36 Genady Okrain 2004-08-11 11:51:19 UTC
nm
I found the problem it was bad GTK
Comment 37 Rob Cakebread (RETIRED) gentoo-dev 2004-08-19 09:34:16 UTC
Closing this. If you find any packages that should use the new wxwidgets eclass please file a separate bug.