aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2012-08-31 08:27:00 -0400
committerMax Howell2012-08-31 10:22:10 -0400
commit05c708b9fc2a97dd890bdfb478b749b3e6e215e5 (patch)
tree86050d77f188b3359306e0e2809217dd44c25aa3 /Library
parent113ed85e8dc25f71031df13d90d98a7016458a68 (diff)
downloadbrew-05c708b9fc2a97dd890bdfb478b749b3e6e215e5.tar.bz2
Revert the user-PATH fix
User paths might have anything in them, anything can break builds. Instead special case these two formula with the view to having an eventual DSL to allow injection of user paths into superenv. Certainly defaulting to off.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Homebrew/build.rb21
-rw-r--r--Library/Homebrew/superenv.rb1
2 files changed, 20 insertions, 2 deletions
diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb
index 3fec81d37..5f51d79ea 100755
--- a/Library/Homebrew/build.rb
+++ b/Library/Homebrew/build.rb
@@ -52,17 +52,36 @@ rescue Exception => e
end
end
-def install f
+def pre_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
+ when 'lilypond', 'nginx'
+ 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
stdenvs = %w{fontforge python python3 ruby ruby-enterprise-edition jruby wine}
ARGV.unshift '--env=std' if (stdenvs.include?(f.name) or
f.recursive_deps.detect{|d| d.name == 'scons' }) and
not ARGV.include? '--env=super'
+end
+def install f
keg_only_deps = f.recursive_deps.uniq.select{|dep| dep.keg_only? }
+ pre_superenv_hacks(f)
require 'superenv'
ENV.setup_build_environment unless superenv?
diff --git a/Library/Homebrew/superenv.rb b/Library/Homebrew/superenv.rb
index f059283ce..ce5eecf9c 100644
--- a/Library/Homebrew/superenv.rb
+++ b/Library/Homebrew/superenv.rb
@@ -100,7 +100,6 @@ class << ENV
paths << HOMEBREW_PREFIX/:bin
paths << "#{MacSystem.x11_prefix}/bin" if x11?
paths += %w{/usr/bin /bin /usr/sbin /sbin}
- paths += ORIGINAL_PATHS.map{|pn| pn.realpath.to_s rescue nil } - %w{/usr/X11/bin /opt/X11/bin}
paths.to_path_s
end