From 359e103ff5a0cbcc0c6cb143ec6a0e42b52c31fd Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Mon, 23 Apr 2018 05:09:21 +0100 Subject: [PATCH] libheif 1.2.0 (new formula) Closes #26960. Signed-off-by: ilovezfs --- Formula/libheif.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Formula/libheif.rb diff --git a/Formula/libheif.rb b/Formula/libheif.rb new file mode 100644 index 0000000000..9a56264326 --- /dev/null +++ b/Formula/libheif.rb @@ -0,0 +1,30 @@ +class Libheif < Formula + desc "ISO/IEC 23008-12:2017 HEIF file format decoder and encoder" + homepage "http://www.libheif.org" + url "https://github.com/strukturag/libheif/releases/download/v1.2.0/libheif-1.2.0.tar.gz" + sha256 "2e7d40f81d1bbe6089b1e0f27800b97cf6a195e093ef86199edfb6e59e2fa8fa" + + depends_on "pkg-config" => :build + depends_on "jpeg" + depends_on "libde265" + depends_on "libpng" + depends_on "x265" + + def install + system "./configure", "--disable-dependency-tracking", + "--disable-silent-rules", + "--prefix=#{prefix}" + system "make", "install" + pkgshare.install "examples/example.heic" + end + + test do + output = "File contains 2 images" + example = pkgshare/"example.heic" + exout = testpath/"example.jpg" + + assert_match output, shell_output("#{bin}/heif-convert #{example} #{exout}") + assert_predicate testpath/"example-1.jpg", :exist? + assert_predicate testpath/"example-2.jpg", :exist? + end +end