libmpc@0.8: import from homebrew/versions.

This commit is contained in:
Mike McQuaid 2016-12-06 09:26:21 +00:00
parent e97609ff13
commit 70adfc8858
2 changed files with 50 additions and 0 deletions

49
Formula/libmpc@0.8.rb Normal file
View file

@ -0,0 +1,49 @@
class LibmpcAT08 < Formula
desc "C library for high precision complex numbers"
homepage "http://multiprecision.org"
# Track gcc infrastructure releases.
url "http://multiprecision.org/mpc/download/mpc-0.8.1.tar.gz"
mirror "ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-0.8.1.tar.gz"
sha256 "e664603757251fd8a352848276497a4c79b7f8b21fd8aedd5cc0598a38fee3e4"
keg_only "Older version of libmpc"
depends_on "gmp@4"
depends_on "mpfr@2"
def install
args = [
"--prefix=#{prefix}",
"--disable-dependency-tracking",
"--with-gmp=#{Formula["gmp@4"].opt_prefix}",
"--with-mpfr=#{Formula["mpfr@2"].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
gmp = Formula["gmp@4"]
mpfr = Formula["mpfr@2"]
system ENV.cc, "test.c",
"-I#{gmp.include}", "-L#{gmp.lib}", "-lgmp",
"-I#{mpfr.include}", "-L#{mpfr.lib}", "-lmpfr",
"-I#{include}", "-L#{lib}", "-lmpc",
"-o", "test"
system "./test"
end
end

View file

@ -28,6 +28,7 @@
"letsencrypt": "certbot",
"libcppa": "caf",
"libmongoclient": "mongo-cxx-driver",
"libmpc08": "libmpc@0.8",
"mongo-c": "mongo-c-driver",
"mpich2": "mpich",
"mysql55": "mysql@5.5",