LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-19-2008, 07:44 PM   #1
Deleauvive
LQ Newbie
 
Registered: May 2008
Location: France
Distribution: Suse 10SP2
Posts: 12

Rep: Reputation: 0
Red face GTK+, Python and related installed by hand


After my how-to related to installing Suse linux on a HP pavilion laptop, I am willing to explain my findings when it comes to installing Python and GTK+.


INTRO

The reason I went through this is because I needed to install a frontend for SDLmame called Wahcade.

Wahcade has a quite hefty list of requirements, so i consider it a good exercise upon which to base my how-to.

There are many, many things I've done during these nights of hard work, some pointless, some fruitful. It won't be easy to sum it up here in one shot, so, as with my tutorial for installing Suse, you will bear with me to delay reporting everything I need to tell you concerning these linux software and libraries installs.

Also, it seems that, depending upon the distro you're running and packages you choose at install time, some of the dependencies of Wahcade are already there. Fedora, in particular, seems to enhance the presence of "developer packages", so that setting up emulators and their frontends is a breeze (that's what a developer working on a popular linux emulator told me).

So please, take what you need, and leave the rest. Feel free to mention the obvious errors, omissions and so on. For people running KDE, it's supposed you installed the Gnome desktop. I'd say it might not be 100% mandatory, but it won't hurt either, except if you're really short on hdd space.

One more thing : Some portions of this article are copied & pasted text picked up from other's how-to I stumbled upon, while browsing. I know this is a questionable practice that might upset the authors, so I'll excuse myself.

Thing is, I simply can't "look back" to the point of finding the corresponding web page, asking permissions about these portions of text, crediting the authors and such. Such paragraphs will start with ", so feel free to email me if you think you're reading something you wrote.

Finally, there is a really central tool to all this, which you need to be familiar with : pkg-config. If you take the time to grab the tips & tricks of pkg-config, you might eventually appreciate to install more stuff from source, at least you will get a clearer picture of the meaning of packages scripts output. I feel this tool deserves more covering, so that's what we will try to do here.

