aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/openh264.rb
blob: 4e3bb77c5403643a2ba316ac0fd07ca358ad3b61 (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
class Openh264 < Formula
  homepage "http://www.openh264.org"
  url "https://github.com/cisco/openh264/archive/v1.3.1.tar.gz"
  sha256 "b0a9a61840b4a58fbadd2a0640a81917c0ee84e922d2476c1dbcb9f29b85d7a0"
  head "https://github.com/cisco/openh264.git"

  bottle do
    cellar :any
    sha1 "582bf09f67c1c1f6cb775e9fcff3ea8f1d8dc482" => :yosemite
    sha1 "44136761ff774546fb4ef571d38712edc5e5e0a2" => :mavericks
    sha1 "2a464bb129406b2ee227c63720bef8b2235a9910" => :mountain_lion
  end

  depends_on "nasm" => :build

  def install
    system "make", "install-shared", "PREFIX=#{prefix}"
    chmod 0444, "#{lib}/libopenh264.dylib"
  end

  test do
    (testpath/"test.c").write <<-EOS.undent
      #include <wels/codec_api.h>
      int main() {
        ISVCDecoder *dec;
        WelsCreateDecoder (&dec);
        WelsDestroyDecoder (dec);
        return 0;
      }
    EOS
    system ENV.cc, "test.c", "-lopenh264", "-o", "test"
    system "./test"
  end
end