superenv: Add brewed-python bin to PATH

A required special case since formula that use python can optionally use system python or Homebrew python. We'll probably need more of this sort of thing.
This commit is contained in:
Max Howell 2012-10-01 09:37:42 -04:00
parent b30454d3be
commit 3cb7a02beb

View File

@ -106,6 +106,7 @@ class << ENV
paths << "#{MacSystem.xcode43_developer_dir}/Toolchains/XcodeDefault.xctoolchain/usr/bin"
end
paths += all_deps.map{|dep| "#{HOMEBREW_PREFIX}/opt/#{dep}/bin" }
paths << "#{HOMEBREW_PREFIX}/opt/python/bin" if brewed_python?
paths << "#{MacSystem.x11_prefix}/bin" if x11?
paths += %w{/usr/bin /bin /usr/sbin /sbin}
paths.to_path_s
@ -137,7 +138,7 @@ class << ENV
paths << "#{sdk}/usr/include/libxml2" unless deps.include? 'libxml2'
if MacSystem.xcode43_without_clt?
paths << "#{sdk}/usr/include/apache2"
paths << if Formula.factory('python').linked_keg.directory?
paths << if brewed_python?
"#{HOMEBREW_PREFIX}/opt/python/Frameworks/Python.framework/Headers"
else
"#{sdk}/System/Library/Frameworks/Python.framework/Versions/Current/include/python2.7"
@ -193,6 +194,11 @@ class << ENV
end
end
def brewed_python?
require 'formula'
Formula.factory('python').linked_keg.directory?
end
public
### NO LONGER NECESSARY OR NO LONGER SUPPORTED