<commit_before>class Zboy < Formula
  desc "GameBoy emulator"
  homepage "https://zboy.sourceforge.io/"
  url "https://downloads.sourceforge.net/project/zboy/zBoy%20v0.71/zboy-0.71.tar.xz"
  sha256 "d359b87e3149418fbe1599247c9ca71e870d213b64a912616ffc6e77d1dff506"
  license "GPL-3.0"
  head "https://svn.code.sf.net/p/zboy/code/trunk"

  bottle do
    cellar :any
    sha256 "2ad945f7d40d2ff506741229fa63c28aeedea3724e81e9ddcb7c28d649a77929" => :catalina
    sha256 "c813bac5cabe3cfc5b716a871586e757b64b47a8c74849a39a3640d975a3ac0b" => :mojave
    sha256 "90bea3958e333bee7386f18aa1c356b2085c35497f6f2ea13f52177d3c98c160" => :high_sierra
    sha256 "32e11823c3994c8e5e3643cb3a55195cda48a9c744e4c50d88d7a70988c28829" => :sierra
  end

  depends_on "sdl2"

  # Compile and link drv_sdl2.o
  patch :DATA

  def install
    sdl2 = Formula["sdl2"]
    ENV.append_to_cflags "-std=gnu89 -D__zboy4linux__ -DNETPLAY -DLFNAVAIL -I#{sdl2.include} -L#{sdl2.lib}"
    system "make", "-f", "Makefile.linux", "CFLAGS=#{ENV.cflags}"
    bin.install "zboy"
  end

  test do
    system "#{bin}/zboy", "--help"
  end
end

__END__
diff --git a/Makefile.linux b/Makefile.linux
index 3af9c65..e4ad434 100644
--- a/Makefile.linux
+++ b/Makefile.linux
@@ -12,7 +12,7 @@ LDLIBS = -lSDL2
 
 all: zboy
 
-zboy: zboy.o about.o loadpal.o loadrom.o net_sock.o crc32.o wordwrap.o libunzip/libunzip.a
+zboy: zboy.o about.o drv_sdl2.o loadpal.o loadrom.o net_sock.o crc32.o wordwrap.o libunzip/libunzip.a
 
 aboutgen: aboutgen.c
 <commit_msg>zboy: replace patch with inreplace<commit_after>class Zboy < Formula
  desc "GameBoy emulator"
  homepage "https://zboy.sourceforge.io/"
  url "https://downloads.sourceforge.net/project/zboy/zBoy%20v0.71/zboy-0.71.tar.xz"
  sha256 "d359b87e3149418fbe1599247c9ca71e870d213b64a912616ffc6e77d1dff506"
  license "GPL-3.0"
  head "https://svn.code.sf.net/p/zboy/code/trunk"

  bottle do
    cellar :any
    sha256 "2ad945f7d40d2ff506741229fa63c28aeedea3724e81e9ddcb7c28d649a77929" => :catalina
    sha256 "c813bac5cabe3cfc5b716a871586e757b64b47a8c74849a39a3640d975a3ac0b" => :mojave
    sha256 "90bea3958e333bee7386f18aa1c356b2085c35497f6f2ea13f52177d3c98c160" => :high_sierra
    sha256 "32e11823c3994c8e5e3643cb3a55195cda48a9c744e4c50d88d7a70988c28829" => :sierra
  end

  depends_on "sdl2"

  def install
    sdl2 = Formula["sdl2"]
    ENV.append_to_cflags "-std=gnu89 -D__zboy4linux__ -DNETPLAY -DLFNAVAIL -I#{sdl2.include} -L#{sdl2.lib}"
    inreplace "Makefile.linux", "zboy.o", "zboy.o drv_sdl2.o"
    system "make", "-f", "Makefile.linux", "CFLAGS=#{ENV.cflags}"
    bin.install "zboy"
  end

  test do
    system "#{bin}/zboy", "--help"
  end
end
{'fraction_non_alphanumeric': 0.12180451127819548, 'fraction_numerical': 0.1924812030075188, 'mean_word_length': 4.49793388429752, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5473686', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1238, 'n_words': 174}