forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fasttree.rb
30 lines (26 loc) · 968 Bytes
/
fasttree.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
require 'formula'
class Fasttree < Formula
homepage 'http://meta.microbesonline.org/fasttree/'
url 'http://www.microbesonline.org/fasttree/FastTree-2.1.7.c'
sha1 'd9381924829e7d19d56154ebbde0e44044b4b7ab'
fails_with :clang do
build 425
cause "segmentation fault when running Fasttree"
# See also discussion to use -DNO_SSE (https://github.com/Homebrew/homebrew-science/pull/96)
end
def install
system "#{ENV.cc} -O3 -finline-functions -funroll-loops -Wall -o FastTree FastTree-#{version}.c -lm"
bin.install "FastTree"
end
test do
Pathname.new('test.fa').write <<-EOF.undent
>1
LCLYTHIGRNIYYGSYLYSETWNTTTMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLV
>2
LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGYVLPWGQMSFWGATVITNLFSAIPYIGTNLV
>3
LCLYTHIGRNIYYGSYLYSETWNTGIMLLLITMATAFMGTTLPWGQMSFWGATVITNLFSAIPYIGTNLV
EOF
`#{bin}/FastTree test.fa` =~ /1:0.\d+,2:0.\d+,3:0.\d+/ ? true : false
end
end