<commit_before>require 'formula'

class Libxml2 < Formula
  url 'ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz'
  homepage 'http://xmlsoft.org'
  md5 '8127a65e8c3b08856093099b52599c86'

  keg_only :provided_by_osx

  fails_with :llvm do
    build 2326
    cause "Undefined symbols when linking"
  end

  def options
    [
      ['--with-python', 'Compile the libxml2 Python 2.x modules'],
      ['--universal', 'Build a universal binary.']
    ]
  end

  def install
    ENV.universal_binary if ARGV.build_universal?

    args = ["--disable-dependency-tracking", "--prefix=#{prefix}"]
    if ARGV.include? '--with-python'
      python_prefix=`python-config --prefix`
      ohai "Installing Python module to #{python_prefix}"
      args << "--with-python=#{python_prefix}"
    end

    system "./configure", *args
    system "make"
    ENV.j1
    system "make install"
  end
end
<commit_msg>libxml2 2.8.0<commit_after>require 'formula'

class Libxml2 < Formula
  homepage 'http://xmlsoft.org'
  url 'ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz'
  sha256 'f2e2d0e322685193d1affec83b21dc05d599e17a7306d7b90de95bb5b9ac622a'

  keg_only :provided_by_osx

  fails_with :llvm do
    build 2326
    cause "Undefined symbols when linking"
  end

  def options
    [
      ['--with-python', 'Compile the libxml2 Python 2.x modules'],
      ['--universal', 'Build a universal binary.']
    ]
  end

  def install
    ENV.universal_binary if ARGV.build_universal?

    system "./configure", "--prefix=#{prefix}", "--without-python"
    system "make"
    ENV.deparallelize
    system "make install"

    if ARGV.include? '--with-python'
      # Build Python bindings manually
      cd 'python' do
        python_lib = lib/which_python/'site-packages'
        ENV.append 'PYTHONPATH', python_lib
        python_lib.mkpath

        archs = archs_for_command("python")
        archs.remove_ppc!
        arch_flags = archs.as_arch_flags

        ENV.append 'CFLAGS', arch_flags
        ENV.append 'LDFLAGS', arch_flags

        system "python", "setup.py", "install_lib",
          "--install-dir=#{python_lib}"
      end
    end
  end

  def which_python
    "python" + `python -c 'import sys;print(sys.version[:3])'`.strip
  end
end

{'fraction_non_alphanumeric': 0.12286228622862286, 'fraction_numerical': 0.04410441044104411, 'mean_word_length': 2.8460207612456747, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 13}, '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': '1501673', 'n_tokens_mistral': 846, 'n_tokens_neox': 760, 'n_words': 171}