homebrew-core/Formula/libmpc.rb
2017-05-02 14:57:08 +02:00

48 lines
1.3 KiB
Ruby

class Libmpc < Formula
desc "C library for the arithmetic of high precision complex numbers"
homepage "http://multiprecision.org"
url "https://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz"
mirror "http://multiprecision.org/mpc/download/mpc-1.0.3.tar.gz"
sha256 "617decc6ea09889fb08ede330917a00b16809b8db88c29c31bfbb49cbf88ecc3"
revision 1
bottle do
cellar :any
sha256 "16ddbf6cf6c187a58f932cc907cf9c545b5a7f056282d5c01df849db7490e53e" => :sierra
sha256 "5527bea12285c11434ba29cd94de47d693ac5f9400d9e1ab161907604dcecfb4" => :el_capitan
sha256 "fa1789c2694894febb26850ef356689e7bfc19251f6f84f77b65c2ba677fb2a1" => :yosemite
end
depends_on "gmp"
depends_on "mpfr"
def install
args = %W[
--prefix=#{prefix}
--disable-dependency-tracking
--with-gmp=#{Formula["gmp"].opt_prefix}
--with-mpfr=#{Formula["mpfr"].opt_prefix}
]
system "./configure", *args
system "make"
system "make", "check"
system "make", "install"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <mpc.h>
int main()
{
mpc_t x;
mpc_init2 (x, 256);
mpc_clear (x);
return 0;
}
EOS
system ENV.cc, "test.c", "-lgmp", "-lmpfr", "-lmpc", "-o", "test"
system "./test"
end
end