jackett 0.22.1382
[Homebrew/homebrew-core.git] / Formula / c / coinutils.rb
blobf354ebb150ec51e7dd5b13b0e566554b733c9f5b
1 class Coinutils < Formula
2   desc "COIN-OR utilities"
3   homepage "https://github.com/coin-or/CoinUtils"
4   url "https://github.com/coin-or/CoinUtils/archive/refs/tags/releases/2.11.12.tar.gz"
5   sha256 "eef1785d78639b228ae2de26b334129fe6a7d399c4ac6f8fc5bb9054ba00de64"
6   license "EPL-2.0"
7   head "https://github.com/coin-or/CoinUtils.git", branch: "master"
9   livecheck do
10     url :homepage
11     regex(%r{^(?:releases/)?(\d+(?:\.\d+)+)$}i)
12   end
14   bottle do
15     sha256 cellar: :any,                 arm64_sequoia:  "750ce0c23f2af2c0387d6677502cfc0ae5d51e26abae222dc5f09330a971d697"
16     sha256 cellar: :any,                 arm64_sonoma:   "5d9193efa0d87646822efcf4184544d50b3e0340d85fc65de79f24b170a09c37"
17     sha256 cellar: :any,                 arm64_ventura:  "b041fbad7adfee8ff45bef91c76c6c154599b662199b350268acd4206b6c3790"
18     sha256 cellar: :any,                 arm64_monterey: "1a3df4e2351ee15be1d0dd33f63516457cd82ec3ee25a018f53d79cbac19a2cc"
19     sha256 cellar: :any,                 sonoma:         "fd5cccbd3701e3df7a839b033758d9f89875145301eab36151f7199c20f41773"
20     sha256 cellar: :any,                 ventura:        "74fa09ea8b717beaba24b5320e452f0d2d1856b567add648ca67181e47902338"
21     sha256 cellar: :any,                 monterey:       "5e926b104d3e5bfa2764a33aafca6eabc9f381ffecb385fa3e10bfa69035e76d"
22     sha256 cellar: :any_skip_relocation, x86_64_linux:   "c4edc2b29842e702e87695df91ab2044beec5cc72aaf454af76e8265eac83bef"
23   end
25   depends_on "pkgconf" => :build
26   depends_on "openblas"
28   uses_from_macos "zlib"
30   def install
31     args = [
32       "--datadir=#{pkgshare}",
33       "--includedir=#{include}/coinutils",
34       "--with-blas-incdir=#{Formula["openblas"].opt_include}",
35       "--with-blas-lib=-L#{Formula["openblas"].opt_lib} -lopenblas",
36       "--with-lapack-incdir=#{Formula["openblas"].opt_include}",
37       "--with-lapack-lib=-L#{Formula["openblas"].opt_lib} -lopenblas",
38     ]
40     system "./configure", *args, *std_configure_args
41     system "make"
42     # Deparallelize due to error 1: "mkdir: #{include}/coinutils/coin: File exists."
43     # https://github.com/coin-or/Clp/issues/109
44     ENV.deparallelize { system "make", "install" }
45   end
47   test do
48     resource "homebrew-coin-or-tools-data-sample-p0201-mps" do
49       url "https://raw.githubusercontent.com/coin-or-tools/Data-Sample/releases/1.2.11/p0201.mps"
50       sha256 "8352d7f121289185f443fdc67080fa9de01e5b9bf11b0bf41087fba4277c07a4"
51     end
53     testpath.install resource("homebrew-coin-or-tools-data-sample-p0201-mps")
55     (testpath/"test.cpp").write <<~CPP
56       #include <CoinMpsIO.hpp>
57       int main() {
58         CoinMpsIO mpsIO;
59         return mpsIO.readMps("#{testpath}/p0201.mps");
60       }
61     CPP
63     system ENV.cxx, "test.cpp", "-I#{opt_include}/coinutils/coin",
64       "-L#{opt_lib}", "-lCoinUtils"
65     system "./a.out"
66   end
67 end