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