blob: b62176a41cec95a72195f7697a2013e98518911e (
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
|
require 'formula'
class JpegTurbo < Formula
homepage 'http://www.libjpeg-turbo.org/'
url 'https://downloads.sourceforge.net/project/libjpeg-turbo/1.3.1/libjpeg-turbo-1.3.1.tar.gz'
mirror 'https://mirrors.kernel.org/debian/pool/main/libj/libjpeg-turbo/libjpeg-turbo_1.3.1.orig.tar.gz'
sha1 '5fa19252e5ca992cfa40446a0210ceff55fbe468'
depends_on "libtool" => :build
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
cp Dir["#{Formula["libtool"].opt_share}/libtool/config/config.*"], buildpath
args = ["--disable-dependency-tracking", "--prefix=#{prefix}", "--with-jpeg8", "--mandir=#{man}"]
if MacOS.prefer_64_bit?
# Auto-detect our 64-bit nasm
args << "NASM=#{Formula["nasm"].bin}/nasm"
end
system "./configure", *args
system 'make'
ENV.j1 # Stops a race condition error: file exists
system "make install"
end
test do
test_jpg = HOMEBREW_LIBRARY/"Homebrew/test/fixtures/test.jpg"
system "#{bin}/jpegtran", "-crop", "1x1",
"-transpose", "-perfect",
"-outfile", "out.jpg",
test_jpg
end
end
|