2013-01-21 14:16:08 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Pyenv < Formula
|
|
|
|
homepage 'https://github.com/yyuu/pyenv'
|
2014-02-11 03:21:47 +00:00
|
|
|
url 'https://github.com/yyuu/pyenv/archive/v0.4.0-20140211.tar.gz'
|
|
|
|
sha1 'f7c8a5baa9a6f857344935bec3f280a5fe1c6408'
|
2013-01-21 14:16:08 +00:00
|
|
|
|
|
|
|
head 'https://github.com/yyuu/pyenv.git'
|
|
|
|
|
2014-01-10 02:41:06 +00:00
|
|
|
depends_on 'autoconf' => [:recommended, :run]
|
|
|
|
depends_on 'pkg-config' => [:recommended, :run]
|
2013-01-21 14:16:08 +00:00
|
|
|
|
|
|
|
def install
|
2014-01-10 02:41:06 +00:00
|
|
|
inreplace 'libexec/pyenv', '/usr/local', HOMEBREW_PREFIX
|
2013-01-21 14:16:08 +00:00
|
|
|
prefix.install "LICENSE", "README.md", "bin", "completions", "libexec"
|
|
|
|
prefix.install "plugins" => "default-plugins"
|
|
|
|
|
|
|
|
var_lib = "#{HOMEBREW_PREFIX}/var/lib/pyenv"
|
|
|
|
['plugins', 'versions'].each do |dir|
|
|
|
|
var_dir = "#{var_lib}/#{dir}"
|
|
|
|
mkdir_p var_dir
|
|
|
|
ln_sf var_dir, "#{prefix}/#{dir}"
|
|
|
|
end
|
|
|
|
|
|
|
|
ln_sf "#{prefix}/default-plugins/python-build", "#{var_lib}/plugins/python-build"
|
|
|
|
["pyenv-install", "pyenv-uninstall", "python-build"].each do |cmd|
|
|
|
|
bin.install_symlink "#{prefix}/default-plugins/python-build/bin/#{cmd}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
To enable shims and autocompletion add to your profile:
|
|
|
|
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
|
|
|
|
|
|
|
|
To use Homebrew's directories rather than ~/.pyenv add to your profile:
|
|
|
|
export PYENV_ROOT=#{opt_prefix}
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|