diff options
| author | Max Howell | 2009-09-21 20:22:09 +0100 |
|---|---|---|
| committer | Max Howell | 2009-09-21 20:23:09 +0100 |
| commit | 01b85d85211502acf0664b66e983fe2f4ad209d9 (patch) | |
| tree | 4b530e946d3ea275f2bf5dce415521e27dfe0f33 /Library | |
| parent | e9701dbc81510640bdaff131501828b97066ba31 (diff) | |
| download | brew-01b85d85211502acf0664b66e983fe2f4ad209d9.tar.bz2 | |
Automatically add keg_only? deps to relevent ENV
Eg gettext gets added into LDFLAGS, INCLUDE and that. I hope I got everything
that is typical. Prolly not. But we'll find out.
Made readline keg_only because the BSD version is provided by OS X, and I
don't want bug reports that are tricky to solve due to unexpected differences
between the two.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/brewkit.rb | 8 | ||||
| -rwxr-xr-x | Library/Homebrew/install.rb | 24 |
2 files changed, 21 insertions, 11 deletions
diff --git a/Library/Homebrew/brewkit.rb b/Library/Homebrew/brewkit.rb index ebf2235ed..41422ed9e 100644 --- a/Library/Homebrew/brewkit.rb +++ b/Library/Homebrew/brewkit.rb @@ -143,14 +143,6 @@ module HomebrewEnvExtension def enable_warnings remove_from_cflags '-w' end - # so yeah, GNU gettext is a funny one, if you want to use it, you need to - # call this function, see gettext.rb for info. - def gnu_gettext - gettext = Formula.factory 'gettext' - ENV['LDFLAGS'] += " -L#{gettext.lib}" - ENV['CPPFLAGS'] = "#{ENV['CPPFLAGS']} -I#{gettext.include}" - ENV['PATH'] += ":#{gettext.bin}" - end private def append key, value diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index 575fbe8f3..008d5663c 100755 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -21,9 +21,27 @@ link it into the Homebrew prefix: EOS end -def install f - build_time = nil +def ENV_append key, value, separator = ' ' + if ENV[key] and not ENV[key].empty? + ENV[key] += separator+value + else + ENV[key] = value + end +end + + +def install f + f.deps.each do |dep| + dep = Formula.factory dep + if dep.keg_only? + ENV_append 'LDFLAGS', "-L#{dep.lib}" + ENV_append 'CPPFLAGS', "-I#{dep.include}" + ENV_append 'PATH', "#{dep.bin}", ':' + end + end + + build_time = nil begin f.brew do if ARGV.flag? '--interactive' @@ -87,7 +105,7 @@ def install f end if f.keg_only? - ohai 'Caveats', text_for_keg_only_formula(f) + ohai 'Caveats', text_for_keg_only_formula(f).chomp show_summary_heading = true else begin |
