[pygtk] pygtk with directfb without x11

sgf42 at fischer-abc.de sgf42 at fischer-abc.de
Wed Jul 1 21:06:34 WST 2009


Hi,

I want to use pygtk which is using the directFB layer instead of x11. Because 
memory is limited I want to drop x11 support completely from my ARM 
environment.

directFB works nicely already, even a small C gtk test application runs as 
expected.

My environment is based on debian lenny armel, and so I downloaded the 
pygtk-2.12.1 sources and made them with

./configure --exec-prefix=/root/ekb/pygtk-install --prefix=/root/ekb/pygtk-install --without-x
make
make install

All looks good, but when using it in python it claims to need 
libgtk-x11-2.0.so.0

-sh-3.2# export PYTHONPATH=lib/python2.5/site-packages:.:; python
Python 2.5.2 (r252:60911, Jan  5 2009, 02:00:00) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygtk
>>> pygtk.require('2.0')
>>> import gtk
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  
File "/root/ekb/pygtk-install/lib/python2.5/site-packages/gtk-2.0/gtk/__init__.py", 
line 48, in <module>
ImportError: libgtk-x11-2.0.so.0: cannot open shared object file: No such file 
or directory

If I provide libgtk-x11-2.0.so.0 it solves this issue and the next x11 based 
lib is requested, namely: 

libgdk-x11-2.0
libXinerama
libXi
libXrandr
libXcursor

:-(

I took a look into the configure script and even at configure.in and I see

grep -nH -e gtk+-2.0 configure.in
configure.in:210:  PKG_CHECK_MODULES(GTK, gtk+-2.0 >= gtk_required_version,
configure.in:225:  PKG_CHECK_MODULES(GTK210, gtk+-2.0 >= 2.10.0,
configure.in:241:  PKG_CHECK_MODULES(GTK212, gtk+-2.0 >= 2.11.6,

but directfb isn't mentioned at all as an option here, so configure calls

pkg-config --libs gtk+-2.0
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  

instead of

pkg-config --libs gtk+-directfb-2.0
-lgtk-directfb-2.0 -lgdk-directfb-2.0 -ldirectfb -lfusion -ldirect -lpthread -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  

and as a result I have all libs around x11 instead of the directFB ones 
included in pygtk.

So anybody has an advice for me how to get pygtk supporting directfb without 
x11 ?

Thank you very much,
Sven


More information about the pygtk mailing list