brew/Library/Homebrew/requirements/python_dependency.rb

43 lines
603 B
Ruby
Raw Normal View History

require 'requirement'
class PythonDependency < Requirement
fatal true
satisfy :build_env => false do
which python_binary
end
def modify_build_environment
ENV['PYTHONPATH'] = "#{HOMEBREW_PREFIX}/lib/python2.7/site-packages"
end
# Deprecated
def to_s
python_binary
end
protected
def python_binary
'python'
end
def system_python?
which(python_binary).to_s == "/usr/bin/python"
end
end
class Python3Dependency < PythonDependency
default_formula 'python3'
protected
def python_binary
'python3'
2013-06-27 01:43:30 -05:00
end
def system_python?
false
end
end