libimagequant 2.12.1 (new formula)

Closes #28518.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
Felix Bünemann 2018-06-04 16:28:53 +02:00 committed by ilovezfs
parent 712b1f0a1f
commit 5d2c5f77ef

30
Formula/libimagequant.rb Normal file
View file

@ -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 <libimagequant.h>
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