diff options
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/pip.rb | 38 | ||||
| -rw-r--r-- | Library/Formula/setuptools.rb | 27 |
2 files changed, 65 insertions, 0 deletions
diff --git a/Library/Formula/pip.rb b/Library/Formula/pip.rb new file mode 100644 index 000000000..10333afae --- /dev/null +++ b/Library/Formula/pip.rb @@ -0,0 +1,38 @@ +require 'formula' + +class Pip <Formula + url 'http://pypi.python.org/packages/source/p/pip/pip-0.6.1.tar.gz' + homepage 'http://pip.openplans.org/' + md5 '7560e3055c66afb99ac4a7892389a237' + + depends_on 'setuptools' + + def install + dest = "#{prefix}/lib/pip" + system "python", "setup.py", "install", "--prefix=#{prefix}", + "--install-purelib=#{dest}" + # 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 + end + + def caveats + "pip installs packages. Python packages.\n"+ + "Run 'pip help' to see a list of commands." + end +end + +__END__ +#!/usr/bin/env python +""" +This is the Homebrew pip wrapper +""" +import sys +sys.path.insert(0, 'HOMEBREW_PIP_PATH') +from pip import main + +if __name__ == '__main__': + main()
\ No newline at end of file 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') |
