diff options
| author | Jannis Leidel | 2009-10-20 21:26:13 +0200 |
|---|---|---|
| committer | Max Howell | 2009-12-02 12:53:00 +0000 |
| commit | f946b720423a32123d7bea61d699640f86bc33a3 (patch) | |
| tree | 8b6d78754636aae76d816579182f33409688d95d /Library/Formula/setuptools.rb | |
| parent | bd437843a26d501083fb66c64fad0cc601724cbe (diff) | |
| download | homebrew-f946b720423a32123d7bea61d699640f86bc33a3.tar.bz2 | |
Added pip and setuptools formula
As discussed on IRC this simplifies the Python
packaging strategy of Homebrew. It's a modified
version of the hints given on http://bit.ly/HomebrewPython
and renders them unnecessary.
setuptools and pip will be installed separately
from Python's site-packages (e.g.
"#{prefix}/lib/pip") but will install other
packages in the Python's site-packages directory
and *not* inside their own directories.
In case the Python brew is removed or unlinked
all packages installed with pip will be removed
or unlinked, too. When using the non-framework
install of Python (e.g. not the OS X' default)
these restrictions also apply in case of the
installation of a new version of Python.
Diffstat (limited to 'Library/Formula/setuptools.rb')
| -rw-r--r-- | Library/Formula/setuptools.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Library/Formula/setuptools.rb b/Library/Formula/setuptools.rb new file mode 100644 index 000000000..0cb91342f --- /dev/null +++ b/Library/Formula/setuptools.rb @@ -0,0 +1,27 @@ +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' + + def install + dest=prefix+'lib/setuptools' + FileUtils.mkdir_p dest + ENV.append 'PYTHONPATH', dest, ":" + system "python", "setup.py", "install", "--prefix=#{prefix}", "--install-lib=#{dest}" + + site_packages = `python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`.chomp + pth = Pathname.new site_packages+'/homebrew.pth' + ohai "Writing #{pth} to enable setuptools" + data = DATA.read + data.sub! "HOMEBREW_SETUPTOOLS_PATH", dest + pth.unlink if pth.exist? + pth.write data + end +end + +__END__ +# Please dont't modify this file, Homebrew will overwrite it. +import site; site.addsitedir('HOMEBREW_SETUPTOOLS_PATH') |
