aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/build.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2012-09-14 07:54:14 -0700
committerAdam Vandenberg2012-09-14 09:14:48 -0700
commit88ad4c061d8d2bf7fe1bce29cf474b0bd854df2a (patch)
tree91db8bde1571a776416c78183a002ddcc4be379e /Library/Homebrew/build.rb
parent4bf72a3e622f458c421999595ff9c92050b63814 (diff)
downloadbrew-88ad4c061d8d2bf7fe1bce29cf474b0bd854df2a.tar.bz2
Support env :std, :userpaths
Closes Homebrew/homebrew#14654.
Diffstat (limited to 'Library/Homebrew/build.rb')
-rwxr-xr-xLibrary/Homebrew/build.rb25
1 files changed, 5 insertions, 20 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index f40a7ef34..d3892819b 100755
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -53,32 +53,17 @@ rescue Exception => e
end
def post_superenv_hacks f
- # TODO replace with Formula DSL
- # Python etc. build but then pip can't build stuff.
- # Scons resets ENV and then can't find superenv's build-tools.
- # In some cases we should only apply in the case of an option I suggest the
- # following:
- #
- # option 'with-passenger' do
- # env :userpaths # for superenv
- # end
- # option 'without-foo' do
- # env :std, :x11
- # end
- #
- # NOTE I think all ENV stuff should be specified with a DSL like this now.
- case f.name.to_sym
- when :lilypond, :nginx, :auctex
+ # Only allow Homebrew-approved directories into the PATH, unless
+ # a formula opts-in to allowing the user's path.
+ if f.env.userpaths?
paths = ORIGINAL_PATHS.map{|pn| pn.realpath.to_s rescue nil } - %w{/usr/X11/bin /opt/X11/bin}
ENV['PATH'] = "#{ENV['PATH']}:#{paths.join(':')}"
end
end
def pre_superenv_hacks f
- # fontforge needs 10.7 SDK, wine 32 bit, graphviz has mysteriously missing symbols
- # and ruby/python/ghc etc. create gem/pip that then won't work
- stdenvs = %w{fontforge python python3 ruby ruby-enterprise-edition jruby wine graphviz ghc}
- ARGV.unshift '--env=std' if (stdenvs.include?(f.name) or
+ # Allow a formula to opt-in to the std environment.
+ ARGV.unshift '--env=std' if (f.env.std? or
f.recursive_deps.detect{|d| d.name == 'scons' }) and
not ARGV.include? '--env=super'
end