<commit_before>class Sdl12Compat < Formula
  desc "SDL 1.2 compatibility layer that uses SDL 2.0 behind the scenes"
  homepage "https://github.com/libsdl-org/sdl12-compat"
  url "https://github.com/libsdl-org/sdl12-compat/archive/refs/tags/release-1.2.56.tar.gz"
  sha256 "f62f3e15f95aade366ee6c03f291e8825c4689390a6be681535259a877259c58"
  license all_of: ["Zlib", "MIT-0"]
  head "https://github.com/libsdl-org/sdl12-compat.git", branch: "main"

  bottle do
    sha256 cellar: :any,                 arm64_monterey: "9097849e4ee47c949ee9cd53fbc4fccc5d891027160c869ab0cd34d9780f0cf4"
    sha256 cellar: :any,                 arm64_big_sur:  "54eaa165d19da50d3ec01a1afd6bef64a94bbae939eb40322cfee9b889481366"
    sha256 cellar: :any,                 monterey:       "d1140b78795e656e6f37b048b95e0fecd025dc7dbbbbb95da4aebcda3daa2389"
    sha256 cellar: :any,                 big_sur:        "04e2f46b74b3109b41c43778e90bdabbad3aab42ba243f220b6e9baf120ef2d1"
    sha256 cellar: :any,                 catalina:       "b929d4c3832cdf6f8a8df785861b0fe5df4a7a4ca6e2a15e97351f5f0a9e07d1"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "79b8d0758cfba87d0ac1c02b441b12a4aa325770e425364e06429881fd54d8a3"
  end

  depends_on "cmake" => :build
  depends_on "sdl2"

  conflicts_with "sdl", because: "sdl12-compat is a drop-in replacement for sdl"

  def install
    system "cmake", "-S", ".", "-B", "build",
                    "-DSDL2_PATH=#{Formula["sdl2"].opt_prefix}",
                    "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,#{Formula["sdl2"].opt_lib}",
                    "-DSDL12DEVEL=ON",
                    "-DSDL12TESTS=OFF",
                    *std_cmake_args
    system "cmake", "--build", "build"
    system "cmake", "--install", "build"
    (lib/"pkgconfig").install_symlink "sdl12_compat.pc" => "sdl.pc"
  end

  test do
    assert_predicate lib/shared_library("libSDL"), :exist?
    versioned_libsdl = "libSDL-1.2"
    versioned_libsdl << ".0" if OS.mac?<commit_msg>sdl12-compat: update 1.2.56 bottle.<commit_after>class Sdl12Compat < Formula
  desc "SDL 1.2 compatibility layer that uses SDL 2.0 behind the scenes"
  homepage "https://github.com/libsdl-org/sdl12-compat"
  url "https://github.com/libsdl-org/sdl12-compat/archive/refs/tags/release-1.2.56.tar.gz"
  sha256 "f62f3e15f95aade366ee6c03f291e8825c4689390a6be681535259a877259c58"
  license all_of: ["Zlib", "MIT-0"]
  head "https://github.com/libsdl-org/sdl12-compat.git", branch: "main"

  bottle do
    sha256 cellar: :any,                 arm64_monterey: "28a52174028532660d3526dc2057674b58379230c7bf1f7e325d7450c4be5f4a"
    sha256 cellar: :any,                 arm64_big_sur:  "cc9f77abf218e5b16d3f4fa970c2be4fc46da61e8a37b79a78907a570ec4517a"
    sha256 cellar: :any,                 monterey:       "e145a7fa135f4c2832d7f7416545f5942dcba7e3bad494a658d159503e5305c6"
    sha256 cellar: :any,                 big_sur:        "5308f18cbce6d40617e6f1499f7c0a12e95806ddfc22d898063d5144e6676c55"
    sha256 cellar: :any,                 catalina:       "c4d8e089c779b7a2dce577dd314df3bd3955b55d03c73db88e9b47801d98d6ff"
    sha256 cellar: :any_skip_relocation, x86_64_linux:   "ac62b744285315381ba584bf90e78a11e98786e02a308c63a258aef76dbec16f"
  end

  depends_on "cmake" => :build
  depends_on "sdl2"

  conflicts_with "sdl", because: "sdl12-compat is a drop-in replacement for sdl"

  def install
    system "cmake", "-S", ".", "-B", "build",
                    "-DSDL2_PATH=#{Formula["sdl2"].opt_prefix}",
                    "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,#{Formula["sdl2"].opt_lib}",
                    "-DSDL12DEVEL=ON",
                    "-DSDL12TESTS=OFF",
                    *std_cmake_args
    system "cmake", "--build", "build"
    system "cmake", "--install", "build"
    (lib/"pkgconfig").install_symlink "sdl12_compat.pc" => "sdl.pc"
  end

  test do
    assert_predicate lib/shared_library("libSDL"), :exist?
    versioned_libsdl = "libSDL-1.2"
    versioned_libsdl << ".0" if OS.mac?
{'fraction_non_alphanumeric': 0.11497995991983968, 'fraction_numerical': 0.17384769539078157, 'mean_word_length': 3.266025641025641, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 6, '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': '2229014', 'n_tokens_mistral': 2013, 'n_tokens_neox': 1607, 'n_words': 226}