DRY out the X11 detection code
This commit is contained in:
parent
4c1c677fee
commit
4731d17805
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue