Merge pull request #8519 from rolandwalker/x11_detection
Check for libpng to assure X11 detection
This commit is contained in:
commit
60da9879e6
|
@ -159,7 +159,9 @@ class Cask::Installer
|
|||
|
||||
def x11_dependencies
|
||||
return unless @cask.depends_on.x11
|
||||
raise CaskX11DependencyError.new(@cask.token) unless Cask.x11_executable.exist?
|
||||
if Cask.x11_libpng.select(&:exist?).empty?
|
||||
raise CaskX11DependencyError.new(@cask.token)
|
||||
end
|
||||
end
|
||||
|
||||
def formula_dependencies
|
||||
|
|
|
@ -147,5 +147,9 @@ module Cask::Locations
|
|||
def x11_executable
|
||||
@x11_executable ||= Pathname.new('/usr/X11/bin/X')
|
||||
end
|
||||
|
||||
def x11_libpng
|
||||
@x11_libpng ||= [ Pathname.new('/opt/X11/lib/libpng.dylib'), Pathname.new('/usr/X11/lib/libpng.dylib') ]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -101,7 +101,7 @@ describe "Satisfy Dependencies and Requirements" do
|
|||
|
||||
it "raises an exception when depends_on :x11 is not satisfied" do
|
||||
x11_cask = Cask.load('with-depends-on-x11')
|
||||
Cask.stubs(:x11_executable).returns(Pathname.new('/usr/path/does/not/exist'))
|
||||
Cask.stubs(:x11_libpng).returns([Pathname.new('/usr/path/does/not/exist')])
|
||||
lambda {
|
||||
shutup do
|
||||
Cask::Installer.new(x11_cask).install
|
||||
|
|
Loading…
Reference in New Issue