Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for libpng to assure X11 detection #8519

Merged
merged 1 commit into from
Dec 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/cask/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ def arch_dependencies

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
Expand Down
4 changes: 4 additions & 0 deletions lib/cask/locations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,9 @@ def pre_mavericks_accessibility_dotfile
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
2 changes: 1 addition & 1 deletion test/cask/depends_on_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@

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
Expand Down