diff options
| author | Mike McQuaid | 2013-03-02 11:39:20 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2013-03-02 11:39:22 +0000 |
| commit | b71cdae2de4c83297c806662b462b2cf1a442ae6 (patch) | |
| tree | 556fdf2a17721867e310b6e600a496d8161361c3 /Library | |
| parent | 680eacc87dfdbfdc94dffcfad960a6fcb6f82254 (diff) | |
| download | homebrew-b71cdae2de4c83297c806662b462b2cf1a442ae6.tar.bz2 | |
qt: fix superenv and other cleanup.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/qt.rb | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/Library/Formula/qt.rb b/Library/Formula/qt.rb index 8783a6aa5..33e8e0c12 100644 --- a/Library/Formula/qt.rb +++ b/Library/Formula/qt.rb @@ -13,24 +13,17 @@ class Qt < Formula head 'git://gitorious.org/qt/qt.git', :branch => 'master' - env :std # Otherwise fails on SSE intrinsics - - fails_with :clang do - build 425 - end - option :universal option 'with-qtdbus', 'Enable QtDBus module' option 'with-qt3support', 'Enable deprecated Qt3Support module' option 'with-demos-examples', 'Enable Qt demos and examples' option 'with-debug-and-release', 'Compile Qt in debug and release mode' - option 'with-mysql', 'Enable MySQL plugin' option 'developer', 'Compile and link Qt with developer options' depends_on :libpng - depends_on "d-bus" if build.include? 'with-qtdbus' - depends_on "mysql" if build.include? 'with-mysql' + depends_on "d-bus" if build.with? 'qtdbus' + depends_on "mysql" => :optional depends_on 'sqlite' if MacOS.version == :leopard def patches @@ -43,11 +36,28 @@ class Qt < Formula def install ENV.append "CXXFLAGS", "-fvisibility=hidden" + + # clang complains about extra qualifier since Xcode 4.6 (clang build 425) + # https://bugreports.qt-project.org/browse/QTBUG-29373 + if MacOS.clang_build_version >= 425 + inreplace "src/gui/kernel/qt_cocoa_helpers_mac_p.h", + "::TabletProximityRec", + "TabletProximityRec" + end + args = ["-prefix", prefix, "-system-libpng", "-system-zlib", "-confirm-license", "-opensource", "-cocoa", "-fast" ] + # we have to disable all tjos to avoid triggering optimization code + # that will fail with clang. Only seems to occur in superenv, perhaps + # because we rename clang to cc and Qt thinks it can build with special + # assembler commands. In --env=std, Qt seems aware of this.) + # But we want superenv, because it allows to build Qt in non-standard + # locations and with Xcode-only. + args << "-no-3dnow" if superenv? + args << "-L#{MacOS::X11.prefix}/lib" << "-I#{MacOS::X11.prefix}/include" if MacOS::X11.installed? args << "-platform" << "unsupported/macx-clang" if ENV.compiler == :clang @@ -55,20 +65,20 @@ class Qt < Formula # See: https://github.com/mxcl/homebrew/issues/issue/744 args << "-system-sqlite" if MacOS.version == :leopard - args << "-plugin-sql-mysql" if build.include? 'with-mysql' + args << "-plugin-sql-mysql" if build.with? 'mysql' - if build.include? 'with-qtdbus' + if build.with? 'qtdbus' args << "-I#{Formula.factory('d-bus').lib}/dbus-1.0/include" args << "-I#{Formula.factory('d-bus').include}/dbus-1.0" end - if build.include? 'with-qt3support' + if build.with? 'qt3support' args << "-qt3support" else args << "-no-qt3support" end - unless build.include? 'with-demos-examples' + unless build.with? 'demos-examples' args << "-nomake" << "demos" << "-nomake" << "examples" end @@ -80,7 +90,7 @@ class Qt < Formula args << '-arch' << 'x86' end - if build.include? 'with-debug-and-release' + if build.with? 'debug-and-release' args << "-debug-and-release" # Debug symbols need to find the source so build in the prefix mv "../qt-everywhere-opensource-src-#{version}", "#{prefix}/src" @@ -125,8 +135,8 @@ class Qt < Formula end end - def test - system "#{bin}/qmake", "--version" + test do + system "#{bin}/qmake", '-project' end def caveats; <<-EOS.undent |
