aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/zopfli.rb
blob: c37c64315be7011d4b294f111ebd4e75fa6add27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'formula'

class Zopfli < Formula
  homepage 'https://code.google.com/p/zopfli/'
  url 'https://zopfli.googlecode.com/files/zopfli-1.0.0.zip'
  sha1 '98ea00216e296bf3a13e241d7bc69490042ea7ce'
  head 'https://code.google.com/p/zopfli/', :using => :git

  def install
    # Makefile hardcodes gcc
    inreplace 'Makefile', 'gcc', ENV.cc
    system 'make'
    bin.install 'zopfli'
    if build.head?
      system 'make', 'zopflipng'
      bin.install 'zopflipng'
    end
  end

  test do
    system "#{bin}/zopfli"
  end
end