<commit_before>require 'formula'

class Libxml2 < Formula
  homepage 'http://xmlsoft.org'
  url 'ftp://xmlsoft.org/libxml2/libxml2-2.9.1.tar.gz'
  mirror 'http://xmlsoft.org/sources/libxml2-2.9.1.tar.gz'
  sha256 'fd3c64cb66f2c4ea27e934d275904d92cec494a8e8405613780cbc8a71680fdb'

  head 'https://git.gnome.org/browse/libxml2', :using => :git

  depends_on :ld64

  keg_only :provided_by_osx

  option :universal

  if build.head?
    depends_on :python => :recommended # satisfied by Python 2.6+
    depends_on :autoconf
    depends_on :automake
    depends_on :libtool
  else
    # 2.9.1 cannot build with Python 2.6: https://github.com/mxcl/homebrew/issues/20249
    depends_on PythonInstalled.new("2.7") => :recommended
  end

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

  def install
    ENV.universal_binary if build.universal?
    if build.head?<commit_msg>libxml2: Fix missing option --with-python<commit_after>require 'formula'

class Libxml2 < Formula
  homepage 'http://xmlsoft.org'
  url 'ftp://xmlsoft.org/libxml2/libxml2-2.9.1.tar.gz'
  mirror 'http://xmlsoft.org/sources/libxml2-2.9.1.tar.gz'
  sha256 'fd3c64cb66f2c4ea27e934d275904d92cec494a8e8405613780cbc8a71680fdb'

  head 'https://git.gnome.org/browse/libxml2', :using => :git

  depends_on :ld64

  keg_only :provided_by_osx

  option :universal

  if build.head?
    depends_on :python => :recommended # satisfied by Python 2.6+
    depends_on :autoconf
    depends_on :automake
    depends_on :libtool
  else
    # 2.9.1 cannot build with Python 2.6: https://github.com/mxcl/homebrew/issues/20249
    depends_on PythonInstalled.new("2.7", :recommended)
  end

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

  def install
    ENV.universal_binary if build.universal?
    if build.head?
{'fraction_non_alphanumeric': 0.1092391304347826, 'fraction_numerical': 0.08097826086956522, 'mean_word_length': 3.63727959697733, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 17}, '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': '7526392', 'n_tokens_mistral': 791, 'n_tokens_neox': 706, 'n_words': 141}