<commit_before>require 'formula'

class Mkvtoolnix < Formula
  homepage 'http://www.bunkus.org/videotools/mkvtoolnix/'
  url 'http://www.bunkus.org/videotools/mkvtoolnix/sources/mkvtoolnix-5.0.1.tar.bz2'
  sha1 '900211d47ba6cbeb4188bb45a492a2b9edf08ed2'

  head 'https://github.com/mbunkus/mkvtoolnix.git'

  depends_on 'boost'
  depends_on 'libvorbis'
  depends_on 'libmatroska'
  depends_on 'flac' => :optional
  depends_on 'lzo' => :optional

  fails_with :clang do
    build 318
    cause "Compilation errors with older clang."
  end

  # Patch to build with #define foreach BOOST_FOREACH
  # See: https://svn.boost.org/trac/boost/ticket/6131
  def patches
    DATA unless build.head?
  end

  def install
    system "./configure", "--disable-debug",
                          "--prefix=#{prefix}",
                          "--with-boost-libdir=#{HOMEBREW_PREFIX}/lib", # For non-/usr/local prefix
                          "--with-boost-regex=boost_regex-mt" # via macports
    system "./drake", "-j#{ENV.make_jobs}"
    system "./drake install"
  end
end

__END__
diff --git a/src/common/common.h b/src/common/common.h
index 16f7177..8e9e053 100644
--- a/src/common/common.h
+++ b/src/common/common.h
@@ -17,7 +17,6 @@
 #undef min
 #undef max

-#include <boost/foreach.hpp>
 #include <boost/format.hpp>
 #include <boost/regex.hpp>
 #include <string>
@@ -83,6 +82,7 @@ extern unsigned int MTX_DLL_API verbose;

 #define foreach                  BOOST_FOREACH
 #define reverse_foreach          BOOST_REVERSE_FOREACH
+#include <boost/foreach.hpp>
 #define mxforeach(it, vec)       for (it = (vec).begin(); it != (vec).end(); it++)
 #define mxfind(value, cont)      std::find(cont.begin(), cont.end(), value)
 #define mxfind2(it, value, cont) ((it = std::find((cont).begin(), (cont).end(), value)) != (cont).end())<commit_msg>mkvtoolnix: use Boost 1.49<commit_after>require 'formula'

class Mkvtoolnix < Formula
  homepage 'http://www.bunkus.org/videotools/mkvtoolnix/'
  url 'http://www.bunkus.org/videotools/mkvtoolnix/sources/mkvtoolnix-5.0.1.tar.bz2'
  sha1 '900211d47ba6cbeb4188bb45a492a2b9edf08ed2'

  head 'https://github.com/mbunkus/mkvtoolnix.git'

  depends_on 'boost149'
  depends_on 'libvorbis'
  depends_on 'libmatroska'
  depends_on 'flac' => :optional
  depends_on 'lzo' => :optional

  fails_with :clang do
    build 318
    cause "Compilation errors with older clang."
  end

  def install
    old_boost = Formula.factory("boost149")
    system "./configure", "--disable-debug",
                          "--prefix=#{prefix}",
                          "--with-boost=#{old_boost.prefix}",
                          "--with-boost-regex=boost_regex-mt" # via macports
    system "./drake", "-j#{ENV.make_jobs}"
    system "./drake install"
  end
end
{'fraction_non_alphanumeric': 0.14817491868449584, 'fraction_numerical': 0.03794723527285869, 'mean_word_length': 2.9770114942528734, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, 'https://': 3, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, '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': '6499362', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1006, 'n_words': 195}