diff options
| author | Samuel John | 2013-06-07 14:23:29 +0200 |
|---|---|---|
| committer | Samuel John | 2013-06-07 17:58:56 +0200 |
| commit | 98beddbf4e2fd3b500c0eb87887e0a70ed32b131 (patch) | |
| tree | 2ea7c7e3083b43de92ec732dbe586bf923e9b315 /Library/Formula | |
| parent | afaf60d9ad140d30f6e792c81f978993e9392c02 (diff) | |
| download | homebrew-98beddbf4e2fd3b500c0eb87887e0a70ed32b131.tar.bz2 | |
python: simplify how PythonInstalled is used in python.rb
* Should also be more robust as we now explicitly set the
python.binary.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/python.rb | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/Library/Formula/python.rb b/Library/Formula/python.rb index 300c7ecac..c3ecef322 100644 --- a/Library/Formula/python.rb +++ b/Library/Formula/python.rb @@ -120,25 +120,15 @@ class Python < Formula # Symlink the prefix site-packages into the cellar. ln_s site_packages, site_packages_cellar - # We ship distribute and pip and we want to resue the - # PythonInstalled.modify_build_environment, so opt/python/bin/python2 - # has to be there already now and so we create it temporarily: - begin - opt_python = HOMEBREW_PREFIX/"opt/#{name}/bin/python2" - unless opt_python.exist? - opt_python.dirname.mkpath - ln_s bin/'python2', opt_python - end - # We reuse the PythonInstalled requirement here to write the sitecustomize.py - PythonInstalled.new("2.7").modify_build_environment - setup_args = [ "-s", "setup.py", "--no-user-cfg", "install", "--force", "--verbose", - "--install-scripts=#{bin}", "--install-lib=#{site_packages}" ] - Distribute.new.brew { system "#{bin}/python2", *setup_args } - Pip.new.brew { system "#{bin}/python2", *setup_args } - ensure - # Cleanup, so brew can link this properly: - opt_python.dirname.rmtree - end + # We ship distribute and pip and reuse the PythonInstalled + # Requirement here to write the sitecustomize.py + py = PythonInstalled.new("2.7") + py.binary = bin/'python' + py.modify_build_environment + setup_args = [ "-s", "setup.py", "--no-user-cfg", "install", "--force", "--verbose", + "--install-scripts=#{bin}", "--install-lib=#{site_packages}" ] + Distribute.new.brew { system "#{bin}/python2", *setup_args } + Pip.new.brew { system "#{bin}/python2", *setup_args } # And now we write the distuitsl.cfg cfg = prefix/"Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/distutils.cfg" |
