VectorLinux
October 25, 2014, 10:01:13 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: Maintaining multiple versions of GTK+?  (Read 1344 times)
edwinsage
Member
*
Posts: 17


formerly KamikaziFreak


« on: August 25, 2008, 06:05:56 pm »

I'm using VL 5.8, and need to update GTK+ to at least 2.12.0 to get some software to compile.  I remember on my cruddy spare computer, I upgraded GTK+ from source once, and it broke all the icon and button themes for half my applications.

Is there a way to install an updated version in parallel with the version I'm using now (2.10.0)?  It seems like this should be doable, but my Google-fu is failing me.  I don't want to use trial and error, which would be my normal method to figure things like this out, because I remember trying to get things working again on my cruddy computer took a lot of work, and was a pretty hacked solution even then.
Logged
caitlyn
Packager
Vectorian
****
Posts: 2876


WWW
« Reply #1 on: August 25, 2008, 08:14:25 pm »

With GTK+ 2.x there really isn't a good way to do two versions in the same installation, sorry.  In my experience that always breaks things.  In general upgrading core libraries on a Linux distro unless you are incredibly careful snd knowledgeable is a recipe for massive breakage.

My suggestion:  time to upgrade to VL 5.9 and use the newer version across the board.
Logged

eMachines EL-1300G desktop, 1.6GHz AMD Athlon 2650e CPU, 4GB RAM, nVidia GeForce 6150 SE video
CentOS 6.5 (will try VL64-7.1 soon)

Toshiba Satellite A135-S4727,  Intel Pentium T2080 / 1.73 GHz, 2GB RAM, Intel GMA 950

HP Mini 110 netbook, 1.6GHz Intel Atom CPU, 2GB RAM, Intel 950 video, VL 7.1
lagagnon
Global Moderator
Vectorian
*****
Posts: 1922



WWW
« Reply #2 on: August 25, 2008, 09:50:35 pm »

Upgrading GTK is not something I would recommend. You are likely to suffer breakages if you do so. Why not upgrade to VL5.9? If you have a seperate /home partition you can save all your data and settings and just load the new system into your old 5.8 root partition....
Logged

"As people become more intelligent they care less for preachers and more for teachers". Robert G. Ingersoll
The Headacher
Louder than you
Global Moderator
Vectorian
*****
Posts: 1551


I like the bass to go BOOM!


WWW
« Reply #3 on: August 26, 2008, 01:15:45 am »

The only way I can think of doing this, is building the new one from scratch, give it a different prefix, and then when building telling the program to use those other libs.

For instance, if you build the new gtk2+ with --prefix=/usr/local the old gtk2+ libraries should be unaffected (it was built with --prefix=/usr ). I am unsure how hard it would be to make sure the depending programs build against that one rather than the old gtk. I suppose that sort of depends on how flexible the configuration is. some programs have configure flags that allow changing what directories to look for gtk, but most get their information from pkg-config and don't allow it. you could probably still do it by changing the corresponding .pc (pkg-config) file while building it, but must remember to change it back when you're done.

As you see it's not easy and I can't guarantee success. AAMOF, before doing this I recommend backing up the old system (better safe than sorry). I don't think it's impossible, but probably very tricky.
Logged

Most music on my soundcloud page was arranged in programs running on VL.
caitlyn
Packager
Vectorian
****
Posts: 2876


WWW
« Reply #4 on: August 26, 2008, 06:06:09 am »

@The Headacher:  The problem with what you suggest is that most if not all developers don't expect or allow for a relocated set of GTK+ libraries.  In each case software to be run against the new libraries would have to be buult from source and the Makefile would have to be customized before building/  Likely the .configure script (if one exists) would also have to be modified to find the required library to insure that step doesn't fail.  It is a LOT of ongoing work and it;s tricky work.
Logged

eMachines EL-1300G desktop, 1.6GHz AMD Athlon 2650e CPU, 4GB RAM, nVidia GeForce 6150 SE video
CentOS 6.5 (will try VL64-7.1 soon)

Toshiba Satellite A135-S4727,  Intel Pentium T2080 / 1.73 GHz, 2GB RAM, Intel GMA 950

HP Mini 110 netbook, 1.6GHz Intel Atom CPU, 2GB RAM, Intel 950 video, VL 7.1
edwinsage
Member
*
Posts: 17


formerly KamikaziFreak


« Reply #5 on: August 26, 2008, 07:15:35 am »

I was planning on building both GTK+ and any apps depending on the new version from source.  VL was my first Linux, and I started with it back on version 3 before the packaging system was easy to use, and learned to compile from source before I could figure out the packager.  So I'm used to building from source.   ; )

As far as updating to VL 5.9 goes, I've done a lot of messing around and tweaking things on my computer so far, and I stick with the "don't fix it unless it's broke" strategy.  Reinstalling the OS on my desktop seems a bit overkill just to get a slightly newer media player.  I'm not even sure it'll do what I want (play mp3s on a remote system with ESound, and NOT speed up playback like XMMS does).  That's a lot of fix for a little problem.  The last reason I don't want to just install 5.9 is that it wouldn't help me understand my computer or Linux any better.  I learn by fiddling around with things.

Headacher:  I suspected it would have something to do with using --prefix, but I wasn't sure exactly what directory I should use.  If I set it to /usr/local, will that not break my old install?  I'm not too worried about figuring out how to get software to compile with it; that's something I can use trial and error on without breaking anything else.  The configure script is already giving me some leads:
Code:
checking for GTK... configure: error: Package requirements (gtk+-2.0 >= 2.12.0) were not met.
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively you may set the GTK_CFLAGS and GTK_LIBS environment variables
to avoid the need to call pkg-config.  See the pkg-config man page for
more details.

As far as pkg-config goes, would it make sense to change it to point to the new version?  If currently installed apps don't reference it to find out where GTK+ is, then it shouldn't break the programs already installed...and if I compile new apps, they might as well use the new version, right?
Logged
The Headacher
Louder than you
Global Moderator
Vectorian
*****
Posts: 1551


I like the bass to go BOOM!


WWW
« Reply #6 on: August 26, 2008, 11:52:17 am »

Quote from: KamikaziFreak
If I set it to /usr/local, will that not break my old install?
The old gtk is installed with --prefix=/usr. Using a different prefix will ensure it doesn't get overwritten. As long as you don't do something like upgradepkg (if you made a package of the new gtk stuff), in which case the old package will be removed when you install the new gtk package.

Quote from: KamikaziFreak
If currently installed apps don't reference it to find out where GTK+ is, then it shouldn't break the programs already installed...and if I compile new apps, they might as well use the new version, right?
That's what I was thinking. Please consider backing up before doing anything wild though. I'd hate missing some detail and be responsible for you irreversibly borking your install.

Quote from: caitlyn
The problem with what you suggest is that most if not all developers don't expect or allow for a relocated set of GTK+ libraries.
Actually, most gtk programmers will use things like `pkg-config --cflags` rather than hardcoding the cflags needed. It's in the first part of the gtk programming tutorial.

Quote from: caitlyn
In each case software to be run against the new libraries would have to be buult from source
Yes, obviously.
Quote from: caitlyn
and the Makefile would have to be customized before building
I don't think so.

Please note I haven't tried this myself, working on another project now.
Logged

Most music on my soundcloud page was arranged in programs running on VL.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!