Cabal User Guide says:
pkgconfig-depends: *package list*
A list of pkg-config packages, needed to build this package. They can be annotated with versions, e.g.
gtk+-2.0 >= 2.10, cairo >= 1.0
. If no version constraint is specified, any version is assumed to be acceptable. Cabal usespkg-config
to find if the packages are available on the system and to find the extra compilation and linker options needed to use the packages.If you need to bind to a C library that supports
pkg-config
then it is much preferable to use this field rather than hard code options into the other fields.pkg-config --list-all
will show you all supported libraries. Depending on your system you may need to adjustPKG_CONFIG_PATH
.
Why exactly is pkg-config
preferable to raw extra-libraries
? What’s the difference between
pkgconfig-depends: zlib
and
extra-libraries: z
unless one needs to constrain supported versions of a foreign package?