aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/media-info.rb
blob: d49336d18d95dff1429841b2afa5cacad548b30d (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
32
33
34
35
36
37
38
39
40
require 'formula'

def libcurl?
  ARGV.include? '--with-libcurl'
end

class MediaInfo < Formula
  homepage 'http://mediainfo.sourceforge.net'
  url 'http://downloads.sourceforge.net/mediainfo/MediaInfo_CLI_0.7.52_GNU_FromSource.tar.bz2'
  md5 '088e62c8f2992c776a881fd6813f150f'

  def options
    [["--with-libcurl", "Build with libcurl support."]]
  end

  depends_on 'pkg-config' => :build

  def install
    cd 'ZenLib/Project/GNU/Library' do
      system "./configure", "--disable-debug", "--disable-dependency-tracking",
                            "--prefix=#{prefix}"
      system "make"
    end

    cd "MediaInfoLib/Project/GNU/Library" do
      args = ["--disable-debug",
              "--disable-dependency-tracking",
              "--prefix=#{prefix}"]
      args << "--with-libcurl" if libcurl?
      system "./configure", *args
      system "make install"
    end

    cd "MediaInfo/Project/GNU/CLI" do
      system "./configure", "--disable-debug", "--disable-dependency-tracking",
                            "--prefix=#{prefix}"
      system "make install"
    end
  end
end