homebrew-core/Formula/pyenv.rb
Yamashita Yuu f4d71f2d02 pyenv 20140628
Changes:

* python-build: Add new Anaconda releases; anaconda-2.0.1, anaconda3-2.0.1
* python-build: Add new PyPy3 release; pypy3-2.3.1
* python-build: Add ancient CPython releases; 2.1.3, 2.2.3, 2.3.7
* python-build: Use `ez_setup.py` and `get-pip.py` instead of installing them from tarballs
* python-build: Add support for command-line options to `ez_setup.py` and `get-pip.py`

Closes Homebrew/homebrew#30511.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2014-06-28 11:00:12 -07:00

39 lines
1.3 KiB
Ruby

require "formula"
class Pyenv < Formula
homepage "https://github.com/yyuu/pyenv"
head "https://github.com/yyuu/pyenv.git"
url "https://github.com/yyuu/pyenv/archive/v20140628.tar.gz"
sha1 "762659e66b454f8ef74f728ea9e1c4a0009a29ee"
depends_on "autoconf" => [:recommended, :run]
depends_on "pkg-config" => [:recommended, :run]
def install
inreplace "libexec/pyenv", "/usr/local", HOMEBREW_PREFIX
prefix.install "bin", "completions", "libexec"
prefix.install "plugins" => "default-plugins"
var_lib = "#{HOMEBREW_PREFIX}/var/lib/pyenv"
%w[plugins versions].each do |dir|
var_dir = "#{var_lib}/#{dir}"
mkdir_p var_dir
ln_sf var_dir, "#{prefix}/#{dir}"
end
rm_f "#{var_lib}/plugins/python-build"
ln_sf "#{prefix}/default-plugins/python-build", "#{var_lib}/plugins/python-build"
%w[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