aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mkvtoolnix.rb
blob: fef95f3b5ba040a52028b48d792f72d064d0887f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'formula'

class Mkvtoolnix <Formula
  url 'http://www.bunkus.org/videotools/mkvtoolnix/sources/mkvtoolnix-4.0.0.tar.bz2'
  homepage 'http://www.bunkus.org/videotools/mkvtoolnix/'
  md5 '434eb24b9c49a99ac386bd2c4c525538'

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

  def install
    # as of v3.3.0, doesn't seem to be BSD compatible here
    inreplace 'handle_deps',
      %q!sed -e 's:\\.\\(o\\|gch\\)$:.d:'!,
      %q!sed -E -e 's:\\.(o|gch)$:.d:'!

    flac_flag = Formula.factory('flac').installed? ? "--with-flac" : "--without-flac"

    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
                          flac_flag,
                          "--disable-gui", "--disable-wxwidgets"
    system "make"
    system "make install"
  end
end