homebrew-core/Formula/gifski.rb

36 lines
1.1 KiB
Ruby
Raw Normal View History

class Gifski < Formula
desc "Highest-quality GIF encoder based on pngquant"
homepage "https://gif.ski/"
url "https://github.com/ImageOptim/gifski/archive/0.8.2.tar.gz"
sha256 "d7bf1b6515c273b822c94fc78e6d10fbc45d444a04bc3487fe3e799d6aa836e0"
revision 1
2017-12-14 13:40:36 +00:00
bottle do
2018-03-07 06:12:13 +00:00
sha256 "48f7b226aad64ed09df2ba12aef1c5eb4d50bdd2892338205050a9508b4b441d" => :high_sierra
sha256 "bd9d8fa459ecd0be1163d188f2dce0df132a2a6a1df11c718e74c746c8da34c0" => :sierra
sha256 "8451f3f386963c5a48e48ae62028c8c954c9c91395ac2b47dcf51e87380b987b" => :el_capitan
2017-12-14 13:40:36 +00:00
end
2018-03-22 20:13:31 +00:00
option "with-openmp", "Enable OpenMP multithreading"
depends_on "pkg-config" => :build
depends_on "rust" => :build
2018-03-22 20:13:31 +00:00
depends_on "gcc" if build.with? "openmp"
fails_with :clang if build.with? "openmp"
def install
2018-03-22 20:13:31 +00:00
args = ["--release"]
args << "--features=openmp" if build.with? "openmp"
2018-03-22 20:13:31 +00:00
system "cargo", "build", *args
bin.install "target/release/gifski"
end
test do
png = test_fixtures("test.png")
system bin/"gifski", "-o", "out.gif", png, png
assert_predicate testpath/"out.gif", :exist?
refute_predicate (testpath/"out.gif").size, :zero?
end
end