diff options
| author | Max Howell | 2009-12-05 18:27:12 +0000 |
|---|---|---|
| committer | Max Howell | 2009-12-05 19:09:15 +0000 |
| commit | 2e84760a17bc69c3f755d37abddf6ff1a6e0d490 (patch) | |
| tree | eae86387649a22ba38bd6940f672a68941a42350 /Library | |
| parent | 1ed3146c39c41348a24560eb05aa10380a20a642 (diff) | |
| download | homebrew-2e84760a17bc69c3f755d37abddf6ff1a6e0d490.tar.bz2 | |
DRY out the X11 detection code
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/qt.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Formula/qt.rb b/Library/Formula/qt.rb index e7a4b847e..c5057bc71 100644 --- a/Library/Formula/qt.rb +++ b/Library/Formula/qt.rb @@ -16,10 +16,14 @@ class Qt <Formula ['--with-qt3support', "Enable deprecated Qt3Support module."], ] end + + def self.x11? + File.exist? "/usr/X11R6/lib" + end depends_on "dbus" if ARGV.include? '--with-dbus' depends_on "dbus" if ARGV.include? '--with-qt3support' - depends_on 'libpng' unless File.exist? "/usr/X11R6/lib" + depends_on 'libpng' unless x11? def install if version == '4.5.3' @@ -48,7 +52,7 @@ class Qt <Formula conf_args << "-no-qt3support" end - if File.exist? "/usr/X11R6/lib" + if x11? conf_args << "-L/usr/X11R6/lib" conf_args << "-I/usr/X11R6/include" else |
