caveats: highlight PKG_CONFIG_PATH if exists

We keep getting issues every now & again about people being confused that
keg_only includes hiding the `pkg-config` files. Perhaps seems reasonable to
start pointing out those exist when they do & a hint on how to access them.

Hidden behind a which check to avoid redundant messages, although `pkg-config`
is an incredibly popular formula. Ran some time tests, no appreciable difference
from the status quo.

If accepted:
Closes https://github.com/Homebrew/homebrew-core/issues/4669.
This commit is contained in:
Dominyk Tiller 2016-09-11 04:49:09 +01:00
parent 2815485f54
commit 2394d6f2d8
No known key found for this signature in database
GPG Key ID: FE19AEFCF658C6F6

View File

@ -54,6 +54,11 @@ class Caveats
EOS EOS
s << " LDFLAGS: -L#{f.opt_lib}\n" if f.lib.directory? s << " LDFLAGS: -L#{f.opt_lib}\n" if f.lib.directory?
s << " CPPFLAGS: -I#{f.opt_include}\n" if f.include.directory? s << " CPPFLAGS: -I#{f.opt_include}\n" if f.include.directory?
if which("pkg-config")
s << " PKG_CONFIG_PATH: #{f.opt_lib}/pkgconfig\n" if (f.lib/"pkgconfig").directory?
s << " PKG_CONFIG_PATH: #{f.opt_share}/pkgconfig\n" if (f.share/"pkgconfig").directory?
end
end end
s << "\n" s << "\n"
end end