forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
igraph.rb
38 lines (31 loc) · 1003 Bytes
/
igraph.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
require 'formula'
class Igraph < Formula
homepage 'http://igraph.org'
url 'http://igraph.org/nightly/get/c/igraph-0.7.0.tar.gz'
sha1 '379d1cccec78435ff3fb7940d89ec9a2aa1de157'
option :universal
# GMP is optional, and doesn't have a universal build
depends_on 'gmp' => :optional unless build.universal?
def install
ENV.universal_binary if build.universal?
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make install"
end
test do
# Adapted from http://igraph.org/c/doc/igraph-tutorial.html
(testpath/"igraph_test.c").write <<-EOS.undent
#include <igraph.h>
int main(void)
{
igraph_integer_t diameter;
igraph_t graph;
return 0;
}
EOS
system ENV.cc, "igraph_test.c", "-I#{include}/igraph", "-L#{lib}",
"-ligraph", "-o", "igraph_test"
system "./igraph_test"
end
end