85cf366c68
Changes: * pyenv: Reads only the first word from version file. This is as same behavior as rbenv. * python-build: Fix build of Tkinter with Tcl/Tk 8.6 * python-build: Fix build problem with Readline 6.3 * python-build: Do not exit with errors even if some of modules are absent * python-build: MacOSX was mispelled as MaxOSX in `anaconda_architecture` * python-build: Use default `cc` as the C Compiler to build CPython * python-build: Display value from `pypy_architecture` and `anaconda_architecture` on errors * python-build: Remove old development version; 2.6-dev * python-build: Update default setuptools version (3.3 -> 3.4.1) Closes Homebrew/homebrew#28133. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
40 lines
1.3 KiB
Ruby
40 lines
1.3 KiB
Ruby
require 'formula'
|
|
|
|
class Pyenv < Formula
|
|
homepage 'https://github.com/yyuu/pyenv'
|
|
url 'https://github.com/yyuu/pyenv/archive/v0.4.0-20140404.tar.gz'
|
|
sha1 '7b9e2cd26ac195d9849b1311a94fbdd0c97c2dc2'
|
|
|
|
head 'https://github.com/yyuu/pyenv.git'
|
|
|
|
depends_on 'autoconf' => [:recommended, :run]
|
|
depends_on 'pkg-config' => [:recommended, :run]
|
|
|
|
def install
|
|
inreplace 'libexec/pyenv', '/usr/local', HOMEBREW_PREFIX
|
|
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
|
|
|
|
rm_f "#{var_lib}/plugins/python-build"
|
|
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
|