aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2010-04-20 12:20:57 -0700
committerAdam Vandenberg2010-04-20 12:22:51 -0700
commitdb62a9ef9cde4f368b553d6b2bc609a46630cf3b (patch)
treec10a74f62218f074b30d8ae225e11f673645d7cc
parentab9ccd7d8977e7929d948695b1f3d585cfb882f2 (diff)
downloadbrew-db62a9ef9cde4f368b553d6b2bc609a46630cf3b.tar.bz2
brew doctor now checks pkg-config search path
Homebrew's pkg-config didn't originally add X11 to its search path. This causes problems for long-time Homebrew users brewing software that depends on X11-related packages, such as Cairo.
-rw-r--r--Library/Homebrew/brew_doctor.rb32
1 files changed, 30 insertions, 2 deletions
diff --git a/Library/Homebrew/brew_doctor.rb b/Library/Homebrew/brew_doctor.rb
index 146755d49..37ab588f7 100644
--- a/Library/Homebrew/brew_doctor.rb
+++ b/Library/Homebrew/brew_doctor.rb
@@ -156,7 +156,7 @@ def check_user_path
end
end
-def check_pkg_config
+def check_which_pkg_config
binary = `which pkg-config`.chomp
return if binary.empty?
@@ -172,6 +172,33 @@ def check_pkg_config
end
end
+def check_pkg_config_paths
+ binary = `which pkg-config`.chomp
+ return if binary.empty?
+
+ # Use the debug output to determine which paths are searched
+ pkg_config_paths = []
+
+ debug_output = `pkg-config --debug 2>&1`
+ debug_output.split("\n").each do |line|
+ line =~ /Scanning directory '(.*)'/
+ pkg_config_paths << $1 if $1
+ end
+
+ # Check that all expected paths are being searched
+ unless pkg_config_paths.include? "/usr/X11/lib/pkgconfig"
+ puts <<-EOS.undent
+ Your pkg-config is not checking "/usr/X11/lib/pkgconfig" for packages.
+ Earlier versions of the pkg-config formula did not add this path
+ to the search path, which means that other formula may not be able
+ to find certain dependencies.
+
+ To resolve this issue, re-brew pkg-config with:
+ brew rm pkg-config && brew install pkg-config
+ EOS
+ end
+end
+
def brew_doctor
read, write = IO.pipe
@@ -187,7 +214,8 @@ def brew_doctor
check_for_x11
check_share_locale
check_user_path
- check_pkg_config
+ check_which_pkg_config
+ check_pkg_config_paths
exit! 0
else