From d7fb5a4fb0199cfbc6352b71531a9ed9bbd1a15a Mon Sep 17 00:00:00 2001 From: Yacin Nadji Date: Sat, 5 Mar 2011 15:06:52 -0500 Subject: Add option to python formula to remove poll Apple's implementation of poll does not support devices, which causes socket operations that rely on a properly functioning poll to fail with Errno 35 [2]. This creates an option to strip out poll entirely, which is what Apple does for the binaries they package with the OS [1]. 1: https://svn.macports.org/ticket/18376 2: http://bugs.python.org/issue5154 Signed-off-by: Adam Vandenberg --- Library/Formula/python.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Library/Formula/python.rb') diff --git a/Library/Formula/python.rb b/Library/Formula/python.rb index cf17b0292..d7d22790c 100644 --- a/Library/Formula/python.rb +++ b/Library/Formula/python.rb @@ -14,6 +14,7 @@ There are a few options for customzing the build. --universal: Builds combined 32-/64-bit Intel binaries. --framework: Builds a "Framework" version of Python. --static: Builds static instead of shared libraries. + --no-poll: Don't include Apple's broken poll implementation. site-packages ------------- @@ -60,7 +61,8 @@ class Python < Formula [ ["--framework", "Do a 'Framework' build instead of a UNIX-style build."], ["--universal", "Build for both 32 & 64 bit Intel."], - ["--static", "Build static libraries."] + ["--static", "Build static libraries."], + ["--no-poll", "Remove HAVE_POLL.* options from build."] ] end @@ -121,6 +123,11 @@ class Python < Formula '#sqlite_defines.append(("SQLITE_OMIT_LOAD_EXTENSION", "1"))' system "./configure", *args + + if ARGV.include? '--no-poll' + inreplace 'pyconfig.h', /.*?(HAVE_POLL[_A-Z]*).*/, '#undef \1' + end + system "make" ENV.j1 # Installs must be serialized system "make install" -- cgit v1.2.3