2014-07-09 06:34:49 +00:00
|
|
|
class Mozjpeg < Formula
|
|
|
|
homepage "https://github.com/mozilla/mozjpeg"
|
2014-12-30 22:39:13 +00:00
|
|
|
url "https://github.com/mozilla/mozjpeg/releases/download/v3.0/mozjpeg-3.0-release-source.tar.gz"
|
|
|
|
sha1 "9b56af77ce376300e1f6de78b52b2ce9b6f19596"
|
2014-07-09 06:34:49 +00:00
|
|
|
|
2014-12-19 18:32:22 +00:00
|
|
|
head do
|
|
|
|
url "https://github.com/mozilla/mozjpeg.git"
|
|
|
|
|
2014-12-30 22:39:13 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
2014-12-19 18:32:22 +00:00
|
|
|
end
|
2014-07-09 06:34:49 +00:00
|
|
|
|
2014-07-09 17:35:12 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2014-12-30 23:26:33 +00:00
|
|
|
sha1 "d4c74518254db363f15b9c2211368eb3df856c33" => :yosemite
|
|
|
|
sha1 "1141f9bbb67f3938a3c061bd3adcfc7b7d6a5710" => :mavericks
|
|
|
|
sha1 "684bd946e018dbcd5968301805649ec20bc4a496" => :mountain_lion
|
2014-07-09 17:35:12 +00:00
|
|
|
end
|
|
|
|
|
2014-12-30 22:39:13 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2014-07-09 06:34:49 +00:00
|
|
|
depends_on "nasm" => :build
|
2014-12-30 22:39:13 +00:00
|
|
|
depends_on "libpng" => :optional
|
2014-07-09 06:34:49 +00:00
|
|
|
|
|
|
|
keg_only "mozjpeg is not linked to prevent conflicts with the standard libjpeg."
|
|
|
|
|
|
|
|
def install
|
2014-12-30 22:39:13 +00:00
|
|
|
system "autoreconf", "-i" if build.head?
|
2014-07-09 06:34:49 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}",
|
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--with-jpeg8"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2014-07-28 17:30:49 +00:00
|
|
|
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",
|
2014-10-19 06:14:32 +00:00
|
|
|
test_fixtures("test.jpg")
|
2014-07-09 06:34:49 +00:00
|
|
|
end
|
|
|
|
end
|