[Haskell-cafe] Cabal, xmonad-contrib, X11-xft, pkg-config ... questioning my sanity

Duncan Coutts duncan.coutts at googlemail.com
Mon Dec 6 14:15:49 CET 2010


On 6 December 2010 11:02, Jacek Generowicz <jacek.generowicz at cern.ch> wrote:

> It a appears that a program which does not exist on my computer seems to
> insist on a package version which does not exist in my universe, I'm
> starting to wonder whether I have lost my marbles. Could some kind soul
> please point me in some sensible direction?
>
> cabal install xmonad-contrib
> Resolving dependencies...
> Configuring X11-xft-0.3...
> cabal: pkg-config version >=0.9.0 is required but it could not be found.

> X11-xft version 0.9.0 doesn't even exist, as far a I can tell

In the development version of cabal we have changed that error message
to try and make it clear that it is looking for a program called
pkg-config, not a Haskell package or a C lib.

cabal: The program pkg-config version >=0.9.0 is required but it could not be
found.

Do you think that message would have helped avoid your confusion? Is
there an alternative message that would have been better?

pkg-config [1] is a tool used by C libraries to describe things like
dependencies on other C libs and what C compiler flags are needed to
use the packages.

The Haskell package X11-xft is a binding to the C library xft. On most
modern unix systems xft C library provides meta-data that pkg-config
can use. For example, on my system I can run:

$ pkg-config --cflags xft
-I/usr/include/freetype2

$ pkg-config --libs xft
-lXft -lXrender -lfontconfig -lfreetype -lX11

Cabal does exactly the same thing, to work out what flags are needed
to use the xft C library.

The problem on your system is that the pkg-config program is not
installed. Perhaps on OSX it comes with Xcode, I'm not sure. It may
well also be the case that you don't have the development files for
X11 or xft installed either (e.g. C header files). Hopefully some OSX
person can advise you on what you need to install to do X11
development on OSX.

[1]: http://pkg-config.freedesktop.org/wiki/

Duncan



More information about the Haskell-Cafe mailing list