<commit_before>class Dcmtk < Formula
  desc "OFFIS DICOM toolkit command-line utilities"
  homepage "https://dicom.offis.de/dcmtk.php.en"
  url "https://dicom.offis.de/download/dcmtk/dcmtk365/dcmtk-3.6.5.tar.gz"
  sha256 "a05178665f21896dbb0974106dba1ad144975414abd760b4cf8f5cc979f9beb9"
  revision 1
  head "https://git.dcmtk.org/dcmtk.git"

  livecheck do
    url "https://dicom.offis.de/download/dcmtk/release/"
    regex(/href=.*?dcmtk[._-]v?(\d+(?:\.\d+)+)\.t/i)
  end

  bottle do
    sha256 big_sur:     "a52a1b60a406463246b8eb194e25589c88dfa982a936560bf6948be569448833"
    sha256 catalina:    "a86027494ff074de767cef1a7bf31639e50f153d4a2ec5297bb9560bb3e48ef6"
    sha256 mojave:      "2bbb1bf5d51c7e12c2db901a632862b9429ef2b146f973feda5212fb1391ac33"
    sha256 high_sierra: "352137e82f70183e543b6d532dcf67c7fa95ea67b63421ad4fc9c0a0f19ba484"
  end

  depends_on "cmake" => :build
  depends_on "libpng"
  depends_on "libtiff"
  depends_on "openssl@1.1"

  uses_from_macos "libxml2"

  def install
    mkdir "build" do
      system "cmake", "-DBUILD_SHARED_LIBS=OFF", *std_cmake_args, ".."
      system "make", "install"
      system "cmake", "-DBUILD_SHARED_LIBS=ON", *std_cmake_args, ".."
      system "make", "install"
    end
  end

  test do<commit_msg>dcmtk 3.6.6<commit_after>class Dcmtk < Formula
  desc "OFFIS DICOM toolkit command-line utilities"
  homepage "https://dicom.offis.de/dcmtk.php.en"
  url "https://dicom.offis.de/download/dcmtk/dcmtk366/dcmtk-3.6.6.tar.gz"
  sha256 "6859c62b290ee55677093cccfd6029c04186d91cf99c7642ae43627387f3458e"
  head "https://git.dcmtk.org/dcmtk.git"

  livecheck do
    url "https://dicom.offis.de/download/dcmtk/release/"
    regex(/href=.*?dcmtk[._-]v?(\d+(?:\.\d+)+)\.t/i)
  end

  bottle do
    sha256 big_sur:     "a52a1b60a406463246b8eb194e25589c88dfa982a936560bf6948be569448833"
    sha256 catalina:    "a86027494ff074de767cef1a7bf31639e50f153d4a2ec5297bb9560bb3e48ef6"
    sha256 mojave:      "2bbb1bf5d51c7e12c2db901a632862b9429ef2b146f973feda5212fb1391ac33"
    sha256 high_sierra: "352137e82f70183e543b6d532dcf67c7fa95ea67b63421ad4fc9c0a0f19ba484"
  end

  depends_on "cmake" => :build
  depends_on "libpng"
  depends_on "libtiff"
  depends_on "openssl@1.1"

  uses_from_macos "libxml2"

  def install
    mkdir "build" do
      system "cmake", "-DBUILD_SHARED_LIBS=OFF", *std_cmake_args, ".."
      system "make", "install"
      system "cmake", "-DBUILD_SHARED_LIBS=ON", *std_cmake_args, ".."
      system "make", "install"

      on_macos do
        inreplace lib/"cmake/dcmtk/DCMTKConfig.cmake", "#{HOMEBREW_SHIMS_PATH}/mac/super/", ""
      end

      on_linux do
        if File.readlines(lib/"cmake/dcmtk/DCMTKConfig.cmake").grep(/#{HOMEBREW_SHIMS_PATH}/o).any?
          inreplace lib/"cmake/dcmtk/DCMTKConfig.cmake", "#{HOMEBREW_SHIMS_PATH}/linux/super/", ""
        end
      end
    end
  end

  test do
{'fraction_non_alphanumeric': 0.12400138937130949, 'fraction_numerical': 0.1642931573463008, 'mean_word_length': 3.9655172413793105, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '605436', 'n_tokens_mistral': 1562, 'n_tokens_neox': 1312, 'n_words': 161}