I have a newly-installed Ubuntu linux box that I''m planning to use for wxruby development (thanks for the advice on remote desktops from this group). However, turns out that Ubuntu comes with GTK2.0, annd wxwidgets 2.6 is reportedly better and easier to build than 2.4.2 against this. Before I set off on a potentially fruitless compiling journey, I was wondering if anyone had had any success with wxruby (not wx-swig) with GTK2.0? My plan was to: 0) figure out where to find gtk2-dev in the ubuntu repositories 1) compile wx 2.6.1 2) apply Dmitry''s patches to allow wxruby to build against 2.6.2 3) build and install wxruby Also, if I build Wx against GTK2.0, using --disable-shared --enable-static etc, will the compiled binary be usable on any Linux system (with suitable glibc), or will it only be usable on ones with GTK2 libraries? thanks alex
Alex Fenton wrote:> I have a newly-installed Ubuntu linux box that I''m planning to use for > wxruby development (thanks for the advice on remote desktops from this > group). However, turns out that Ubuntu comes with GTK2.0, annd > wxwidgets 2.6 is reportedly better and easier to build than 2.4.2 > against this.You can install both gtk+1.2 and gtk2.0 in Ubuntu, and which one is used by various apps is decided at build-time By default wx2.4 is built with gtk+1.2 while wx2.5 against gtk2.0 wx2.5.3 which is the closest to 2.6 in ubuntu since wx2.6 has not yet been packaged for debian, so its not in ubuntu either. apt-cache search wx will list you lots of packages related to wx pick the ones you need to install.Their names are inconsistent and confusing to me at list (wx25, libwxgtk etc.)> Before I set off on a potentially fruitless compiling journey, I was > wondering if anyone had had any success with wxruby (not wx-swig) with > GTK2.0? My plan was to: > > 0) figure out where to find gtk2-dev in the ubuntu repositoriesit''s called libgtk2.0-dev> 1) compile wx 2.6.1 > 2) apply Dmitry''s patches to allow wxruby to build against 2.6.2 > 3) build and install wxrubyAh ok so you''re building wx2.6 yourself.> Also, if I build Wx against GTK2.0, using --disable-shared > --enable-static etc, will the compiled binary be usable on any Linux > system (with suitable glibc), or will it only be usable on ones with > GTK2 libraries?I don''t know, I have never built wx from source. But you may want to disable unicode on that build since with the default 2.5.3 with unicode enabled and gtk2 I could not make wxruby-swig display any string.From what Nick and Kevin said it seems to be a ruby/unicode problem which is not easy to fix in wx. Jani
Jani Monoses wrote:> > You can install both gtk+1.2 and gtk2.0 in Ubuntu, and which one is used > by various apps is decided at build-time > By default wx2.4 is built with gtk+1.2 while wx2.5 against gtk2.0 > wx2.5.3 which is the closest to 2.6 in ubuntu since wx2.6 has not yet > been packaged for debian, so its not in ubuntu either.Thanks for the Ubuntu info. Yes, I would *strongly* recommend sticking to wx 2.4 for now, unless you actually want to be a pioneer who is actually doing the port to 2.6. There should be no problem having GTK+1.2 and GTK+2.0 on your system at the same time.> I don''t know, I have never built wx from source. > But you may want to disable unicode on that build since with the default > 2.5.3 with unicode enabled and gtk2 I could not make wxruby-swig display > any string.From what Nick and Kevin said it seems to be a ruby/unicode > problem which is not easy to fix in wx.Correct. As far as I am aware, nobody has successfully gotten wxRuby to work with a unicode build of wx. As a side note, I would like to remind everyone that the wxruby-swig build is the wxruby of the future. As far as I know, the swig version is as stable as 0.6.0, but just doesn''t support as many classes. Unless you really need those extra classes, I would prefer to see you using wxruby-swig. Cheers, Kevin
> > > Correct. As far as I am aware, nobody has successfully gotten wxRuby to > work with a unicode build of wx. > > As a side note, I would like to remind everyone that the wxruby-swig > build is the wxruby of the future. As far as I know, the swig version is > as stable as 0.6.0, but just doesn''t support as many classes. Unless you > really need those extra classes, I would prefer to see you using > wxruby-swig.I think issuing a release of wxruby-swig even in this early phase would send this signal stronger to the community and encourage them to use it ;) Jani
Kevin Smith wrote:> Thanks for the Ubuntu info. Yes, I would *strongly* recommend sticking > to wx 2.4 for now, unless you actually want to be a pioneer who is > actually doing the port to 2.6. There should be no problem having > GTK+1.2 and GTK+2.0 on your system at the same time.OK, thanks, I''ll think I''ll go with that.> As a side note, I would like to remind everyone that the wxruby-swig > build is the wxruby of the future. As far as I know, the swig version is > as stable as 0.6.0, but just doesn''t support as many classes. Unless you > really need those extra classes, I would prefer to see you using > wxruby-swig.In this case, I do - I''m porting an app that uses quite a few missing classes & methods. Re wxruby-swig, seems that for the time being we''re hamstrung by lack of C++ developer time (totally fine, people have real lives...). But please do anyone shpit when that chnages - I''m v happy to do .i files and samples - I have a couple of the former that work on OS X, but have some tricky methods (.i files are a nice way of documenting them) and need testing on Win32 & Linux etc. a
Jani Monoses wrote:> You can install both gtk+1.2 and gtk2.0 in Ubuntu, and which one is used > by various apps is decided at build-timesorry to ask a stupid question, but how can I find a repository with gtk+1.2(-dev) in it? I''ve done a good deal of googling but no joy.> it''s called libgtk2.0-devand this one? i have "multiverse" added, but nothing doing. thanks very much a
alex fenton wrote:> Jani Monoses wrote: > >> You can install both gtk+1.2 and gtk2.0 in Ubuntu, and which one is >> used by various apps is decided at build-time > > > sorry to ask a stupid question, but how can I find a repository with > gtk+1.2(-dev) in it? I''ve done a good deal of googling but no joy.At least on my ubuntu hoary system, libgtk1.2 is already in the main Libraries section (not universe or multiverse or non-free). Kevin
alex fenton wrote:> Jani Monoses wrote: > >> You can install both gtk+1.2 and gtk2.0 in Ubuntu, and which one is >> used by various apps is decided at build-time > > > sorry to ask a stupid question, but how can I find a repository with > gtk+1.2(-dev) in it? I''ve done a good deal of googling but no joy. > >> it''s called libgtk2.0-dev > > > and this one? i have "multiverse" added, but nothing doing. >apt-cache search libgtk will list a lot of packages which got something to do with gtk.Among them you''ll find libgtk1.2-dev and libgtk2.0-dev. As Kevin said they''re in main so no need for the extra repos in this case, but since you''ll probably need them for other packages do not forget to enable universe, multiverse is for non-free software. Jani
> apt-cache search libgtk > will list a lot of packages which got something to do with gtk.Among > them you''ll find libgtk1.2-dev and libgtk2.0-dev. > As Kevin said they''re in main so no need for the extra repos in this > case, but since you''ll probably need them for other packages do not > forget to enable universe, multiverse is for non-free software.Great, thanks for all the help Jani, Kevin. I got there in the end (Warty, rather than Hoary). The compounding problem was trying Synaptics package mgr for the first time, which allows you to choose repositories without providing any obvious reminder that you need to do "apt-get update" afterwards ... but it was very easy once i had the right repositories. apt-get install libwxgtk2.4-dev # deals with all the dependencies then set $use_xrc = false in extconf.rb manually copy include/wx/html/htmlproc.h into /usr/include/wx/html/ and all goes well with make, make install. one more question - my wxruby.so seems big, 10MB (compared to about 2MB on windows). anything i can do differently to make it smaller? - I would like to bundle it into a rubyscript2exe executable thanks again alex
alex fenton wrote:> > and all goes well with make, make install.Cool.> one more question - my wxruby.so seems big, 10MB (compared to about 2MB > on windows). anything i can do differently to make it smaller? - I would > like to bundle it into a rubyscript2exe executableIt sounds like it may have debugging information. You probably want to strip the library. Um. I don''t have the instructions handy at the moment. This looks like a promising web page, but I haven''t actually tried it: http://www.faqs.org/docs/linux_scratch/chapter06/aboutdebug.html If you have trouble figuring that out, let me know and I can re-research it for you. I know I did it at one point. Kevin
> It sounds like it may have debugging information. You probably want to > strip the library. Um. I don''t have the instructions handy at the > moment. This looks like a promising web page, but I haven''t actually > tried it:Perfect, strip --strip-debug wxruby.so reduces it to a much slimmer 1.2Mb. Thanks again a