<commit_before>require 'formula'

class GtkDoc < Formula
  homepage 'http://www.gtk.org/gtk-doc/'
  url 'http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/1.18/gtk-doc-1.18.tar.bz2'
  sha256 'a634d2e93d70468237033c06a17c97f29cf71a35ac5cc01c016324c965d42f73'

  depends_on 'pkg-config' => :build
  depends_on 'gnome-doc-utils' => :build
  depends_on 'gettext'
  depends_on 'glib'
  depends_on 'docbook'

  def install
    system "./configure", "--disable-debug",
                          "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--disable-scrollkeeper",
                          "--with-xml-catalog=#{etc}/xml/catalog"
    system "make"
    system "make install"
  end
end<commit_msg>gtk-doc: find the libxml2 python site-packages directory<commit_after>require 'formula'

class GtkDoc < Formula
  homepage 'http://www.gtk.org/gtk-doc/'
  url 'http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/1.18/gtk-doc-1.18.tar.bz2'
  sha256 'a634d2e93d70468237033c06a17c97f29cf71a35ac5cc01c016324c965d42f73'

  depends_on 'pkg-config' => :build
  depends_on 'gnome-doc-utils' => :build
  depends_on 'gettext'
  depends_on 'glib'
  depends_on 'docbook'
  depends_on 'libxml2'

  def install
    # libxml2 must be installed with python support; this should be ensured
    # by the gnome-doc-utils dependency. However it is keg-only, so we have
    # to put its site-packages directory on the PYTHONPATH
    pydir = 'python' + `python -c 'import sys;print(sys.version[:3])'`.strip
    libxml2 = Formula.factory('libxml2')
    ENV.prepend 'PYTHONPATH', libxml2.lib/pydir/'site-packages', ':'

    system "./configure", "--disable-debug",
                          "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--disable-scrollkeeper",
                          "--with-xml-catalog=#{etc}/xml/catalog"
    system "make"
    system "make install"
  end
end
{'fraction_non_alphanumeric': 0.13448802852776362, 'fraction_numerical': 0.059602649006622516, 'mean_word_length': 2.545126353790614, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 10}, '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': '1410925', 'n_tokens_mistral': 746, 'n_tokens_neox': 668, 'n_words': 126}