Skip to content

Commit

Permalink
posgresql: restore Python arch check
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
adamv committed Aug 6, 2013
1 parent c864a6c commit 987ad39
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions Formula/postgresql.rb
Expand Up @@ -60,7 +60,7 @@ def install
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
Expand All @@ -75,24 +75,23 @@ def install
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
Expand Down

0 comments on commit 987ad39

Please sign in to comment.