aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/webp.rb
blob: 5e0287b025ce69f6d1a794b246bec1fe34638ed1 (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
require 'formula'

class Webp < Formula
  homepage "https://developers.google.com/speed/webp/"
  url 'http://downloads.webmproject.org/releases/webp/libwebp-0.4.2.tar.gz'
  sha256 '14d825d7c2ef7d49621bcb6b83466be455585e671ae0a2ebc1f2e07775a1722d'

  bottle do
    cellar :any
    sha1 "5eb5c1021f826ddb6fc224a24c25c42e031d7662" => :yosemite
    sha1 "4a937acc7cfdec599bd78809447bd03eb2bf6fc9" => :mavericks
    sha1 "3a1b012465710145c7daf74251bfe99bfd477ec4" => :mountain_lion
  end

  revision 1

  option :universal

  depends_on 'libpng'
  depends_on 'jpeg' => :recommended
  depends_on 'libtiff' => :optional
  depends_on 'giflib' => :optional

  def install
    ENV.universal_binary if build.universal?
    system "./configure", "--disable-dependency-tracking",
                          "--enable-libwebpmux",
                          "--enable-libwebpdemux",
                          "--enable-libwebpdecoder",
                          "--prefix=#{prefix}"
    system "make install"
  end

  test do
    system "#{bin}/cwebp", test_fixtures("test.png"), "-o", "webp_test.png"
    system "#{bin}/dwebp", "webp_test.png", "-o", "webp_test.webp"
  end
end