<commit_before>require 'formula'

class Valgrind <Formula
  url 'http://www.valgrind.org/downloads/valgrind-3.5.0.tar.bz2'
  homepage 'http://www.valgrind.org/'
  md5 'f03522a4687cf76c676c9494fcc0a517'

  def install
    opoo "Valgrind 3.5.0 doesn't support Snow Leopard; see caveats." if MACOS_VERSION > 10.5
    system "./configure", "--prefix=#{prefix}", "--mandir=#{man}"
    system "make install"
  end

  def caveats
    if MACOS_VERSION > 10.5
      "Valgrind does not work on Snow Leopard / 64-bit mode. See:\n"+
      "    http://bugs.kde.org/show_bug.cgi?id=205241"
    end
  end
end<commit_msg>Add some 10.6 support for valgrind [mschneider]<commit_after>require 'formula'

class Autoconf267 <Formula
  url 'http://ftp.gnu.org/gnu/autoconf/autoconf-2.67.tar.bz2'
  md5 '3fbf92eb8eaca1e0d33dff9710edb5f0'
  homepage 'http://www.gnu.org/software/autoconf/'
end

class Valgrind <Formula
  homepage 'http://www.valgrind.org/'

  # Stable release doesn't work in 64-bit mode
  if MACOS_VERSION == 10.5
    url 'http://www.valgrind.org/downloads/valgrind-3.5.0.tar.bz2'
    md5 'f03522a4687cf76c676c9494fcc0a517'
  end

  head "svn://svn.valgrind.org/valgrind/trunk", :revision => "11255"

  depends_on 'pkg-config'
  depends_on 'boost'

  def install
    args = ["--prefix=#{prefix}", "--mandir=#{man}"]

    if MACOS_VERSION >= 10.6
      # OS X comes with 2.61, which is too old
      ac_prefix = Pathname.pwd+'ac267'
      Autoconf267.new.brew do |f|
        system "./configure", "--prefix=#{ac_prefix}"
        system "make install"
      end

      ENV.prepend "PATH", ac_prefix+'bin', ":"

      system "./autogen.sh" if File.exists? "autogen.sh"
      args << "--enable-only64bit" << "--build=amd64-darwin"
    end

    system "./configure", *args
    system "make install"
  end
end
{'fraction_non_alphanumeric': 0.14691151919866444, 'fraction_numerical': 0.06789092932665554, 'mean_word_length': 3.0863636363636364, 'pattern_counts': {'":': 1, '<': 10, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 5, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1752017', 'n_tokens_mistral': 769, 'n_tokens_neox': 688, 'n_words': 146}