2014-07-09 06:34:49 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Mozjpeg < Formula
|
|
|
|
homepage "https://github.com/mozilla/mozjpeg"
|
2014-08-06 15:31:02 +00:00
|
|
|
url "https://github.com/mozilla/mozjpeg/archive/v2.1.tar.gz"
|
|
|
|
sha1 "07f8df93cd54adbec37869833de987eb12ce7062"
|
2014-07-09 06:34:49 +00:00
|
|
|
|
|
|
|
head "https://github.com/mozilla/mozjpeg.git"
|
|
|
|
|
2014-07-09 17:35:12 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2014-08-06 15:35:38 +00:00
|
|
|
sha1 "70e71c29b055c805f1e1cad0529078d76099e728" => :mavericks
|
|
|
|
sha1 "afc0b5feceb012bfa03dc27528bb04c70d6195d4" => :mountain_lion
|
|
|
|
sha1 "6e289260bb131bb2e4da792dc926ae245e8d7665" => :lion
|
2014-07-09 17:35:12 +00:00
|
|
|
end
|
|
|
|
|
2014-07-09 06:34:49 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
depends_on "nasm" => :build
|
|
|
|
|
|
|
|
keg_only "mozjpeg is not linked to prevent conflicts with the standard libjpeg."
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "autoreconf", "-i"
|
|
|
|
system "./configure", "--prefix=#{prefix}",
|
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--with-jpeg8"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2014-07-28 17:30:49 +00:00
|
|
|
test_jpg = HOMEBREW_LIBRARY/"Homebrew/test/fixtures/test.jpg"
|
|
|
|
system "#{bin}/jpegtran", "-crop", "1x1",
|
2014-07-09 06:34:49 +00:00
|
|
|
"-transpose", "-optimize",
|
2014-07-28 17:30:49 +00:00
|
|
|
"-outfile", "out.jpg",
|
|
|
|
test_jpg
|
2014-07-09 06:34:49 +00:00
|
|
|
end
|
|
|
|
end
|