2012-04-26 08:44:51 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class JpegTurbo < Formula
|
|
|
|
homepage 'http://www.libjpeg-turbo.org/'
|
2013-05-30 21:34:22 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/libjpeg-turbo/1.3.0/libjpeg-turbo-1.3.0.tar.gz'
|
|
|
|
sha1 '1792c964b35604cebd3a8846f1ca6de5976e9c28'
|
2012-04-26 08:44:51 +00:00
|
|
|
|
|
|
|
depends_on 'nasm' => :build if MacOS.prefer_64_bit?
|
|
|
|
|
|
|
|
keg_only "libjpeg-turbo is not linked to prevent conflicts with the standard libjpeg."
|
|
|
|
|
|
|
|
def install
|
2013-05-14 00:24:58 +00:00
|
|
|
args = ["--disable-dependency-tracking", "--prefix=#{prefix}", "--with-jpeg8"]
|
2012-07-23 19:17:54 +00:00
|
|
|
if MacOS.prefer_64_bit?
|
|
|
|
args << "--host=x86_64-apple-darwin"
|
|
|
|
# Auto-detect our 64-bit nasm
|
|
|
|
args << "NASM=#{Formula.factory('nasm').bin}/nasm"
|
|
|
|
end
|
|
|
|
|
2012-04-26 08:44:51 +00:00
|
|
|
system "./configure", *args
|
2012-07-02 10:07:15 +00:00
|
|
|
system 'make'
|
|
|
|
ENV.j1 # Stops a race condition error: file exists
|
2012-04-26 08:44:51 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
|
2013-01-07 03:23:12 +00:00
|
|
|
test do
|
|
|
|
system "#{bin}/jpegtran", "-crop", "500x500+200+500",
|
|
|
|
"-transpose", "-perfect",
|
|
|
|
"-outfile", "test.jpg",
|
|
|
|
"/System/Library/CoreServices/DefaultDesktop.jpg"
|
2012-04-26 08:44:51 +00:00
|
|
|
end
|
|
|
|
end
|