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

Antoine Latter aslatter at gmail.com
Mon Dec 6 15:05:16 CET 2010


On Mon, Dec 6, 2010 at 7:15 AM, Duncan Coutts
<duncan.coutts at googlemail.com> wrote:
> 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.
>

On my Mac 'which -a pkg-config' returns:
/opt/local/bin/pkg-config
/opt/local/bin/pkg-config

I'm not sure why it prints twice. The folder means I've installed it
from MacPorts, which also means I guess you'll need to install the
MacPorts version of X11-xft, but I'm not sure.

However building Haskell libraries against MacPorts often leads to
nightmarish scenarios involving libiconv, but I haven't run into that
on my current installation yet.

Antoine

> [1]: http://pkg-config.freedesktop.org/wiki/
>
> Duncan
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



More information about the Haskell-Cafe mailing list