Skip to content

Commit

Permalink
Extending brew --env to include formula info
Browse files Browse the repository at this point in the history
Extending `brew --env` to include formula include paths so you can easily find keg only formula from outside of brew.
  • Loading branch information
ashgti committed Jul 16, 2012
1 parent b597ac0 commit ba4e250
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Library/Homebrew/cmd/--env.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ def __env
ENV.extend(HomebrewEnvExtension) ENV.extend(HomebrewEnvExtension)
ENV.setup_build_environment ENV.setup_build_environment
ENV.universal_binary if ARGV.build_universal? ENV.universal_binary if ARGV.build_universal?
ARGV.formulae.each do |f|
# NOTE: Copied from build.rb def install (line ~63)
# TODO: Refactor to have a single instance of this code.
if dep.keg_only?
ENV.prepend 'LDFLAGS', "-L#{dep.lib}"
ENV.prepend 'CPPFLAGS', "-I#{dep.include}"
ENV.prepend 'PATH', "#{dep.bin}", ':'

pcdir = dep.lib/'pkgconfig'
ENV.prepend 'PKG_CONFIG_PATH', pcdir, ':' if pcdir.directory?

acdir = dep.share/'aclocal'
ENV.prepend 'ACLOCAL_PATH', acdir, ':' if acdir.directory?
end
end
if $stdout.tty? if $stdout.tty?
dump_build_env ENV dump_build_env ENV
else else
Expand Down

0 comments on commit ba4e250

Please sign in to comment.