aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2012-08-10 16:34:20 -0400
committerMax Howell2012-08-29 12:41:34 -0400
commit57df15afd009d11e8d683353a74287e0a22ba57b (patch)
treef4f8799c05a18b8460b3ca386969e879fdd65e8d /Library
parent05b91e3d29debc6c668885d58d645cfe2e2e1943 (diff)
downloadbrew-57df15afd009d11e8d683353a74287e0a22ba57b.tar.bz2
Use opt paths in keg-only messages
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula_installer.rb24
1 files changed, 13 insertions, 11 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 1910348db..9d8add9d2 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -436,19 +436,21 @@ end
class Formula
def keg_only_text
- # Add indent into reason so undent won't truncate the beginnings of lines
- reason = self.keg_only_reason.to_s.gsub(/[\n]/, "\n ")
- return <<-EOS.undent
- This formula is keg-only, so it was not symlinked into #{HOMEBREW_PREFIX}.
+ s = "This formula is keg-only: so it was not symlinked into #{HOMEBREW_PREFIX}."
+ s << "\n\n#{keg_only_reason.to_s}"
+ if lib.directory? or include.directory?
+ s <<
+ <<-EOS.undent_________________________________________________________72
- #{reason}
- Generally there are no consequences of this for you.
- If you build your own software and it requires this formula, you'll need
- to add its lib & include paths to your build variables:
+ Generally there are no consequences of this for you. If you build your
+ own software and it requires this formula, you'll need to add to your
+ build variables:
- LDFLAGS -L#{lib}
- CPPFLAGS -I#{include}
- EOS
+ EOS
+ s << " LDFLAGS: -L#{HOMEBREW_PREFIX}/opt/#{name}/lib\n" if lib.directory?
+ s << " CPPFLAGS: -I#{HOMEBREW_PREFIX}/opt/#{name}/include\n" if include.directory?
+ end
+ s << "\n"
end
end