From 3f39e3e2dbeb553ae270847814da6e528461dc37 Mon Sep 17 00:00:00 2001 From: Caleb Xu Date: Thu, 29 Dec 2022 01:08:45 -0500 Subject: [PATCH] mpfrcx 0.6.3 (new formula) Closes #119312. Signed-off-by: Rui Chen Signed-off-by: Sean Molenaar <1484494+SMillerDev@users.noreply.github.com> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> --- Formula/mpfrcx.rb | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Formula/mpfrcx.rb diff --git a/Formula/mpfrcx.rb b/Formula/mpfrcx.rb new file mode 100644 index 00000000000..1afc9f06866 --- /dev/null +++ b/Formula/mpfrcx.rb @@ -0,0 +1,36 @@ +class Mpfrcx < Formula + desc "Arbitrary precision library for arithmetic of univariate polynomials" + homepage "https://www.multiprecision.org/mpfrcx/home.html" + url "https://www.multiprecision.org/downloads/mpfrcx-0.6.3.tar.gz" + sha256 "9da9b3614c0a3e00e6ed2b82fc935d1c838d97074dc59cb388f8fafbe3db8594" + license "GPL-3.0-or-later" + head "https://gitlab.inria.fr/enge/mpfrcx.git", branch: "master" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + depends_on "gmp" + depends_on "libmpc" + depends_on "mpfr" + + def install + # Regenerate configure to avoid building libraries with flat namespaces + system "autoreconf", "--force", "--install", "--verbose" + + system "./configure", *std_configure_args, "--disable-silent-rules" + system "make", "install" + + (pkgshare/"tests").install Dir["tests/tc_*.c"] + end + + test do + Dir[pkgshare/"tests/*"].each do |src| + testname = File.basename(src, ".c") + system ENV.cc, src, "-I#{include}", "-L#{lib}", + "-L#{Formula["gmp"].opt_lib}", "-L#{Formula["libmpc"].opt_lib}", "-L#{Formula["mpfr"].opt_lib}", + "-lmpfrcx", "-lgmp", "-lmpc", "-lmpfr", + "-o", testname + system testpath/testname + end + end +end