<commit_before>class Sdl2Gfx < Formula
  desc "SDL2 graphics drawing primitives and other support functions"
  homepage "https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/"
  url "https://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-1.0.4.tar.gz"
  mirror "https://sources.voidlinux.org/SDL2_gfx-1.0.4/SDL2_gfx-1.0.4.tar.gz"
  sha256 "63e0e01addedc9df2f85b93a248f06e8a04affa014a835c2ea34bfe34e576262"
  license "Zlib"

  livecheck do
    url :homepage
    regex(/href=.*?SDL2_gfx[._-]v?(\d+(?:\.\d+)+)\.t/i)
  end

  bottle do
    sha256 cellar: :any, arm64_big_sur: "7c632415953aecce33ea6b66b0d0b75461db7987bf560802e408d308bcd9b653"
    sha256 cellar: :any, big_sur:       "9466b3ad0c9a29ca01a8c804b529ad7c89bd42c4d8b79b37bc079419464cc9f2"
    sha256 cellar: :any, catalina:      "9db41c0f2fd4897456594769a4a549b5261c3027dde8fc6da7160faf7db0a539"
    sha256 cellar: :any, mojave:        "0854ac56a8c0e0b3b5f7fe380fb0bde03dfb2da984920bcbc61ba6e4738f9ca6"
    sha256 cellar: :any, high_sierra:   "6563ae4bda51a996e537cfe88509da94402b52469e11b92211b5bca58800ab24"
    sha256 cellar: :any, sierra:        "fba875841d99a80ba39af65733a0df33adf220d29fbd5e313dfcc695b61bc8e4"
    sha256 cellar: :any, el_capitan:    "aaec64e6b0020e3a0b2faf6ca37e5bc4b27d7327125a58831b0cd34803935cc7"
  end

  depends_on "sdl2"

  def install
    extra_args = []
    extra_args << "--disable-mmx" if Hardware::CPU.arm?

    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--disable-sdltest",
                          *extra_args
    system "make", "install"
  end

  test do
    (testpath/"test.c").write <<~EOS
      #include <SDL2/SDL2_imageFilter.h>

      int main()
      {
        int mmx = SDL_imageFilterMMXdetect();
        return 0;
      }
    EOS
    system ENV.cc, "-L#{lib}", "-lsdl2_gfx", "test.c", "-o", "test"
    system "./test"
  end
end<commit_msg>sdl2_gfx: fix test for Linux (#76321)<commit_after>class Sdl2Gfx < Formula
  desc "SDL2 graphics drawing primitives and other support functions"
  homepage "https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/"
  url "https://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-1.0.4.tar.gz"
  mirror "https://sources.voidlinux.org/SDL2_gfx-1.0.4/SDL2_gfx-1.0.4.tar.gz"
  sha256 "63e0e01addedc9df2f85b93a248f06e8a04affa014a835c2ea34bfe34e576262"
  license "Zlib"

  livecheck do
    url :homepage
    regex(/href=.*?SDL2_gfx[._-]v?(\d+(?:\.\d+)+)\.t/i)
  end

  bottle do
    sha256 cellar: :any, arm64_big_sur: "7c632415953aecce33ea6b66b0d0b75461db7987bf560802e408d308bcd9b653"
    sha256 cellar: :any, big_sur:       "9466b3ad0c9a29ca01a8c804b529ad7c89bd42c4d8b79b37bc079419464cc9f2"
    sha256 cellar: :any, catalina:      "9db41c0f2fd4897456594769a4a549b5261c3027dde8fc6da7160faf7db0a539"
    sha256 cellar: :any, mojave:        "0854ac56a8c0e0b3b5f7fe380fb0bde03dfb2da984920bcbc61ba6e4738f9ca6"
    sha256 cellar: :any, high_sierra:   "6563ae4bda51a996e537cfe88509da94402b52469e11b92211b5bca58800ab24"
    sha256 cellar: :any, sierra:        "fba875841d99a80ba39af65733a0df33adf220d29fbd5e313dfcc695b61bc8e4"
    sha256 cellar: :any, el_capitan:    "aaec64e6b0020e3a0b2faf6ca37e5bc4b27d7327125a58831b0cd34803935cc7"
  end

  depends_on "sdl2"

  def install
    extra_args = []
    extra_args << "--disable-mmx" if Hardware::CPU.arm?

    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--disable-sdltest",
                          *extra_args
    system "make", "install"
  end

  test do
    (testpath/"test.c").write <<~EOS
      #include <SDL2/SDL2_imageFilter.h>

      int main()
      {
        int mmx = SDL_imageFilterMMXdetect();
        return 0;
      }
    EOS
    system ENV.cc, "test.c", "-L#{lib}", "-lSDL2_gfx", "-o", "test"
    system "./test"
  end
end
{'fraction_non_alphanumeric': 0.11743589743589744, 'fraction_numerical': 0.18974358974358974, 'mean_word_length': 3.3635346756152127, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, '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': '1956921', 'n_tokens_mistral': 2075, 'n_tokens_neox': 1698, 'n_words': 224}