Skip to content
Snippets Groups Projects
Commit d22eed3f authored by Adam Vandenberg's avatar Adam Vandenberg
Browse files

Add support for Luarocks dependencies.

parent 85e05b27
No related branches found
No related tags found
No related merge requests found
......@@ -79,6 +79,7 @@ class UnsatisfiedExternalDependencyError < Homebrew::InstallationError
when :perl then 'cpan'
when :node then 'npm'
when :chicken then 'chicken-install'
when :lua then "luarocks"
end
end
......@@ -98,6 +99,8 @@ class UnsatisfiedExternalDependencyError < Homebrew::InstallationError
"npm install"
when :chicken
"chicken-install"
when :lua
"luarocks install"
end
end
end
......
......@@ -745,7 +745,7 @@ EOF
def depends_on name
@deps ||= []
@external_deps ||= {:python => [], :perl => [], :ruby => [], :jruby => [], :chicken => [], :rbx => [], :node => []}
@external_deps ||= {:python => [], :perl => [], :ruby => [], :jruby => [], :chicken => [], :rbx => [], :node => [], :lua => []}
case name
when String, Formula
......@@ -753,7 +753,7 @@ EOF
when Hash
key, value = name.shift
case value
when :python, :perl, :ruby, :jruby, :chicken, :rbx, :node
when :python, :perl, :ruby, :jruby, :chicken, :rbx, :node, :lua
@external_deps[value] << key
when :optional, :recommended, :build
@deps << key
......
......@@ -342,6 +342,7 @@ def external_dep_check dep, type
when :perl then %W{/usr/bin/env perl -e use\ #{dep}}
when :chicken then %W{/usr/bin/env csi -e (use #{dep})}
when :node then %W{/usr/bin/env node -e require('#{dep}');}
when :lua then %W{/usr/bin/env luarocks show #{dep}}
end
end
......@@ -365,7 +366,7 @@ class Formula
end
def check_external_deps
[:ruby, :python, :perl, :jruby, :rbx, :chicken, :node].each do |type|
[:ruby, :python, :perl, :jruby, :rbx, :chicken, :node, :lua].each do |type|
self.external_deps[type].each do |dep|
unless quiet_system(*external_dep_check(dep, type))
raise UnsatisfiedExternalDependencyError.new(dep, type)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment