2012-05-26 19:09:34 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2013-09-05 15:04:14 +00:00
|
|
|
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
|
|
|
|
|
2012-05-26 19:09:34 +00:00
|
|
|
class Elixir < Formula
|
|
|
|
homepage 'http://elixir-lang.org/'
|
2013-11-14 12:38:41 +00:00
|
|
|
url 'https://github.com/elixir-lang/elixir/archive/v0.11.2.tar.gz'
|
|
|
|
sha1 '9c102acbcf7bb42454ed39d5d497add11f3cdc4d'
|
2012-05-26 19:09:34 +00:00
|
|
|
|
2013-01-28 17:23:25 +00:00
|
|
|
head 'https://github.com/elixir-lang/elixir.git'
|
2012-05-26 19:09:34 +00:00
|
|
|
|
2013-09-05 15:04:14 +00:00
|
|
|
depends_on ErlangInstalled
|
2012-10-03 13:55:31 +00:00
|
|
|
|
2012-05-26 19:09:34 +00:00
|
|
|
def install
|
|
|
|
system "make"
|
|
|
|
bin.install Dir['bin/*'] - Dir['bin/*.bat']
|
2012-08-01 06:58:27 +00:00
|
|
|
|
|
|
|
Dir['lib/*/ebin'].each do |path|
|
2013-09-05 20:25:42 +00:00
|
|
|
app = File.basename(File.dirname(path))
|
|
|
|
(lib/app).install path
|
2012-08-01 06:58:27 +00:00
|
|
|
end
|
2012-05-26 19:09:34 +00:00
|
|
|
end
|
|
|
|
|
2013-03-25 18:34:48 +00:00
|
|
|
test do
|
|
|
|
system "#{bin}/elixir", "-v"
|
2012-05-26 19:09:34 +00:00
|
|
|
end
|
|
|
|
end
|