<commit_before>require 'formula'

class GnomeDocUtils < Formula
  homepage 'https://live.gnome.org/GnomeDocUtils'
  url 'ftp://ftp.gnome.org/pub/gnome/sources/gnome-doc-utils/0.20/gnome-doc-utils-0.20.6.tar.bz2'
  sha256 '091486e370480bf45349ad09dac799211092a02938b26a0d68206172cb6cebbf'

  depends_on 'pkg-config' => :build
  depends_on 'intltool'
  depends_on 'docbook'
  depends_on 'gettext'

  # libxml2 must be installed --with-python, and since it is keg-only, the
  # Python module must also be symlinked into site-packages or put on the
  # PYTHONPATH.
  depends_on 'libxml2'

  fails_with_llvm "Undefined symbols when linking", :build => "2326"

  def install
    args = ["--prefix=#{prefix}",
            "--disable-scrollkeeper",
            "--enable-build-utils=yes"]

    system "./configure", *args
<commit_msg>gnome-doc-utils: set PYTHONPATH for libxml2 module<commit_after>require 'formula'

class GnomeDocUtils < Formula
  homepage 'https://live.gnome.org/GnomeDocUtils'
  url 'ftp://ftp.gnome.org/pub/gnome/sources/gnome-doc-utils/0.20/gnome-doc-utils-0.20.6.tar.bz2'
  sha256 '091486e370480bf45349ad09dac799211092a02938b26a0d68206172cb6cebbf'

  depends_on 'pkg-config' => :build
  depends_on 'intltool'
  depends_on 'docbook'
  depends_on 'gettext'

  # libxml2 must be installed --with-python, and since it is keg-only, the
  # Python module must also be symlinked into site-packages or put on the
  # PYTHONPATH.
  depends_on 'libxml2'

  fails_with_llvm "Undefined symbols when linking", :build => "2326"

  def install
    # TODO this should possibly be moved up into build.rb
    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", "--prefix=#{prefix}",
                          "--disable-scrollkeeper",
                          "--enable-build-utils=yes"

{'fraction_non_alphanumeric': 0.12557900154400412, 'fraction_numerical': 0.06639217704580545, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '4420423', 'n_tokens_mistral': 771, 'n_tokens_neox': 692, 'n_words': 147}