32 lines
905 B
Ruby
32 lines
905 B
Ruby
|
class Glpk < Formula
|
||
|
desc "Library for Linear and Mixed-Integer Programming"
|
||
|
homepage "https://www.gnu.org/software/glpk/"
|
||
|
url "https://ftp.gnu.org/gnu/glpk/glpk-4.62.tar.gz"
|
||
|
mirror "https://ftpmirror.gnu.org/glpk/glpk-4.62.tar.gz"
|
||
|
sha256 "096e4be3f83878ccf70e1fdb62ad1c178715ef8c0d244254c29e2f9f0c1afa70"
|
||
|
|
||
|
depends_on "gmp"
|
||
|
|
||
|
def install
|
||
|
system "./configure", "--prefix=#{prefix}",
|
||
|
"--disable-dependency-tracking",
|
||
|
"--with-gmp"
|
||
|
system "make", "install"
|
||
|
end
|
||
|
|
||
|
test do
|
||
|
(testpath/"test.c").write <<-EOF.undent
|
||
|
#include <stdio.h>
|
||
|
#include "glpk.h"
|
||
|
|
||
|
int main(int argc, const char *argv[])
|
||
|
{
|
||
|
printf("%s", glp_version());
|
||
|
return 0;
|
||
|
}
|
||
|
EOF
|
||
|
system ENV.cc, "test.c", "-L#{lib}", "-I#{include}", "-lglpk", "-o", "test"
|
||
|
assert_match version.to_s, shell_output("./test")
|
||
|
end
|
||
|
end
|