diff options
| author | Max Howell | 2010-02-14 12:51:25 +0000 |
|---|---|---|
| committer | Max Howell | 2010-02-14 12:53:24 +0000 |
| commit | 91313b1ca076e987f1da1ae196fe99fd3c0e48d9 (patch) | |
| tree | 8958f2581b3204bac6c5ce9128e2c0c1b2a82de7 /Library | |
| parent | 258720c3861e90e386d097e08a6ffa888eacb386 (diff) | |
| download | homebrew-91313b1ca076e987f1da1ae196fe99fd3c0e48d9.tar.bz2 | |
Install pip manually
This means any existing pydist configuration cannot break pip's installation.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/pip.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Library/Formula/pip.rb b/Library/Formula/pip.rb index 37d6d5b86..15912ed2e 100644 --- a/Library/Formula/pip.rb +++ b/Library/Formula/pip.rb @@ -8,15 +8,18 @@ class Pip <Formula depends_on 'setuptools' def install - dest = "#{prefix}/lib/pip" - system "python", "setup.py", "install", "--prefix=#{prefix}", - "--install-purelib=#{dest}" + dest = prefix+"lib/pip" + # make sure we use the right python (distutils rewrites the shebang) # also adds the pip lib path to the PYTHONPATH - script = DATA.read - script.sub! "HOMEBREW_PIP_PATH", dest - (bin+'pip').unlink - (bin+'pip').write script + (bin+'pip').write(DATA.read.sub("HOMEBREW_PIP_PATH", dest)) + + # FIXME? If we use /usr/bin/env python in the pip script + # then should we be hardcoding this version? I dunno. + python_version = `python -V 2>&1`.match('Python (\d+\.\d+)').captures.at(0) + + dest.install('pip') + cp 'pip.egg-info/PKG-INFO', "#{dest}/pip-#{version}-py#{python_version}.egg-info" end def two_line_instructions @@ -24,10 +27,9 @@ class Pip <Formula "Run 'pip help' to see a list of commands." end - # http://github.com/mxcl/homebrew/issues/issue/711 def caveats - cfg = '~/.pydistutils.cfg' - "pip will break unless you delete your #{cfg} file!" if File.exist?(File.expand_path(cfg)) + # I'm going to add a proper two_line_instructions formula function at some point + two_line_instructions end end |
