aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2012-02-29 20:52:20 -0800
committerAdam Vandenberg2012-02-29 20:52:20 -0800
commitd22eed3f1658dd3f13dec34637143aeb4cfe3991 (patch)
tree5129c975f4a7721b9233b29d13a2e129263e79f8
parent85e05b27dd26d12882b7153211af5dcfa1b2de3d (diff)
downloadbrew-d22eed3f1658dd3f13dec34637143aeb4cfe3991.tar.bz2
Add support for Luarocks dependencies.
-rw-r--r--Library/Homebrew/exceptions.rb3
-rw-r--r--Library/Homebrew/formula.rb4
-rw-r--r--Library/Homebrew/formula_installer.rb3
3 files changed, 7 insertions, 3 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb
index 968ce5bdf..633db6106 100644
--- a/Library/Homebrew/exceptions.rb
+++ b/Library/Homebrew/exceptions.rb
@@ -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
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index f1f6607e2..140158ce4 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -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
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 486a4655f..45cd00770 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -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)