aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMax Howell2009-12-05 18:27:12 +0000
committerMax Howell2009-12-05 19:09:15 +0000
commit2e84760a17bc69c3f755d37abddf6ff1a6e0d490 (patch)
treeeae86387649a22ba38bd6940f672a68941a42350 /Library/Formula
parent1ed3146c39c41348a24560eb05aa10380a20a642 (diff)
downloadhomebrew-2e84760a17bc69c3f755d37abddf6ff1a6e0d490.tar.bz2
DRY out the X11 detection code
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/qt.rb8
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