From 5d2c5f77ef97887d3aa0031e5fa2f82cb1964447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Bu=CC=88nemann?= Date: Mon, 4 Jun 2018 16:28:53 +0200 Subject: [PATCH] libimagequant 2.12.1 (new formula) Closes #28518. Signed-off-by: ilovezfs --- Formula/libimagequant.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Formula/libimagequant.rb diff --git a/Formula/libimagequant.rb b/Formula/libimagequant.rb new file mode 100644 index 0000000000..fe0f9d3c93 --- /dev/null +++ b/Formula/libimagequant.rb @@ -0,0 +1,30 @@ +class Libimagequant < Formula + desc "Palette quantization library extracted from pnquant2" + homepage "https://pngquant.org/lib/" + url "https://github.com/ImageOptim/libimagequant/archive/2.12.1.tar.gz" + sha256 "7035eb281bc9a49cf36db8db807b713d03a0ffe8c5abfbb17a9ea8a038f21d5e" + + def install + system "./configure", "--prefix=#{prefix}" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~EOS + #include + + int main() + { + liq_attr *attr = liq_attr_create(); + if (!attr) { + return 1; + } else { + liq_attr_destroy(attr); + return 0; + } + } + EOS + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-limagequant", "-o", "test" + system "./test" + end +end