aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-08-13 16:04:30 -0500
committerJack Nagel2012-08-13 16:04:30 -0500
commit569c34d42b50f5d050b78e66d37b2d2bed58e4d4 (patch)
treed2eb18f7ce5ec78dec99322e422fcee0573ed3ca /Library
parentc4c270596483e53ae49026e93c98a5fea1b743b0 (diff)
downloadhomebrew-569c34d42b50f5d050b78e66d37b2d2bed58e4d4.tar.bz2
qt: use options DSL
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/qt.rb38
1 files changed, 17 insertions, 21 deletions
diff --git a/Library/Formula/qt.rb b/Library/Formula/qt.rb
index 8366510bd..a42c7e7d8 100644
--- a/Library/Formula/qt.rb
+++ b/Library/Formula/qt.rb
@@ -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