qt: use options DSL

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-08-13 16:04:30 -05:00
parent 781207e70d
commit fd46952b6b

View file

@ -14,24 +14,20 @@ class Qt < Formula
head 'git://gitorious.org/qt/qt.git', :branch => 'master'
option :universal
option 'with-qtdbus', 'Enable QtDBus module'
option 'with-qt3support', 'Enable deprecated Qt3Support module'
option 'with-demos-examples', 'Eanble Qt demos and examples'
option 'with-debug-and-release', 'Compile Qt in debug and release mode'
option 'developer', 'Compile and link Qt with developer options'
depends_on "d-bus" if build.include? 'with-qtdbus'
depends_on 'sqlite' if MacOS.leopard?
fails_with :clang do
build 421
end
def options
[
['--with-qtdbus', "Enable QtDBus module."],
['--with-qt3support', "Enable deprecated Qt3Support module."],
['--with-demos-examples', "Enable Qt demos and examples."],
['--with-debug-and-release', "Compile Qt in debug and release mode."],
['--universal', "Build both x86_64 and x86 architectures."],
['--developer', 'Compile and link Qt with Qt developer options']
]
end
depends_on "d-bus" if ARGV.include? '--with-qtdbus'
depends_on 'sqlite' if MacOS.leopard?
def patches
# fixes conflict on osx 10.5. See qt bug:
# https://bugreports.qt-project.org/browse/QTBUG-23258
@ -63,30 +59,30 @@ class Qt < Formula
args << "-plugin-sql-mysql" if (HOMEBREW_CELLAR+"mysql").directory?
if ARGV.include? '--with-qtdbus'
if build.include? '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 ARGV.include? '--with-qt3support'
if build.include? 'with-qt3support'
args << "-qt3support"
else
args << "-no-qt3support"
end
unless ARGV.include? '--with-demos-examples'
unless build.include? 'with-demos-examples'
args << "-nomake" << "demos" << "-nomake" << "examples"
end
if MacOS.prefer_64_bit? or ARGV.build_universal?
if MacOS.prefer_64_bit? or build.universal?
args << '-arch' << 'x86_64'
end
if !MacOS.prefer_64_bit? or ARGV.build_universal?
if !MacOS.prefer_64_bit? or build.universal?
args << '-arch' << 'x86'
end
if ARGV.include? '--with-debug-and-release'
if build.include? '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"
@ -95,7 +91,7 @@ class Qt < Formula
args << "-release"
end
args << '-developer-build' if ARGV.include? '--developer'
args << '-developer-build' if build.include? 'developer'
# Needed for Qt 4.8.1 due to attempting to link moc with gcc.
ENV['LD'] = ENV.cxx