aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/python.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/Library/Formula/python.rb b/Library/Formula/python.rb
index ef677ff30..a5f5db2f3 100644
--- a/Library/Formula/python.rb
+++ b/Library/Formula/python.rb
@@ -67,10 +67,17 @@ class Python < Formula
--enable-ipv6
--datarootdir=#{share}
--datadir=#{share}
- --without-gcc
--enable-framework=#{prefix}/Frameworks
]
+ args << '--without-gcc' if ENV.compiler == :clang
+
+ # Don't use optimizations other than "-Os" here, because Python's distutils
+ # remembers (hint: `python-config --cflags`) and reuses them for C
+ # extensions which can break software (such as scipy 0.11 fails when
+ # "-msse4" is present.)
+ ENV.minimal_optimization
+
# We need to enable warnings because the configure.in uses -Werror to detect
# "whether gcc supports ParseTuple" (https://github.com/mxcl/homebrew/issues/12194)
ENV.enable_warnings
@@ -78,7 +85,6 @@ class Python < Formula
# http://docs.python.org/devguide/setup.html#id8 suggests to disable some Warnings.
ENV.append_to_cflags '-Wno-unused-value'
ENV.append_to_cflags '-Wno-empty-body'
- ENV.append_to_cflags '-Qunused-arguments'
end
if build.universal?
@@ -99,8 +105,8 @@ class Python < Formula
ENV.deparallelize # Installs must be serialized
# Tell Python not to install into /Applications (default for framework builds)
system "make", "install", "PYTHONAPPSDIR=#{prefix}"
- # Demos and Tools into HOMEBREW_PREFIX/share/python2.7
- system "make", "frameworkinstallextras", "PYTHONAPPSDIR=#{share}/python2.7"
+ # Demos and Tools into HOMEBREW_PREFIX/share/python
+ system "make", "frameworkinstallextras", "PYTHONAPPSDIR=#{share}/python"
system "make", "quicktest" if build.include? 'quicktest'
# Post-install, fix up the site-packages and install-scripts folders
@@ -114,10 +120,6 @@ class Python < Formula
# Symlink the prefix site-packages into the cellar.
ln_s site_packages, site_packages_cellar
- # Python 3 has a 2to3, too. Additionally there still is a 2to3-2.7.
- # (https://github.com/mxcl/homebrew/issues/12581)
- rm bin/"2to3" if (HOMEBREW_PREFIX/"bin/2to3").exist? and (bin/"2to3").exist?
-
# Tell distutils-based installers where to put scripts
scripts_folder.mkpath
(effective_lib+"python2.7/distutils/distutils.cfg").write <<-EOF.undent
@@ -136,7 +138,7 @@ class Python < Formula
#{prefix}/Frameworks/Python.framework
You can find the Python demo at
- #{HOMEBREW_PREFIX}/share/python2.7/Extras
+ #{HOMEBREW_PREFIX}/share/python/Extras
You can `brew linkapps` to symlink "Idle" and the "Python Launcher".