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.7.2.tar.gz" sha256 "8bfa286520fb5d8486889472e0a15e9a76d9d320dc0c8999e35804c90e5bf258" head "https://github.com/sekrit-twc/zimg.git" bottle do cellar :any sha256 "27800c470f10316c0ebd2b3695fea91d0727610cac0447be12a5ef643e39aa4c" => :high_sierra sha256 "b8a2d77385048e7815b04718450db58c49e6db24e1aaa055406aa8b6b83a19b5" => :sierra sha256 "5f102eba8c058136ae24df73437a92bc8830daa27ee6094fd87309c7134dae51" => :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 #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