Permalink
Browse files

qt: fix superenv and other cleanup.

  • Loading branch information...
MikeMcQuaid committed Mar 2, 2013
1 parent 7984db7 commit 71cfd6be1aadbebec36d1f8f282f89234458ad19
Showing with 26 additions and 16 deletions.
  1. +26 −16 Formula/qt.rb
View
@@ -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,32 +36,49 @@ def patches
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
# 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 @@ def install
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 @@ def install
end
end
def test
system "#{bin}/qmake", "--version"
test do
system "#{bin}/qmake", '-project'
end
def caveats; <<-EOS.undent

0 comments on commit 71cfd6b

Please sign in to comment.