Skip to content
Snippets Groups Projects
Commit 01b85d85 authored by Max Howell's avatar Max Howell
Browse files

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.
parent e9701dbc
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment