Support for pkgconfig alternatives #974

Closed
CasperVector opened this Issue Jul 10, 2012 · 4 comments

3 participants

@CasperVector

There are now several pkgconfig alternatives, for example pkgconf, pkg-config-lite and pkgconfig-openbsd. The reason for choosing different implementations include avoiding unnecessary dependencies (for example pkgconfig requires the glib, a library designed for GTK+) and so on.

Cabal does not support these alternatives since it only recognises the /usr/bin/pkg-config --version output in the pkg-config a.b[.c] form, while other alternatives output in other manners, for example pkgconf outputs pkgconf a.b. So on my machine with pkgconf installed instead of pkgconfig, Cabal yells

Warning: cannot determine version of /usr/bin/pkg-config :
"pkgconf 0.8\n"
setup: The program pkg-config version >=0.9.0 is required but the version of
/usr/bin/pkg-config could not be determined.

and aborts when trying to install x11-xft.

Therefore it would be nice to modify the Cabal source code and let Cabal recognise the /usr/bin/pkg-config --version outputs of these pkgconfig alternatives, thanks :)

P.S.
1. Since different pkgconfig alternatives have different versioning schemes, the modified source code might need to set different version conditions for different alternatives.
2. Cabal requires >=0.9.0 version of pkgconfig, but interestingly I cannot find related settings in the Cabal source code (at least in the Distribution.Simple.Program module).

@kaniini

The correct way to do this is to use:

$PKG_CONFIG --modversion pkg-config

The pkg-config package is a built-in package which defines the pkg-config frontend version, and implementation-specific features, such as:

ciaranis:~$ pkg-config --modversion pkg-config
0.25
ciaranis:~$ pkgconf --modversion pkg-config
0.27
@CasperVector

Thanks to @nenolod, this way would be much more elegant :)

@jsl

It looks from the comment history that this ticket is resolved, so I propose closing.

@CasperVector if there is something that you'd still like to see addressed here please re-open or create a new ticket. Thank you!

@CasperVector

It works now. Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment