forked from paritytech/homebrew-paritytech
-
Notifications
You must be signed in to change notification settings - Fork 1
/
parity.rb
52 lines (46 loc) · 1.46 KB
/
parity.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
require 'formula'
class Parity < Formula
homepage 'https://github.com/ethcore/parity'
if build.include? "master"
version '1.3.0'
url 'https://github.com/ethcore/parity.git', :branch => 'master', :using => :git
elsif build.include? "stable"
version '1.1.0'
url 'https://github.com/ethcore/parity.git', :branch => 'stable', :using => :git
else
version '1.2.1'
url 'https://github.com/ethcore/parity.git', :branch => 'beta', :using => :git
end
depends_on 'multirust' => :build
depends_on 'node' => :build
option 'master', 'Build and install nightly version.'
option 'beta', 'Build and install latest beta (default).'
option 'stable', 'Install latest stable (default).'
def install
system "multirust update stable"
system "multirust run stable cargo build --release"
bin.install "target/release/parity"
end
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ThrottleInterval</key>
<integer>300</integer>
<key>ProgramArguments</key>
<array>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
end