aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/libvpx.rb
blob: 44bd4378c0930c9f08fa7220443b9eb9e028def1 (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
require 'formula'

class Libvpx < Formula
  url 'http://webm.googlecode.com/files/libvpx-v1.0.0.tar.bz2'
  sha256 '07cedb0a19a44e6d81d75f52eea864f59ef10c6c725cb860431bec6641eafe21'
  homepage 'http://www.webmproject.org/code/'

  depends_on 'yasm' => :build

  def options
    [
      ['--gcov', 'Enable code coverage'],
      ['--mem-tracker', 'Enable tracking memory usage'],
      ['--postproc','Enable post processing'],
      ['--visualizer', 'Enable post processing visualizer']
    ]
  end

  def install
    macbuild = Pathname.pwd+'macbuild'
    mkdir macbuild
    Dir.chdir macbuild
    args = ["--prefix=#{prefix}",
            "--enable-pic",
            "--enable-vp8"]
    args << "--enable-gcov" if ARGV.include? "--gcov"
    args << "--enable-mem-tracker" if ARGV.include? "--mem-tracker"
    args << "--enable-postproc" if ARGV.include? "--postproc"
    args << "--enable-postproc-visualizer" if ARGV.include? "--visualizer"
    # Configure detects 32-bit CPUs incorrectly.
    args << "--target=generic-gnu" unless MacOS.prefer_64_bit?
    system "../configure", *args
    system "make"
    system "make install"
  end
end