43 lines
1.3 KiB
Ruby
43 lines
1.3 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.6a.tar.gz"
|
|
sha256 "d3ba0bb21a3919baf28f3caf9821cfba6ac8b40e74ee43948caae14e8a9e6a61"
|
|
head "https://github.com/sekrit-twc/zimg.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "739b8cc2e309d026abe3127f5914b9165b7522cb6c75bc4166b28e4c72e4a8b5" => :sierra
|
|
sha256 "9f3258f518a86b2670fdf20aa18eaee5155f84a8b081d5f7d004568068c3607a" => :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.undent
|
|
#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
|