Last but not least, some packages will be compiled from source, others will be installed/updated via Yast (simply use your own package config tool, in case you're running another distro). In the following list, PKG designates packages I compiled from source, and YPKG, packages those I downloaded via Yast.(to obtain them, read my other LQ article for the URLs of the corresponding repositories)

PKG
Cairo
Enchant - get v1.4.2 from http://www.abisource.com/projects/enchant
glib2
glib2-devel
glitz
libffi (ffi.h)
Pango
pixman
PyGObjet
pygtk


YPKGs
cups-devel done
dbus-devel (from DVD**)
del-tools & man*
fam-devel
freetype
glib
glib-devel
GnuTLS-devel
gstreamer-devel
gtk-devel
GtkSpell
KDEbase3-devel
libglade2-devel*
libjpeg-devel done
libtiff-devel
libxml2-devel
libXrender
NetworkManager-devel
python-devel
qt3-devel
sdl-devel
StartupNotification-devel
* : May not be needed/related to GTK+/Python

** : When a newer version of the lib is likely to cause broken dependencies, I found that ticking the check box next to the version provided on the install DVD instead of the one from the online repository could solve the problem.

Bear in mind, the frame of my how-to is somehow broader that simply running wahcade. At worst, it could be considered as general guidelines on how to add developer packages to Suse or OpenSuse linux.

After a while, I wanted to show the world clearing dependencies was something a near-newbie on linux could do, if he proceeded in a logical manner. Speaking about Python, we will stick with v2.4, if that's Ok with you.

I'll tell you right away about some of the difficulties of these procedures.
First, the configure scripts might be broken. In fact, they may be broken or really broken. In the first case, you will need to copy by hand the files it couldn't cope with, in the second case, you will need to crosslink libraries***. (read below).

Second, Gnome desktop stores its precious libraries in /opt when most of the time, you do want them to gloriously figure in /usr. Yast won't let you change the install path, so you'll need to "fool your system" in a way, by compiling properly. Failing to do could get you straight to what we call the "dependencies hell". (A needs B, which needs C but C needs...A)


____END OF INTRO_______

Ok some definitions / clarifications first :


To run Wahcade you'll need:
- python >= 2.4

- pygtk2 >= 2.6

- chardet >= 1.0

- elementtree
(not required for python >= 2.5)

but also (optional)
- psyco
- gstreamer
- pygame


*** Example of crosslinked libraries
I had to crosslink because the "very broken" png lib configure script would not permit the use of the correct file/link. Obviously, the following should be adjusted to your needs. Use at your own risk.

0 libpng12.so.0.1.2.8
0 libpng12.so.0
# ln -s /usr/lib/libpng12.so.0.29.0 /usr/lib/libpng12.so.0
+ libpng12.so.0.29.0

0 means remove/delete
+ means copy/replace


Now let's see how the prefix scheme work (also called 'Alternate installation')

"The ``prefix scheme'' is useful when you wish to use one Python installation to perform the build/install (i.e., to run the setup script), but install modules into the third-party module directory of a different Python installation (or something that looks like a different Python installation). Usually the ``home scheme'' comes first. However, there are at least two known cases where the prefix scheme will be useful.

First, consider that many Linux distributions put Python in /usr, rather than the more traditional /usr/local. This is entirely appropriate, since in those cases Python is part of ``the system'' rather than a local add-on.

However, if you are installing Python modules from source, you probably want them to go in /usr/local/lib/python2.X rather than /usr/lib/python2.X. This can be done with
/usr/bin/python setup.py install --prefix=/usr/local"

In fact, as I said earlier, we *will* use the --prefix=/usr prefix extensively, as it seems the default configure scripts install stuff in --prefix=/usr/local


What is Cairo ?
Cairo is a vector graphics library with cross-device output support

What is Pango ?
Pango is a system for the layout and rendering of internationalized text


What about ldconfig ?
"ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and /usr/lib). The cache is used by the run-time linker, ld.so or ld-linux.so.

It checks the header and filenames of the libraries it encounters when determining which versions should have their links updated.
Also, ldconfig will attempt to deduce the type of ELF libs (ie. libc5 or libc6/glibc) based on what C libs, if any, the library was linked against. Therefore, when making dynamic libraries, it is wise to explicitly link against libc (use -lc).

Some existing libs do not contain enough information to allow the deduction of their type. Therefore, the /etc/ld.so.conf file format allows the specification of an expected type."


pkg-config : Better make it your friend !
translated from french :
"pkg-config is to libraries what apt-get or urpmi are to software. Unlike those two, pkg-config is the only one of his kind to be so polished and widely used. However, it has some major drawbacks.

First, it's not installed on every system. When your system doesn't include it, you should, as a developer, propose a viable solution.

As a user, if you're planning to compile a software which requires it, you're left with the sole solution of exporting LD_RUN_PATH=/usr/lib/installer.
In this case, another obvious drawback appears : very few, if any, libs will be declared in it.

For example, if glib was previously installed, you don't always have the definition files (.pc files) at your disposal to declare them to the pkg-config you just installed.

Something less obvious : If pkg-config in installed with the system, like with the new GNU/linux distros, you can be sure quite a few libs will be declared.

However, it will not be the case for everyone of of them, since some developers did not take the time to do so. As a libraries developer, try to include the definition files for pkg-config, if you can."

I believe pkg-config most important feature is to provide the precise version number of the already installed libs.
Here are all the commands I used to make sure I had the right versions :
pkg-config --modversion libpng
pkg-config --modversion glib-2.0
pkg-config --modversion gtk+-2.0
pkg-config --modversion glib
pkg-config --modversion gtk
pkg-config --modversion pango
pkg-config --modversion pixman-1
pkg-config --modversion cairo
pkg-config --modversion libdrm
pkg-config --modversion python

As you see, you must provide the correct name of the lib, for GTK+, typing gtk+ won't output anything.

I edited /etc/ld.so.conf this way :
0 /opt/gnome/lib
+ /usr/lib
Then simply typed
#ldconfig
in a console with root privileges. Repeat if necessary (i.e. after "big" installs such as glib or GTK+...)

In case the config script is still unable to locate a lib or continues to display a wrong version number, try using the following :
CPPFLAGS="-I/usr/include"
LDFLAGS="-L/usr/lib"
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
LD_RUN_PATH=/usr/lib/
LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
PATH="/usr/bin:$PATH"
export CPPFLAGS LDFLAGS PKG_CONFIG_PATH LD_RUN_PATH LD_LIBRARY_PATH PATH

(edit accordingly to your needs/paths)

gtk+, cairo, pygtk, pango, glitz, pixman & glib new versions are all installed in /usr
in some rare cases (freetype, libpng), I had to use the /usr/local path


TIPS :

- chardet is a Python program, install method is different :
python setup.py install

- pygtk should compile with all modules

- Libs version numbers can be misleading. I am used to version numbers using groups of 2 digits.
for example, is 2.8.12 greater than 2.12.6 ?
it's not, but I would have liked to see the first number written like that :
2.08.12 so no confusion would occur with 2.80.12.

Ok, I might be picky here, but version numbers are really something you should care about when updating, as config scripts often complains about such and such lib not being recent enough.

- Different versions of the same lib can coexist, provided they are installed in separate directories. For example Yast may be aware that Python 2.4 is install in /usr, but you might still want to install v2.5 in /usr/local for testing purposes. (make altinstall)

Usually, it's desirable to read at least the readme and install text files included (sometimes located in the /doc folder). Some libs such as Pango can be tricky to fix, if the prerequisites and/or the install path are wrong.


A few URLs :
In fact, if you're just realizing that Gnome is a fantastic development platform, and not only an alternate desktop to KDE, you might be interested in browsing (and downloading from) the following web sites :

http://www.gnomefiles.org
General Gnome repository with fresh packages for each popular app

http://www.freedesktop.org/wiki
Base platform for desktop software on Linux and UNIX. The elements of this platform have become the backend for higher-level application-visible APIs such as Qt, GTK+, XUL, VCL, WINE, GNOME, and KDE.

http://www.jamesh.id.au/software
Aimed at describing the most popular Gnome libs (developers might be interested in checking the jhbuild tool.

Noticing how wahcade manages to be a slick frontend for SDLmame, we may safely conclude that Glade seems to be a brilliant interface toolkit. As a matter of fact, it is also known to Windows users/students who install it via Cygwin.

That's it. If you enjoy chasing libs & their dependencies, you might try to setup pidgin, which is GAIM messenger official replacement.

Last edited by Deleauvive; 06-24-2008 at 01:08 AM.
 
Old 06-20-2008, 09:48 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
To be honest I'm not sure the purpose of your post. It sounds like it might be a success story. If that's the case, I'd suggest you ask the mods to move it to the linuxquestions.org-member-success-stories forum.
 
Old 06-20-2008, 10:30 AM   #3
Deleauvive
LQ Newbie
 
Registered: May 2008
Location: France
Distribution: Suse 10SP2
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for replying weibullguy.

I agree the thread I've created is not about asking software-related questions to the LQ community, per se. Sorry about that. however I think it can fill a gap when it comes to explaining how to setup a development environment on a modern linux distro.

I couldn't find a LQ forum specifically related to Development, so I thought in order to receive proper exposure my tutorial could fit in the Software section.
 
Old 06-20-2008, 11:16 AM   #4
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
Originally Posted by Deleauvive View Post
I think it can fill a gap when it comes to explaining how to setup a development environment on a modern linux distro.
I'm not trying to rain on your parade, but the only development tool you discuss is pkg-config. Also, I think you should explain all the futzing that you're doing with libpng symlinks. You don't list libpng as a package you installed, so I don't understand why you were changing the version of the symlink. It looks like you create a version 1.2.29 symlink pointing to an older libpng library.

Quote:
Originally Posted by Deleauvive View Post
I couldn't find a LQ forum specifically related to Development, so I thought in order to receive proper exposure my tutorial could fit in the Software section.
How about the Programming forum? I still think this is more of a success story though. Maybe you can clean it up and submit it for a tutorial.
 
Old 06-20-2008, 01:54 PM   #5
Deleauvive
LQ Newbie
 
Registered: May 2008
Location: France
Distribution: Suse 10SP2
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks for your advice. My initial goal was to set apart new from updated libs. About the png symlink, I had an error related to Cairo, which involved png, and it was the only way to fix it.

Those kind of errors occur once in a while, when doing multiple compilations, but it might not be obvious to some that finding a newer version in not always the solution.

I am not sure I could "sell" my article as a tutorial. I already wrote to the board admin about my Suse install article, with no answer as of yet. May be you could ask their opinion the right people at LQ, I would surely appreciate.

Last edited by Deleauvive; 06-23-2008 at 04:37 PM.
 
Old 06-25-2008, 06:36 PM   #6
Deleauvive
LQ Newbie
 
Registered: May 2008
Location: France
Distribution: Suse 10SP2
Posts: 12

Original Poster
Rep: Reputation: 0
Arrow Installing linux on a USB key

Hi,


If you still aren't sure linux is the right OS for your computer, you might be interested in reading my tutorial on how to install a striped-down but fully functional linux distro (FaunOS) on a USB key (1GB+) :

Installing linux on a USB key :
http://forum.faunos.com/viewtopic.php?pid=1870
(last post on the page)

FaunOS main advantage is that it gives you the ability to save your modifications (to a certain extend).
 
  


Reply

Tags
developer, development, glade, gnome, gtk+, howto, install, linux, python, source, suse, tutorial



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
Multiple Problems, gtk+ related? kryptobs2000 Linux - Software 0 10-31-2006 03:28 PM
How do I tell yum/apt/rpm that I have hand built and installed apache/mysql/php BigDave Linux - Software 1 04-14-2005 02:51 PM
WineX, python-gnome, and python-gtk DrD Fedora 0 08-03-2004 12:11 PM
Redhat 9.0 gtk+ upgrade hand holding :-) justin99 Red Hat 1 01-06-2004 06:38 PM
another gtk related enquiry ;-) breakerfall Linux - Newbie 31 06-22-2003 04:31 PM

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

All times are GMT -5. The time now is 12:26 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