From ede4ccbbc3dfee94e4c2d6273f5e9f644c4bfcb7 Mon Sep 17 00:00:00 2001 From: Brian Jensen Date: Tue, 12 Nov 2013 14:06:48 +0100 Subject: pyqt: enable build with libc++ on Mavericks Closes #24213. Signed-off-by: Jack Nagel --- Library/Formula/pyqt.rb | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/pyqt.rb b/Library/Formula/pyqt.rb index 155228349..ce74b7e1c 100644 --- a/Library/Formula/pyqt.rb +++ b/Library/Formula/pyqt.rb @@ -16,17 +16,36 @@ class Pyqt < Formula depends_on 'sip' end + def patches + # On Mavericks we want to target libc++, but this requires a user specified + # qmake makespec. Unfortunately user specified makespecs are broken in the + # configure.py script, so we have to fix the makespec path handling logic. + DATA + end + def install python do + + # On Mavericks we want to target libc++, this requires a non default qt makespec + if ENV.compiler == :clang and MacOS.version >= :mavericks + ENV.append "QMAKESPEC", "unsupported/macx-clang-libc++" + end + args = [ "--confirm-license", "--bindir=#{bin}", "--destdir=#{lib}/#{python.xy}/site-packages", "--sipdir=#{share}/sip#{python.if3then3}" ] - # We need to run "configure.py" so that pyqtconfig.py is generated and - # PyQWT needs that. But to do the actual compile, we use the newer - # "configure-ng.py" that is recommened in the README. + # We need to run "configure.py" so that pyqtconfig.py is generated, which + # is needed by PyQWT for determining the correct build settings. But do + # the actual compile, we use the newer configure-ng.py. system python, "configure.py", *args (python.site_packages/'PyQt4').install 'pyqtconfig.py' + + # On Mavericks we want to target libc++, this requires a non default qt makespec + if ENV.compiler == :clang and MacOS.version >= :mavericks + args << "--spec" << "unsupported/macx-clang-libc++" + end + system python, "./configure-ng.py", *args system "make" system "make", "install" @@ -67,3 +86,17 @@ class Pyqt < Formula end end end +__END__ +diff --git a/configure.py b/configure.py +index a8e5dcd..a5f1474 100644 +--- a/configure.py ++++ b/configure.py +@@ -1886,7 +1886,7 @@ def get_build_macros(overrides): + if "QMAKESPEC" in list(os.environ.keys()): + fname = os.environ["QMAKESPEC"] + +- if not os.path.dirname(fname): ++ if not os.path.dirname(fname) or fname.startswith('unsupported'): + qt_macx_spec = fname + fname = os.path.join(qt_archdatadir, "mkspecs", fname) + elif sys.platform == "darwin": -- cgit v1.2.3