You're viewing a single post. I have much more to say! The main blog page is a good starting point.
Wednesday, November 29, 2006 ★ 00:18 ★ Categories Gnome, Programming
Dear lazyweb,
When detecting Python GTK/Gnome modules in configure.ac, should I use this check:
PKG_CHECK_MODULES(pygtk, pygtk-2.0)
...or this check:
if ! $PYTHON -c 'import gtk' > /dev/null 2>&1; then AC_MSG_ERROR([Python module 'gtk' not found]) fi
The pkg-config call requires the development packages from distributions, which I doubt are needed. On the other hand, what purpose serve the .pc files for the various Python GTK/Gnome packages if we don’t use them in configure.ac at all?
Any clue? Contact me (uws) on irc.gnome.org or mail me. Thanks!
Update 1: I received some responses.
import gtk (with import pygtk; pygtk.require('2.0') prepended) suffices.$DISPLAY isn’t set.
Update 2: Loïc Minier (from Debian fame) pointed out that using runtime checking for Python modules is a far better way and a lot more distro-friendly because their build infrastructure does not have to compile/install/run unneeded dependencies when creating packages (in addition to other problems like NFS home dirs and such). Just listing the dependencies in a README file and handling run-time errors gracefully should be enough.
Random photo from Ireland (February, 2006)
Wouter Bolsterlee, also known as uws, a postmodern geek living in the Netherlands. Read more about me…
Unless stated otherwise, all material on this site is available under a Creative Commons Share-Alike license.