Repository navigation
Closed
Description
pkg-config is useful when it works. Yet it has serious problems, including:
- It is written in C so the binary is arch-dependent making its use in a cross-compiled environment painful at best or impossible without resorting to www.qemu.org tricks.
- It appears to have bugs when built 32bit and run on a 64 bit OS X: No package 'freetype2' found mapnik/mapnik-packaging#134 (comment)
- It generates hard-coded/absolute paths in the .pc files making tarballs of built artifacts hard to share in a portable way.
We need to care about pkg-config in two ways:
- pkg-config may be a build dependency for Mason source compiles (e.g. harfbuzz needs pkg-config to find freetype)
- apps that depend on mason packages may call out to pkg-config like mapbox-gl-native
So I think we have two options:
workarounds
Workaround all the limitations by:
- Source compiles:
- compiling and using only the host arch of pkg-config when cross-compiling (like this mess)
- Require that the host machine have pkg-config already installed. (Note: this would be simple but I've avoided it because the HOST pkg-config is going to be looking by default in the wrong place for dependencies and even after setting
PKG_CONFIG_PATHthe wrong dependencies might get picked up).
- Binary install:
- overriding the hardcoded paths by using
--define-variable=prefix, etc. - provide our own fake
pkg-configshell script that provides the right things either by wrapping pkg-config or truly faking it
- overriding the hardcoded paths by using
ban pkg-config
Or we could try to purge all dependence on pkg-config by:
- patching or otherwise avoiding the need for pkg-config when building any deps that depend on it
- having the
masonitself be a build dependency of apps that use its tarballs and something likemason --libs libuvcould replacepkg-config --libs libuv, or; - just ensure a very sane layout of
libandincludefolders that apps using mason packages could easily predict.
Refs:
Metadata
Metadata
Assignees
Labels
No labels
Activity
springmeyer commentedon Oct 14, 2014
the
tl;drof this issue is that I'd like to try to ban pkg-config because I don't want to go down yet another rabbit hole of trying to get it to work (mapnik/mapnik-packaging#134 (comment)).springmeyer commentedon Nov 10, 2016
Using https://github.com/mapbox/mason/blob/master/mason.cmake is now the preferred way to avoid a runtime dep on pkg-config.