aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/python3.rb
diff options
context:
space:
mode:
authorsamueljohn2012-08-15 10:22:14 +0200
committerJack Nagel2012-08-18 23:02:36 -0500
commitf33f3eafe6d512864feaa43e70cfc6cfa269aded (patch)
treec317a918f96fd958509bf61c5b8b63a0f080d734 /Library/Formula/python3.rb
parent3378deda040e8fc38bee4564b72f2edd9600aa79 (diff)
downloadhomebrew-f33f3eafe6d512864feaa43e70cfc6cfa269aded.tar.bz2
python3: ENV.minimal_optimization and cleanup
- Since 3.2.3, the "2to3" script has a version suffix already. - Added `--without-gcc` to ensure python uses clang. - Avoid optimization flags that are remembers by python (e.g. `python3.2-config --cflags`) and lead to problems with certain C-extensions. Closes #14198. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula/python3.rb')
-rw-r--r--Library/Formula/python3.rb21
1 files changed, 14 insertions, 7 deletions
diff --git a/Library/Formula/python3.rb b/Library/Formula/python3.rb
index 1bb9e2c13..3cf82a30a 100644
--- a/Library/Formula/python3.rb
+++ b/Library/Formula/python3.rb
@@ -67,9 +67,20 @@ class Python3 < Formula
end
def install
- args = [ "--prefix=#{prefix}",
- "--enable-ipv6",
- "--enable-framework=#{prefix}/Frameworks" ]
+ args = %W[--prefix=#{prefix}
+ --enable-ipv6
+ --datarootdir=#{share}
+ --datadir=#{share}
+ --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)
@@ -78,7 +89,6 @@ class Python3 < 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
# Allow sqlite3 module to load extensions:
@@ -112,9 +122,6 @@ class Python3 < Formula
# Make sure homebrew symlinks it to HOMEBREW_PREFIX/bin.
ln_s "#{bin}/python3.2", "#{bin}/python3" unless (bin/"python3").exist?
- # Python 2 has a 2to3, too. (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/"python3.2/distutils/distutils.cfg").write <<-EOF.undent