From f33f3eafe6d512864feaa43e70cfc6cfa269aded Mon Sep 17 00:00:00 2001 From: samueljohn Date: Wed, 15 Aug 2012 10:22:14 +0200 Subject: 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 --- Library/Formula/python3.rb | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'Library/Formula/python3.rb') 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 -- cgit v1.2.3