aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMike McQuaid2014-04-01 22:12:41 -0500
committerMike McQuaid2014-04-03 20:17:05 +0100
commit5320391bb52442bcb4549b61e89feff0867d2746 (patch)
treedf4846176f6d50da6a3c468ef8db3c209d263a38 /Library/Formula
parentb4fc0372bd356eefb89e376afec8eb6636893453 (diff)
downloadhomebrew-5320391bb52442bcb4549b61e89feff0867d2746.tar.bz2
python3: support bottling.
Move a bunch of site_packages stuff to post_install. Closes #27968.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/python3.rb27
1 files changed, 16 insertions, 11 deletions
diff --git a/Library/Formula/python3.rb b/Library/Formula/python3.rb
index cf8c7a66d..f2d8acbea 100644
--- a/Library/Formula/python3.rb
+++ b/Library/Formula/python3.rb
@@ -109,14 +109,28 @@ class Python3 < Formula
mv app, app.gsub(".app", " 3.app")
end
- # Post-install, fix up the site-packages so that user-installed Python
- # software survives minor updates, such as going from 3.3.2 to 3.3.3:
+ # A fix, because python and python3 both want to install Python.framework
+ # and therefore we can't link both into HOMEBREW_PREFIX/Frameworks
+ # https://github.com/Homebrew/homebrew/issues/15943
+ ["Headers", "Python", "Resources"].each{ |f| rm(prefix/"Frameworks/Python.framework/#{f}") }
+ rm prefix/"Frameworks/Python.framework/Versions/Current"
+
+ # Remove 2to3 because python2 also installs it
+ rm bin/"2to3"
# Remove the site-packages that Python created in its Cellar.
site_packages_cellar.rmtree
+ end
+
+ def post_install
+ # Fix up the site-packages so that user-installed Python software survives
+ # minor updates, such as going from 3.3.2 to 3.3.3:
+
# Create a site-packages in HOMEBREW_PREFIX/lib/python#{VER}/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,15 +156,6 @@ class Python3 < Formula
[install]
prefix=#{HOMEBREW_PREFIX}
EOF
-
- # A fix, because python and python3 both want to install Python.framework
- # and therefore we can't link both into HOMEBREW_PREFIX/Frameworks
- # https://github.com/Homebrew/homebrew/issues/15943
- ["Headers", "Python", "Resources"].each{ |f| rm(prefix/"Frameworks/Python.framework/#{f}") }
- rm prefix/"Frameworks/Python.framework/Versions/Current"
-
- # Remove 2to3 because python2 also installs it
- rm bin/"2to3"
end
def distutils_fix_superenv(args)