forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phylip.rb
51 lines (44 loc) · 1.31 KB
/
phylip.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
require 'formula'
class Phylip < Formula
homepage 'http://evolution.genetics.washington.edu/phylip.html'
url 'http://evolution.gs.washington.edu/phylip/download/phylip-3.69.tar.gz'
sha1 'ada364d1a588935ff59a23c08337d9dd99109c5e'
depends_on :x11
def install
cd 'src' do
system "make all"
system "make put EXEDIR=#{bin}"
# Perhaps one day the Mac apps will work (with cocoa) "make -f Makefile.osx apps"
end
# Remove installed fonts
bin.cd do
rm Dir['font*']
end
(share/'phylip').install ['phylip.html', 'doc']
end
def caveats
<<-EOS.undent
The documentation has been installed to #{HOMEBREW_PREFIX}/share/phylip/phylip.html.
EOS
end
def test
# From http://evolution.genetics.washington.edu/phylip/doc/pars.html
mktemp do
Pathname.new('infile').write <<-EOF.undent
7 6
Alpha1 110110
Alpha2 110110
Beta1 110000
Beta2 110000
Gamma1 100110
Delta 001001
Epsilon 001110
EOF
Pathname.new('expected').write <<-EOF.undent
(((Epsilon:0.00,Delta:3.00):2.00,Gamma1:0.00):1.00,(Beta2:0.00,Beta1:0.00):2.00,Alpha2:0.00,Alpha1:0.00);
EOF
system "echo 'Y' | #{bin}/pars"
compare_file 'outtree', 'expected'
end
end
end