aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2010-02-14 12:51:25 +0000
committerMax Howell2010-02-14 12:53:24 +0000
commit91313b1ca076e987f1da1ae196fe99fd3c0e48d9 (patch)
tree8958f2581b3204bac6c5ce9128e2c0c1b2a82de7 /Library
parent258720c3861e90e386d097e08a6ffa888eacb386 (diff)
downloadhomebrew-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.rb22
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