aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorothree2014-06-27 14:16:35 +0800
committerJack Nagel2014-06-28 20:01:31 -0500
commita805236b70fd453d8072e0e7d5fe83f8ced23ec4 (patch)
treef1f4c0ed21ef0c3cf803580b96372502a38a087b /Library/Formula
parent74604c4b230a8a622f4f7adb023fb32b45787d3a (diff)
downloadhomebrew-a805236b70fd453d8072e0e7d5fe83f8ced23ec4.tar.bz2
r3 1.3.2
- add graphviz and jemalloc options - add test Closes #30479. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/r3.rb44
1 files changed, 36 insertions, 8 deletions
diff --git a/Library/Formula/r3.rb b/Library/Formula/r3.rb
index 19e375bbc..465272d57 100644
--- a/Library/Formula/r3.rb
+++ b/Library/Formula/r3.rb
@@ -2,8 +2,11 @@ require "formula"
class R3 < Formula
homepage "https://github.com/c9s/r3"
- url "https://github.com/c9s/r3/archive/1.0.0.tar.gz"
- sha1 "2cc3b1bac5ce83d884cd77639407198ec3c08b84"
+ url 'https://github.com/c9s/r3/archive/1.3.2.tar.gz'
+ sha1 '99837a42b637e32cd634a5fbdaeaf519a2df5dc5'
+
+ option :universal
+ option "with-graphviz", "Enable Graphviz functions"
head "https://github.com/c9s/r3.git"
@@ -11,15 +14,40 @@ class R3 < Formula
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
- depends_on "check" => :build
depends_on "pcre"
+ depends_on "graphviz" => :optional
+ depends_on "jemalloc" => :recommended
def install
+ ENV.universal_binary if build.universal?
+
system "./autogen.sh"
- system "./configure", "--disable-debug",
- "--disable-dependency-tracking",
- "--disable-silent-rules",
- "--prefix=#{prefix}"
- system "make", "install"
+
+ 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"
end
end