homebrew-core/Formula/calceph.rb

40 lines
1.1 KiB
Ruby
Raw Normal View History

class Calceph < Formula
desc "C library to access the binary planetary ephemeris files"
homepage "https://www.imcce.fr/inpop/calceph"
url "https://www.imcce.fr/content/medias/recherche/equipes/asd/calceph/calceph-3.4.0.tar.gz"
sha256 "f176f8356d6a3514c60956386260986ee3bc98f5111b1e2bcc83581bbed20f1d"
depends_on "gcc" # for gfortran
def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
(testpath/"testcalceph.c").write <<~EOS
#include <calceph.h>
#include <assert.h>
int errorfound;
static void myhandler (const char *msg) {
errorfound = 1;
}
int main (void) {
errorfound = 0;
calceph_seterrorhandler (3, myhandler);
calceph_open ("example1.dat");
assert (errorfound==1);
return 0;
}
EOS
system ENV.cc, "testcalceph.c", "-L#{lib}", "-lcalceph", "-o", "testcalceph"
system "./testcalceph"
end
end