Permalink
Browse files

Don't install setuptools separately

This is partly because we shouldn't install outside of the prefix, partly
because the /Library/Python dir is chown:root for people who sudo
easy_installed at some point before.

I don't know if this is the right thing to do or not. So am committing for
discussion and review in a branch.
  • Loading branch information...
1 parent 4b4c0dc commit c52ae6807f34a775706bfdb50e4841b300359503 @mxcl mxcl committed Feb 20, 2010
Showing with 20 additions and 10 deletions.
  1. +20 −10 Library/Formula/pip.rb
View
@@ -1,12 +1,17 @@
require 'formula'
+class Setuptools <Formula
+ url 'http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz'
+ homepage 'http://pypi.python.org/pypi/setuptools'
+ md5 '7df2a529a074f613b509fb44feefe74e'
+ version '0.6c11'
+end
+
class Pip <Formula
url 'http://pypi.python.org/packages/source/p/pip/pip-0.6.3.tar.gz'
homepage 'http://pip.openplans.org/'
md5 '0602fa9179cfaa98e41565d4a581d98c'
- depends_on 'setuptools'
-
def script lib_path
<<-EOS
#!/usr/bin/env python
@@ -28,18 +33,23 @@ def patches
end
def install
- dest = prefix+"lib/pip"
+ python_version = `python -V 2>&1`.match('Python (\d+\.\d+)').captures.at(0)
+ site_packages = prefix+'site-packages'
+
+ site_packages.mkpath
+
+ Setuptools.new.brew do |f|
+ setuptools_version = f.version
+ mv 'setuptools', site_packages
+ mv 'setuptools.egg-info/PKG-INFO', "#{site_packages}/setuptools-#{setuptools_version}-py#{python_version}.egg"
+ end
# make sure we use the right python (distutils rewrites the shebang)
# also adds the pip lib path to the PYTHONPATH
- (bin+'pip').write(script(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)
+ (bin+'pip').write(script(site_packages))
- dest.install('pip')
- cp 'pip.egg-info/PKG-INFO', "#{dest}/pip-#{version}-py#{python_version}.egg-info"
+ mv 'pip', site_packages
+ mv 'pip.egg-info/PKG-INFO', "#{site_packages}/pip-#{version}-py#{python_version}.egg-info"
end
def two_line_instructions

0 comments on commit c52ae68

Please sign in to comment.