<commit_before>class Gedit < Formula
  desc "The GNOME text editor"
  homepage "https://wiki.gnome.org/Apps/Gedit"
  url "https://download.gnome.org/sources/gedit/3.22/gedit-3.22.1.tar.xz"
  sha256 "aa7bc3618fffa92fdb7daf2f57152e1eb7962e68561a9c92813d7bbb7fc9492b"

  bottle do
    sha256 "ccae4012622b1048854f483c17e70025a77fcf40239b2db3ea00e1a9a8b065be" => :high_sierra
    sha256 "69cd37a74078d26487c5da262e25ebf4061e5b39269a267241ebf0a0f671a884" => :sierra
    sha256 "7b1c38d6120f65a9c2a247c45a5d871eff551e534973f1cbff9c8a80528ff177" => :el_capitan
    sha256 "39e9259fd08f5dd94573fcee5c7956b0a6922b14fa7e1dee167ded4a26827ecf" => :yosemite
  end

  depends_on "pkg-config" => :build
  depends_on "intltool" => :build
  depends_on "itstool" => :build
  depends_on "atk"
  depends_on "cairo"
  depends_on "gdk-pixbuf"
  depends_on "gettext"
  depends_on "glib"
  depends_on "pango"
  depends_on "gtk+3"
  depends_on "gtk-mac-integration"
  depends_on "gobject-introspection"
  depends_on "gspell"
  depends_on "iso-codes"
  depends_on "libxml2"
  depends_on "libpeas"
  depends_on "gtksourceview3"
  depends_on "gsettings-desktop-schemas"
  depends_on "gnome-icon-theme"

  def install
    system "./configure", "--disable-dependency-tracking",
                          "--disable-silent-rules",
                          "--prefix=#{prefix}",
                          "--disable-updater",
                          "--disable-schemas-compile",
                          "--disable-python"
    system "make", "install"
  end

  def post_install
    system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas"
  end

  test do
    # main executable test
    system bin/"gedit", "--version"
    # API test
    (testpath/"test.c").write <<-EOS.undent
      #include <gedit/gedit-utils.h>

      int main(int argc, char *argv[]) {
        gchar *text = gedit_utils_make_valid_utf8("test text");
        return 0;
      }
    EOS
    ENV.libxml2
    atk = Formula["atk"]
    cairo = Formula["cairo"]<commit_msg>gedit: rename gnome-icon-theme to adwaita-icon-theme<commit_after>class Gedit < Formula
  desc "The GNOME text editor"
  homepage "https://wiki.gnome.org/Apps/Gedit"
  url "https://download.gnome.org/sources/gedit/3.22/gedit-3.22.1.tar.xz"
  sha256 "aa7bc3618fffa92fdb7daf2f57152e1eb7962e68561a9c92813d7bbb7fc9492b"

  bottle do
    sha256 "ccae4012622b1048854f483c17e70025a77fcf40239b2db3ea00e1a9a8b065be" => :high_sierra
    sha256 "69cd37a74078d26487c5da262e25ebf4061e5b39269a267241ebf0a0f671a884" => :sierra
    sha256 "7b1c38d6120f65a9c2a247c45a5d871eff551e534973f1cbff9c8a80528ff177" => :el_capitan
    sha256 "39e9259fd08f5dd94573fcee5c7956b0a6922b14fa7e1dee167ded4a26827ecf" => :yosemite
  end

  depends_on "pkg-config" => :build
  depends_on "intltool" => :build
  depends_on "itstool" => :build
  depends_on "atk"
  depends_on "cairo"
  depends_on "gdk-pixbuf"
  depends_on "gettext"
  depends_on "glib"
  depends_on "pango"
  depends_on "gtk+3"
  depends_on "gtk-mac-integration"
  depends_on "gobject-introspection"
  depends_on "gspell"
  depends_on "iso-codes"
  depends_on "libxml2"
  depends_on "libpeas"
  depends_on "gtksourceview3"
  depends_on "gsettings-desktop-schemas"
  depends_on "adwaita-icon-theme"

  def install
    system "./configure", "--disable-dependency-tracking",
                          "--disable-silent-rules",
                          "--prefix=#{prefix}",
                          "--disable-updater",
                          "--disable-schemas-compile",
                          "--disable-python"
    system "make", "install"
  end

  def post_install
    system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas"
  end

  test do
    # main executable test
    system bin/"gedit", "--version"
    # API test
    (testpath/"test.c").write <<-EOS.undent
      #include <gedit/gedit-utils.h>

      int main(int argc, char *argv[]) {
        gchar *text = gedit_utils_make_valid_utf8("test text");
        return 0;
      }
    EOS
    ENV.libxml2
    atk = Formula["atk"]
    cairo = Formula["cairo"]
{'fraction_non_alphanumeric': 0.11743428984808295, 'fraction_numerical': 0.11044128285507596, 'mean_word_length': 3.127363184079602, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '7438467', 'n_tokens_mistral': 1873, 'n_tokens_neox': 1650, 'n_words': 245}