aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/postgresql.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2013-08-06 09:11:39 -0700
committerAdam Vandenberg2013-08-06 09:11:39 -0700
commitafc747e92d28408bbabf35ae2bb69de73d6e4756 (patch)
tree809ed5ecb7f1e87f5c1f1929653d703812021157 /Library/Formula/postgresql.rb
parent25fe676742c4a29f8574b655380b0aff6e86818a (diff)
downloadhomebrew-afc747e92d28408bbabf35ae2bb69de73d6e4756.tar.bz2
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.
Diffstat (limited to 'Library/Formula/postgresql.rb')
-rw-r--r--Library/Formula/postgresql.rb37
1 files changed, 18 insertions, 19 deletions
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