LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-12-2005, 03:34 AM   #1
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
Upgrade to Gtk 2.6 but keep my old Gtk 2.0?


Hi guys

I want to upgrade to the new GTK 2.6 - how can I do this WITHOUT losing my existing 2.0 library binaries?

I think I need to know where the existing 2.0 library binaries are on my Rh9 installation, and then somehow compile and install the new GTK 2.6 library so it does not overwrite the old one.

How can I do this and make applications' configure scripts find the GTK 2.6 even if it is not where they expect it to be (i. e. I did not allow 2.6 to replace 2.0, so configure scripts won't find 2.6 since it is in a "nonstandard" location?)

How thus can I keep my GTK 2.0, but also have GTK 2.6 on my system for applications that need them? How can I force a configure script to "find" either at my choice? I have legacy apps that use 2.0 that I suspect won't compile if I have 2.6. Other apps I need to run only want 2.4 or higher, and won't even configure with 2.0.

Any help appreciated - anybody tried this before?

Thanks!
 
Old 05-12-2005, 03:52 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Run the configure script for gtk+ 2.6 with the --prefix switch, like this:
./configure --prefix=/opt/gtk2.6
This will force the root of the installation to be /opt/gtk2.6 so the lib dir will likely be /opt/gtk2.6/lib, and so on.

Whenever you want an application to use the new libs, simply tack on the new lib directory to your $LD_LIBRARY_PATH:
LD_LIBRARY_PATH=/opt/gtk2.6/lib:$LD_LIBRARY_PATH mozilla
This will place the gtk2.6 lib directory before the regular lib directories in your $LD_LIBRARY_PATH (so the new ones are preferred) and then launch mozilla with these settings.

Similarily, to compile new software against the 2.6 libs you will need to pass the full path of the new lib dir to the configure script using the appropriate parameters (check the help options of the configure script).


Håkan
 
Old 05-12-2005, 03:59 AM   #3
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
most likely your old one is in /usr, so you need to pick a place (/opt/gtk-2.6 sounds good). I'd recommend giving it it's own directory like above, so if you want to remove it a simple "rm -fr /opt/gtk-2.6" and it's gone. you will also need to upgrade glib2, atk, and pango ( I'd install the all to /opt/gtk-2.6.

before you start, verify a file called xft.pc is in /usr/X11R6/lib/pkgconfig and do the following:
Code:
export PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig:$PKG_CONFIG_PATH
also go ahead and do the following:
Code:
export PKG_CONFIG_PATH=/opt/gtk-2.6/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/opt/gtk-2.6/lib:$LD_LIBRARY_PATH
the first one tells pkg-config (the program the gnome libs (and some others) use to set up include and linking flags) where to find what it wants to compile the new libs. the second one appends /opt/gtk-2.6/lib as a path the linker needs to search ( both when linking libraries at compile time and at runtime). note that we're not using ldconfig.

for the commands ( the order is glib, atk, pango, gtk):
./configure --help ( look over your options, though most of the gnome libs these days are straight forward)

./configure --prefix=/opt/gtk-2.6
make
make install ( or optionally make a rpm and install it)

when you configure pango, when configure is done it will print a summary of what backends are to be built. make sure xft is listed, or gtk will refuse to use it.


when you are done, you will need to set up a couple environmental variables to force the system to ignore the default gtk-2.0 libs and use your new ones. to do this, you can add the following to /etc/profile or another script that /etc/profile sources for the variables to take effect when you login:

export PKG_CONFIG_PATH=/opt/gtk-2.6/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/opt/gtk-2.6/lib:$LD_LIBRARY_PATH

you should be set with that, let me know if I forgot something.
 
Old 05-12-2005, 08:44 AM   #4
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Original Poster
Rep: Reputation: 103Reputation: 103
Darn! Couldn't have asked for better or clearer instructions. THANKS guys!
 
Old 05-31-2005, 07:44 PM   #5
npc
Member
 
Registered: May 2005
Location: Sao Luis, MA, Brazil
Distribution: Slackware, Gentoo
Posts: 32

Rep: Reputation: 15
Hi, people.
I just did everything that was described in the last posts.
Plus, i've added the environment variables to my /etc/profile and to ~/.bashrc.
The problem is, eventhough when i do "echo $LD_LIBRARY_PATH" it shows the correct path to /opt/gtk2.6/lib, gimp wont run, cuz it still thinks only the old gtk is installed. If, however, i do manually a "export LD_LIBRARY_PATH="/opt/gtk2.6/lib" it works fine! What am i doing wrong?

I'm on Slack10, kernel 2.6.11 btw.

Just one more thing. The output to "echo $LD_LIBRARY_PATH" is actually "/opt/gtk2.6/lib:", because i've added ":$LD_LIBRARY_PATH" to the end of the var value and it is undifined just before that line. Is there a problem?

Thanks!

** FIXED **
I just "su" and "ldconfig" and it all got fixed. Sorry about that, folks.

Anyways, now it can't recognize .jpeg files and there's also a few other Warning messages that make me uneasy... What should I do?
**********

Last edited by npc; 05-31-2005 at 08:08 PM.
 
Old 05-31-2005, 08:38 PM   #6
npc
Member
 
Registered: May 2005
Location: Sao Luis, MA, Brazil
Distribution: Slackware, Gentoo
Posts: 32

Rep: Reputation: 15
I could manage to solve that problem just now, i had a few packages missing from the gnome directory and also some other package that were not on the slack 10 cd. I did filename searches at the slackware site and downloaded the missing packages. All seems ok, but it still complains about some hi-color theme that i've already installed. Anyways it's just a warning.

Sorry about that folks, didnt mean to bother.

Shalom!
 
Old 06-13-2005, 12:29 AM   #7
ghostcorps
LQ Newbie
 
Registered: Jun 2005
Posts: 1

Rep: Reputation: 0
H Guys

Firstly to __J thanks!! that was so easy even I understood it... and this is my fist time playign with linux.. thanks again.

However, I am failing to install other GTK dependant things. for example I try to install the GTK-industrial-engine with the autogen.sh and get this:

Code:
/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/freetype2/confi g -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
checking GTK2_LIBS... -Wl,--export-dynamic -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0  -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgm odule-2.0 -ldl -lglib-2.0
./configure: line 20841: syntax error near unexpected token `1.2.9,'
./configure: line 20841: `AM_PATH_GTK(1.2.9, ,'
Can someone perhaps suggest why? I assume its because I havnt told the install where to find the proper GTK but I thought that adding the lines below to /etc/profile would have meant that I wouldnt need to change the configure every time I install a GTK dependant package.

export PKG_CONFIG_PATH=/opt/gtk-2.6/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/opt/gtk-2.6/lib:$LD_LIBRARY_PATH

Thanks

=^_^=

Last edited by ghostcorps; 06-13-2005 at 12:30 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Freerock uninstall stole GTK looking for up-to-date pango, atk, gtk, glib and xft tgz Oholiab Slackware 8 09-18-2005 11:57 AM
GTK source install doesn't give gtk-config Feebles Linux - Software 4 06-15-2005 12:51 PM
why can't i upgrade gtk+ kryptonite0110 Linux - Software 7 03-21-2005 09:56 PM
cant find gtk-config file or gtk-devel to install happychappy Linux - Software 2 02-16-2005 12:46 AM
compiling gaim/ gtk error (two versions of gtk) webazoid Linux - Software 0 07-06-2004 06:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration