pypy: install to libexec and install pip

* sequester pypy in `libexec` and symlink out its binaries only
* re-add pip installation to pypy

Fixes Homebrew/homebrew#20809.
Closes Homebrew/homebrew#22807.
master
Adam Vandenberg 2013-09-24 22:22:05 -07:00
parent 8f2657a243
commit 9828cca047
1 changed files with 14 additions and 4 deletions

View File

@ -13,10 +13,19 @@ class Pypy < Formula
sha1 'b8bf9c2b8a114045598f0e16681d6a63a4d6cdf9'
end
resource 'pip' do
url 'https://pypi.python.org/packages/source/p/pip/pip-1.4.1.tar.gz'
sha1 '9766254c7909af6d04739b4a7732cc29e9a48cb0'
end
def install
rmtree 'site-packages'
prefix.install Dir['*']
# The PyPy binary install instructions suggest installing somewhere
# (like /opt) and symlinking in binaries as needed. Specifically,
# we want to avoid putting PyPy's Python.h somewhere that configure
# scripts will find it.
libexec.install Dir['*']
# Post-install, fix up the site-packages and install-scripts folders
# so that user-installed Python software survives minor updates, such
@ -26,7 +35,7 @@ class Pypy < Formula
prefix_site_packages.mkpath
# Symlink the prefix site-packages into the cellar.
ln_s prefix_site_packages, prefix+'site-packages'
ln_s prefix_site_packages, libexec+'site-packages'
# Tell distutils-based installers where to put scripts
scripts_folder.mkpath
@ -39,7 +48,8 @@ class Pypy < Formula
# $ easy_install pip
# $ pip install --upgrade setuptools
# to get newer versions of setuptools outside of Homebrew.
resource('setuptools').stage { system "#{bin}/pypy", "setup.py", "install" }
resource('setuptools').stage { system "#{libexec}/bin/pypy", "setup.py", "install" }
resource('pip').stage { system "#{libexec}/bin/pypy", "setup.py", "install" }
# Symlink to easy_install_pypy.
unless (scripts_folder+'easy_install_pypy').exist?
@ -84,6 +94,6 @@ class Pypy < Formula
# The Cellar location of distutils
def distutils
prefix+"lib-python/2.7/distutils"
libexec+"lib-python/2.7/distutils"
end
end