2014-05-23 10:30:41 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class R3 < Formula
|
|
|
|
homepage "https://github.com/c9s/r3"
|
2014-07-21 02:11:03 +00:00
|
|
|
url "https://github.com/c9s/r3/archive/1.3.3.tar.gz"
|
|
|
|
sha1 "2626e78e5d5afb64561b6c468e357db14597aef6"
|
2014-06-27 06:16:35 +00:00
|
|
|
|
2014-06-27 09:40:13 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2014-07-21 02:32:42 +00:00
|
|
|
sha1 "bf1eec1e94c0ef4f7862621277bda3d9456cf70f" => :mavericks
|
|
|
|
sha1 "690d863995532a33917a867bbc616887c542ba57" => :mountain_lion
|
|
|
|
sha1 "5d9e530068824ce31352258bbd826dfbb520e40a" => :lion
|
2014-06-27 09:40:13 +00:00
|
|
|
end
|
|
|
|
|
2014-06-27 06:16:35 +00:00
|
|
|
option :universal
|
|
|
|
option "with-graphviz", "Enable Graphviz functions"
|
2014-05-23 10:30:41 +00:00
|
|
|
|
|
|
|
head "https://github.com/c9s/r3.git"
|
|
|
|
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "pcre"
|
2014-06-27 06:16:35 +00:00
|
|
|
depends_on "graphviz" => :optional
|
|
|
|
depends_on "jemalloc" => :recommended
|
2014-05-23 10:30:41 +00:00
|
|
|
|
|
|
|
def install
|
2014-06-27 06:16:35 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
|
|
|
|
2014-05-23 10:30:41 +00:00
|
|
|
system "./autogen.sh"
|
2014-06-27 06:16:35 +00:00
|
|
|
|
|
|
|
args = %W{
|
|
|
|
--disable-debug
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--disable-silent-rules
|
|
|
|
--prefix=#{prefix}
|
|
|
|
}
|
|
|
|
|
|
|
|
args << "--enable-graphviz" if build.with? "graphviz"
|
|
|
|
args << "--with-malloc=jemalloc" if build.with? "jemalloc"
|
|
|
|
|
|
|
|
system "./configure", *args
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
|
|
|
#include "r3.h"
|
|
|
|
int main() {
|
|
|
|
node * n = r3_tree_create(1);
|
|
|
|
r3_tree_free(n);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cc, "test.cpp", "-o", "test",
|
|
|
|
"-lr3", "-I#{include}/r3"
|
|
|
|
system "./test"
|
2014-05-23 10:30:41 +00:00
|
|
|
end
|
|
|
|
end
|