homebrew-core/Formula/zimg.rb
2017-11-14 07:40:48 -08:00

44 lines
1.4 KiB
Ruby

class Zimg < Formula
desc "Scaling, colorspace conversion, and dithering library"
homepage "https://github.com/sekrit-twc/zimg"
url "https://github.com/sekrit-twc/zimg/archive/release-2.6.2.tar.gz"
sha256 "db407144b265c1587867e00108f6fc810d40cf94be697de75985a0cb9041313d"
head "https://github.com/sekrit-twc/zimg.git"
bottle do
cellar :any
sha256 "8dd8283881f4d519a2c3a376abf6e76e2ca52da090d74f3309bec74999eb9451" => :high_sierra
sha256 "1edba9d02df895f7aacb63a3db0338fa5b30f02bbe27413e2919795a17842d60" => :sierra
sha256 "8357eaa481985bc22ebd1a335125caecf13b63db6fa178d19ed7b45aa8552d92" => :el_capitan
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
# Upstream has decided not to fix https://github.com/sekrit-twc/zimg/issues/52
depends_on :macos => :el_capitan
def install
system "./autogen.sh"
system "./configure", "--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <assert.h>
#include <zimg.h>
int main()
{
zimg_image_format format;
zimg_image_format_default(&format, ZIMG_API_VERSION);
assert(ZIMG_MATRIX_UNSPECIFIED == format.matrix_coefficients);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lzimg", "-o", "test"
system "./test"
end
end