Closed hhugo closed 8 years ago
Can you elaborate?
pkg-config is not aware of all paths that brew uses so using pkg-config with (some) libs coming from brew just fail.
Brew (sometime at least) install libs in "/usr/local/opt/" and their .pc files (aka pkg-config) have path "/usr/local/opt/$(libname)/lib/pkgconfig/*.pc" I've found other ".pc" files in /usr/X11/lib/pkgconfig/
The small script provide all the paths to pkg-config (by setting the env variable) It could be fix automatically by brew by creating missing symlink into the directory /usr/local/lib/pkgconfig/ (this directory is already known by pkg-config)
This are the libs in "/usr/local/opt/" (with pkgconfig directory inside) I found on my computer atk cairo e2fsprogs fontconfig freetype fuse4x gd gdk-pixbuf glib google-perftools gtk+ gtksourceview harfbuzz icu4c imagemagick libcroco libevent libffi librsvg libtiff libyaml little-cms lua pango pcre pixman qt ruby sdl sqlite valgrind xz
Some things are deliberately not linked into /usr/local/lib/pkgconfig, these are keg-only formula that conflict with things already installed on the system. Everything else is linked as one would expect.
I see. It maybe requires more documentation then.
How would linking keg-only libs into /usr/local/lib/pkgconfig
conflict with libs already installed on OS X? It seems to me that since a default installation of OS X does not include pkg-config
at all, any program attempting to use pkg-config
already depends on brewed libs.
@mietek They may be picked up by stuff intending to pick up system versions instead.
For the record I, too, found pkgconfig
directories containing *.pc
files in the lib
subdirectories of at least two installed kegs: LibTIFF and OpenEXR. Both of these are not keg-only.
Just to make sure I wasn’t working with old versions, I uninstalled both of these packages just now and reinstalled them; /usr/local/opt/${keg}/lib/pkgconfig
was still where the pkg-config
data wound up in both cases, poured right from the current bottles.
(I manually fixed both of these on my install by relocating the errant folders in question to /usr/local/opt/${keg}/share/pkgconfig
– in both cases I could use e.g. pkg-config --exists ${pkgname} && echo "I Found It"
to test that things were where pkg-config
’s own configuration expects to find them.
It's perfectly fine for there to be pkgconfig files in the lib/pkgconfig
location. In fact, the vast majority of packages use that location. You should not need to move anything.
I'm not sure the concept of keg_only
isn't well documented enough by now to consider this still an issue.
There's also the How-to-build-software-outside-Homebrew-with-Homebrew-keg-only-dependencies document that talks about PKG_CONFIG_PATH
and touched upon in the FAQ.
I'll re-open if anyone protests, but I don't know if there's much more on our side to do here.
I had to put the following in my bashrc/bashprofile