aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMike McQuaid2014-03-28 15:35:41 +0000
committerMike McQuaid2014-04-03 19:52:20 +0100
commitb4fc0372bd356eefb89e376afec8eb6636893453 (patch)
treee66c4b01bf86aec67a26e99d0f59f573f6ab8804 /Library/Formula
parente2353f438111faebfd6c4a7cf4e5e35ca18dd705 (diff)
downloadhomebrew-b4fc0372bd356eefb89e376afec8eb6636893453.tar.bz2
python: support bottling.
Move a bunch of site_packages stuff to post_install.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/python.rb32
1 files changed, 20 insertions, 12 deletions
diff --git a/Library/Formula/python.rb b/Library/Formula/python.rb
index 142423389..0ec366b9c 100644
--- a/Library/Formula/python.rb
+++ b/Library/Formula/python.rb
@@ -118,14 +118,30 @@ class Python < Formula
system "make", "frameworkinstallextras", "PYTHONAPPSDIR=#{share}/python"
system "make", "quicktest" if build.include? 'quicktest'
- # Post-install, fix up the site-packages so that user-installed Python
- # software survives minor updates, such as going from 2.7.0 to 2.7.1:
+ # Fixes setting Python build flags for certain software
+ # See: https://github.com/Homebrew/homebrew/pull/20182
+ # http://bugs.python.org/issue3588
+ inreplace lib_cellar/"config/Makefile" do |s|
+ s.change_make_var! "LINKFORSHARED",
+ "-u _PyMac_Error $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)"
+ end
# Remove the site-packages that Python created in its Cellar.
site_packages_cellar.rmtree
+
+ (libexec/'setuptools').install resource('setuptools')
+ (libexec/'pip').install resource('pip')
+ end
+
+ def post_install
+ # Fix up the site-packages so that user-installed Python software survives
+ # minor updates, such as going from 2.7.0 to 2.7.1:
+
# Create a site-packages in HOMEBREW_PREFIX/lib/python2.7/site-packages
site_packages.mkpath
+
# Symlink the prefix site-packages into the cellar.
+ site_packages_cellar.delete if site_packages_cellar.exist?
site_packages_cellar.parent.install_symlink site_packages
# Write our sitecustomize.py
@@ -142,8 +158,8 @@ class Python < Formula
setup_args = [ "-s", "setup.py", "--no-user-cfg", "install", "--force", "--verbose",
"--install-scripts=#{bin}", "--install-lib=#{site_packages}" ]
- resource('setuptools').stage { system "#{bin}/python", *setup_args }
- resource('pip').stage { system "#{bin}/python", *setup_args }
+ (libexec/'setuptools').cd { system "#{bin}/python", *setup_args }
+ (libexec/'pip').cd { system "#{bin}/python", *setup_args }
# And now we write the distutils.cfg
cfg = lib_cellar/"distutils/distutils.cfg"
@@ -155,14 +171,6 @@ class Python < Formula
force=1
prefix=#{HOMEBREW_PREFIX}
EOF
-
- # Fixes setting Python build flags for certain software
- # See: https://github.com/Homebrew/homebrew/pull/20182
- # http://bugs.python.org/issue3588
- inreplace lib_cellar/"config/Makefile" do |s|
- s.change_make_var! "LINKFORSHARED",
- "-u _PyMac_Error $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)"
- end
end
def distutils_fix_superenv(args)