c08510577f
Closes #8168. Signed-off-by: Tim D. Smith <git@tim-smith.us>
36 lines
1.1 KiB
Ruby
36 lines
1.1 KiB
Ruby
class Pyenv < Formula
|
|
desc "Python version management"
|
|
homepage "https://github.com/yyuu/pyenv"
|
|
url "https://github.com/yyuu/pyenv/archive/v1.0.6.tar.gz"
|
|
sha256 "0fccad1d2f970daee3f62ba026b1cc919187d2e545df38c487ec7b75dec480e3"
|
|
version_scheme 1
|
|
head "https://github.com/yyuu/pyenv.git"
|
|
|
|
bottle :unneeded
|
|
|
|
depends_on "autoconf" => [:recommended, :run]
|
|
depends_on "pkg-config" => [:recommended, :run]
|
|
depends_on "openssl" => :recommended
|
|
depends_on "readline" => [:recommended, :run]
|
|
|
|
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
|