From afc747e92d28408bbabf35ae2bb69de73d6e4756 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Tue, 6 Aug 2013 09:11:39 -0700 Subject: posgresql: restore Python arch check The Python arch check in the Postgres formula was changed to use the new python helper. This was incorrect. We specifically want to check for a 32-bit python located in /Library. --- Library/Formula/postgresql.rb | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/postgresql.rb b/Library/Formula/postgresql.rb index 5f8b0a616..3d3d77b81 100644 --- a/Library/Formula/postgresql.rb +++ b/Library/Formula/postgresql.rb @@ -60,7 +60,7 @@ class Postgresql < Formula ENV.append 'LIBS', `uuid-config --libs`.strip end - if not build.build_32_bit? and MacOS.prefer_64_bit? and build.with? 'python' + if build.with? 'python' and MacOS.prefer_64_bit? and not build.build_32_bit? args << "ARCHFLAGS='-arch x86_64'" check_python_arch end @@ -75,24 +75,23 @@ class Postgresql < Formula end def check_python_arch - # On 64-bit systems, we need to avoid a 32-bit Framework Python. - if python.framework? - unless archs_for_command(python.binary).include? :x86_64 - opoo "Detected a framework Python that does not have 64-bit support in:" - puts <<-EOS.undent - #{python.prefix} - - The configure script seems to prefer this version of Python over any others, - so you may experience linker problems as described in: - http://osdir.com/ml/pgsql-general/2009-09/msg00160.html - - To fix this issue, you may need to either delete the version of Python - shown above, or move it out of the way before brewing PostgreSQL. - - Note that a framework Python in /Library/Frameworks/Python.framework is - the "MacPython" version, and not the system-provided version which is in: - /System/Library/Frameworks/Python.framework - EOS + # On 64-bit systems, we need to look for a 32-bit Framework Python. + # The configure script prefers this Python version, and if it doesn't + # have 64-bit support then linking will fail. + framework_python = Pathname.new("/Library/Frameworks/Python.framework/Versions/Current/Python") + return unless framework_python.exist? + unless (archs_for_command(framework_python)).include? :x86_64 + opoo "Detected a framework Python that does not have 64-bit support in:" + puts <<-EOS.undent + #{framework_python} + + The configure script seems to prefer this version of Python over any others, + so you may experience linker problems as described in: + http://osdir.com/ml/pgsql-general/2009-09/msg00160.html + + To fix this issue, you may need to either delete the version of Python + shown above, or move it out of the way before brewing PostgreSQL. + EOS end end end -- cgit v1.2.3