<commit_before>class Cminpack < Formula
  desc "Solves nonlinear equations and nonlinear least squares problems"
  homepage "http://devernay.free.fr/hacks/cminpack/cminpack.html"
  url "https://github.com/devernay/cminpack/archive/v1.3.8.tar.gz"
  sha256 "3ea7257914ad55eabc43a997b323ba0dfee0a9b010d648b6d5b0c96425102d0e"
  license "BSD-3-Clause"
  head "https://github.com/devernay/cminpack.git"

  bottle do
    sha256 cellar: :any,                 arm64_big_sur: "d508c68c13b468c31d533289722929544c43a01e3c24082d6a58b02fb8dd875d"
    sha256 cellar: :any,                 big_sur:       "42feed7d547bfc20b5665c9e28b68a4a059f8791f56830ddd5e004a12d363784"
    sha256 cellar: :any,                 catalina:      "adfd9f1a494a35c87c9d6e04a7f10371fa3a1107fa3f2dfeb67c40b87d07dadb"
    sha256 cellar: :any,                 mojave:        "04a82ea734b10f9600b3bd3c4390d213f34eade2ec375784c1083e755548274c"
    sha256 cellar: :any_skip_relocation, x86_64_linux:  "8bbb7098dba3a7f0ef77380e9e62be97cf2a1b8d572abe2daa80d212c3d8976e"
  end

  depends_on "cmake" => :build

  def install
    system "cmake", ".", "-DBUILD_SHARED_LIBS=ON",
                         "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON",
                         *std_cmake_args
    system "make", "install"

    man3.install Dir["doc/*.3"]
    doc.install Dir["doc/*"]

    pkgshare.install "examples/thybrdc.c"

    unless OS.mac?
      lib64 = Pathname.new "#{lib}64"
      mv lib64, lib if lib64.directory?
    end
  end

  test do
    system ENV.cc, pkgshare/"thybrdc.c", "-o", "test",
                   "-I#{include}/cminpack-1", "-L#{lib}", "-lcminpack", "-lm"
    assert_match "number of function evaluations", shell_output("./test")
  end
end<commit_msg>cminkpack: fix lib install path another way (#23101)<commit_after>class Cminpack < Formula
  desc "Solves nonlinear equations and nonlinear least squares problems"
  homepage "http://devernay.free.fr/hacks/cminpack/cminpack.html"
  url "https://github.com/devernay/cminpack/archive/v1.3.8.tar.gz"
  sha256 "3ea7257914ad55eabc43a997b323ba0dfee0a9b010d648b6d5b0c96425102d0e"
  license "BSD-3-Clause"
  head "https://github.com/devernay/cminpack.git"

  bottle do
    sha256 cellar: :any,                 arm64_big_sur: "d508c68c13b468c31d533289722929544c43a01e3c24082d6a58b02fb8dd875d"
    sha256 cellar: :any,                 big_sur:       "42feed7d547bfc20b5665c9e28b68a4a059f8791f56830ddd5e004a12d363784"
    sha256 cellar: :any,                 catalina:      "adfd9f1a494a35c87c9d6e04a7f10371fa3a1107fa3f2dfeb67c40b87d07dadb"
    sha256 cellar: :any,                 mojave:        "04a82ea734b10f9600b3bd3c4390d213f34eade2ec375784c1083e755548274c"
    sha256 cellar: :any_skip_relocation, x86_64_linux:  "8bbb7098dba3a7f0ef77380e9e62be97cf2a1b8d572abe2daa80d212c3d8976e"
  end

  depends_on "cmake" => :build

  def install
    system "cmake", ".", "-DBUILD_SHARED_LIBS=ON",
                         "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON",
                         "-DCMINPACK_LIB_INSTALL_DIR=lib",
                         *std_cmake_args
    system "make", "install"

    man3.install Dir["doc/*.3"]
    doc.install Dir["doc/*"]

    pkgshare.install "examples/thybrdc.c"
  end

  test do
    system ENV.cc, "-I#{include}/cminpack-1", pkgshare/"thybrdc.c",
                   "-L#{lib}", "-lcminpack", "-lm", "-o", "test"
    assert_match "number of function evaluations", shell_output("./test")
  end
end
{'fraction_non_alphanumeric': 0.10524781341107872, 'fraction_numerical': 0.1618075801749271, 'mean_word_length': 3.1995104039167686, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4289808', 'n_tokens_mistral': 1683, 'n_tokens_neox': 1374, 'n_words': 196}