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.5.tar.gz" sha256 "50b2bcc49e51cd36011a0c363ff914a81b6f161aefdffeaa2bc4a4627c13784d" head "https://github.com/sekrit-twc/zimg.git" bottle do cellar :any sha256 "da98055f222b406921f6962beec1f5b33c0baccc5dbbc99662f861e1b030d3b6" => :sierra sha256 "191db67e378323bc2e9ca1092eeb0f96457f27cd374d115088078f608965a20f" => :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 #include 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