/
elixir.rb
54 lines (43 loc) 路 1.42 KB
/
elixir.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
class Erlang18Requirement < Requirement
fatal true
env :userpaths
default_formula "erlang"
satisfy do
erl = which("erl")
next unless erl
`#{erl} -noshell -eval 'io:fwrite("~s", [erlang:system_info(otp_release) >= "18"])' -s erlang halt | grep -q '^true'`
$?.exitstatus == 0
end
def message; <<-EOS.undent
Erlang 18+ 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
desc "Functional metaprogramming aware language built on Erlang VM"
homepage "http://elixir-lang.org/"
url "https://github.com/elixir-lang/elixir/archive/v1.2.0.tar.gz"
sha256 "9f68ee5213b883c91f2f521df1f773ceec5913dbf075f7781b57ac97543e7268"
head "https://github.com/elixir-lang/elixir.git"
bottle do
sha256 "663ecb37c67e006ea31374b22cbacbb1c8625ae1db5020a5427863f9a535c622" => :el_capitan
sha256 "33a7b3ca8a11eea513a457f29f1f590590528ec610eccea335c8c7f97a094fcc" => :yosemite
sha256 "d3bbb6aff815ccf49c6d0082033ccdaaa9893105ee1a8fe80818d5df6648c0f7" => :mavericks
end
depends_on Erlang18Requirement
def install
system "make"
bin.install Dir["bin/*"] - Dir["bin/*.{bat,ps1}"]
Dir.glob("lib/*/ebin") do |path|
app = File.basename(File.dirname(path))
(lib/app).install path
end
end
test do
system "#{bin}/elixir", "-v"
end
end