<commit_before>require 'formula'

class Pygtk < Formula
  url 'http://ftp.acc.umu.se/pub/GNOME/sources/pygtk/2.24/pygtk-2.24.0.tar.bz2'
  homepage 'http://www.pygtk.org/'
  sha1 '344e6a32a5e8c7e0aaeb807e0636a163095231c2'

  depends_on :x11
  depends_on 'glib'
  depends_on 'gtk+'
  depends_on 'pygobject'
  depends_on 'py2cairo'
  depends_on 'libglade' if build.include? 'glade'

  option :universal
  option 'glade', 'Python bindigs for glade. (to `import gtk.glade`)'

  def install
    ENV.append 'CFLAGS', '-ObjC'
    ENV.universal_binary if build.universal?
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    system "make install"

    # Fixing the pkgconfig file to find codegen, because it was moved from
    # pygtk to pygobject. But our pkgfiles point into the cellar and in the
    # pygtk-cellar there is no pygobject.
    inreplace lib/'pkgconfig/pygtk-2.0.pc', 'codegendir=${datadir}/pygobject/2.0/codegen', "codegendir=#{HOMEBREW_PREFIX}/share/pygobject/2.0/codegen"
  end

  def caveats; <<-EOS.undent<commit_msg>pygtk: style nits<commit_after>require 'formula'

class Pygtk < Formula
  homepage 'http://www.pygtk.org/'
  url 'http://ftp.acc.umu.se/pub/GNOME/sources/pygtk/2.24/pygtk-2.24.0.tar.bz2'
  sha1 '344e6a32a5e8c7e0aaeb807e0636a163095231c2'

  depends_on :x11
  depends_on 'glib'
  depends_on 'gtk+'
  depends_on 'pygobject'
  depends_on 'py2cairo'
  depends_on 'libglade' if build.include? 'glade'

  option :universal
  option 'glade', 'Python bindigs for glade. (to `import gtk.glade`)'

  def install
    ENV.append 'CFLAGS', '-ObjC'
    ENV.universal_binary if build.universal?
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    system "make install"

    # Fixing the pkgconfig file to find codegen, because it was moved from
    # pygtk to pygobject. But our pkgfiles point into the cellar and in the
    # pygtk-cellar there is no pygobject.
    inreplace lib/'pkgconfig/pygtk-2.0.pc', 'codegendir=${datadir}/pygobject/2.0/codegen', "codegendir=#{HOMEBREW_PREFIX}/share/pygobject/2.0/codegen"
  end

  def caveats; <<-EOS.undent
{'fraction_non_alphanumeric': 0.12718089990817263, 'fraction_numerical': 0.04132231404958678, 'mean_word_length': 3.492783505154639, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2831081', 'n_tokens_mistral': 887, 'n_tokens_neox': 813, 'n_words': 181}