aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorJack Nagel2013-09-05 10:04:14 -0500
committerJack Nagel2013-09-05 10:04:14 -0500
commitcda300bec3a0f954bcb9445e1fc17ec9a6838626 (patch)
tree3a5b8ec1cfcaa99fa6be7edb6a74a78520560a2a /Library/Formula
parent12e0a06742feefe46bd72e8bbb2771e824a133aa (diff)
downloadhomebrew-cda300bec3a0f954bcb9445e1fc17ec9a6838626.tar.bz2
elixir: use a requirement with a default formula for erlang
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/elixir.rb26
1 files changed, 25 insertions, 1 deletions
diff --git a/Library/Formula/elixir.rb b/Library/Formula/elixir.rb
index 8df07b112..aca3f5a3b 100644
--- a/Library/Formula/elixir.rb
+++ b/Library/Formula/elixir.rb
@@ -1,5 +1,29 @@
require 'formula'
+class ErlangInstalled < Requirement
+ fatal true
+ default_formula 'erlang'
+ env :userpaths
+
+ satisfy {
+ erl = which('erl') and begin
+ `#{erl} -noshell -eval 'io:fwrite("~s~n", [erlang:system_info(otp_release)]).' -s erlang halt | grep -q '^R1[6789]'`
+ $?.exitstatus == 0
+ end
+ }
+
+ def message; <<-EOS.undent
+ Erlang R16 is required to install.
+
+ You can install this with:
+ brew install erlang
+
+ Or you can use an official installer from:
+ http://www.erlang.org/
+ EOS
+ end
+end
+
class Elixir < Formula
homepage 'http://elixir-lang.org/'
url 'https://github.com/elixir-lang/elixir/archive/v0.10.2.tar.gz'
@@ -7,7 +31,7 @@ class Elixir < Formula
head 'https://github.com/elixir-lang/elixir.git'
- depends_on 'erlang'
+ depends_on ErlangInstalled
def install
system "make"