2017-11-03 22:20:00 +00:00
|
|
|
class Gifski < Formula
|
|
|
|
desc "Highest-quality GIF encoder based on pngquant"
|
|
|
|
homepage "https://gif.ski/"
|
2018-03-07 05:48:17 +00:00
|
|
|
url "https://github.com/ImageOptim/gifski/archive/0.8.2.tar.gz"
|
|
|
|
sha256 "d7bf1b6515c273b822c94fc78e6d10fbc45d444a04bc3487fe3e799d6aa836e0"
|
2018-04-21 15:02:43 +00:00
|
|
|
revision 1
|
2017-11-03 22:20:00 +00:00
|
|
|
|
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"
|
|
|
|
|
2017-11-03 22:20:00 +00:00
|
|
|
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"
|
2017-11-03 22:20:00 +00:00
|
|
|
|
|
|
|
def install
|
2018-03-22 20:13:31 +00:00
|
|
|
args = ["--release"]
|
2018-04-21 15:02:43 +00:00
|
|
|
args << "--features=openmp" if build.with? "openmp"
|
2018-03-22 20:13:31 +00:00
|
|
|
system "cargo", "build", *args
|
2017-11-03 22:20:00 +00:00
|
|
|
bin.install "target/release/gifski"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2018-04-21 15:02:43 +00:00
|
|
|
png = test_fixtures("test.png")
|
|
|
|
system bin/"gifski", "-o", "out.gif", png, png
|
2017-11-03 22:20:00 +00:00
|
|
|
assert_predicate testpath/"out.gif", :exist?
|
|
|
|
refute_predicate (testpath/"out.gif").size, :zero?
|
|
|
|
end
|
|
|
|
end
|