homebrew-core/Formula/pyenv.rb
Graeme Coupar 2ba8a6c723 pyenv 20151124
Closes Homebrew/homebrew#46863.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-12-10 23:27:41 +00:00

34 lines
1 KiB
Ruby

class Pyenv < Formula
desc "Python version management"
homepage "https://github.com/yyuu/pyenv"
url "https://github.com/yyuu/pyenv/archive/v20151210.tar.gz"
sha256 "3d251d14579a9f8f60beb45fd36c376e75d3215c7614ec84ef24fda5614a9625"
head "https://github.com/yyuu/pyenv.git"
bottle :unneeded
depends_on "autoconf" => [:recommended, :run]
depends_on "pkg-config" => [:recommended, :run]
depends_on "openssl" => :recommended
def install
inreplace "libexec/pyenv", "/usr/local", HOMEBREW_PREFIX
prefix.install Dir["*"]
%w[pyenv-install pyenv-uninstall python-build].each do |cmd|
bin.install_symlink "#{prefix}/plugins/python-build/bin/#{cmd}"
end
end
def caveats; <<-EOS.undent
To use Homebrew's directories rather than ~/.pyenv add to your profile:
export PYENV_ROOT=#{var}/pyenv
To enable shims and autocompletion add to your profile:
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
EOS
end
test do
shell_output("eval \"$(#{bin}/pyenv init -)\" && pyenv versions")
end
end