homebrew-core/Formula/vips.rb

83 lines
2.6 KiB
Ruby

class Vips < Formula
desc "Image processing library"
homepage "https://github.com/libvips/libvips"
url "https://github.com/libvips/libvips/releases/download/v8.13.2/vips-8.13.2.tar.gz"
sha256 "41db5ed40a22ad50f8f37782e1ae5bac76f9f2e0b5731728f97c55f245f1da2a"
license "LGPL-2.1-or-later"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 arm64_monterey: "50d0846e4253405f2edec6ef27cf427134bc5955382ae99391460b409c147670"
sha256 arm64_big_sur: "838d872c7a74c0f9504f02a3e1773b1627943e02b044ed0d592ddddd6af4dc71"
sha256 monterey: "a82668ced78c9ad7a3362462ed28311a825c7464b3c53e004447b66b5b0d01e2"
sha256 big_sur: "cf623736d3269700dac8873c4f953c3489bbe0c5a4bf4ebae53b0fce18446b2a"
sha256 catalina: "d4ac8ae6badf2c76d73ee8e80b20c90bfd55dbef3c419e95637a1137f3e602d3"
sha256 x86_64_linux: "637131627c0831e621684882b1ed82d191750dd0dab3bbd46ec8280d3f8f4476"
end
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "cairo"
depends_on "cfitsio"
depends_on "cgif"
depends_on "fftw"
depends_on "fontconfig"
depends_on "gettext"
depends_on "glib"
depends_on "imagemagick"
depends_on "jpeg-xl"
depends_on "libexif"
depends_on "libgsf"
depends_on "libheif"
depends_on "libimagequant"
depends_on "libmatio"
depends_on "librsvg"
depends_on "libspng"
depends_on "libtiff"
depends_on "little-cms2"
depends_on "mozjpeg"
depends_on "openexr"
depends_on "openjpeg"
depends_on "openslide"
depends_on "orc"
depends_on "pango"
depends_on "poppler"
depends_on "webp"
uses_from_macos "expat"
uses_from_macos "zlib"
fails_with gcc: "5"
def install
# mozjpeg needs to appear before libjpeg, otherwise it's not used
ENV.prepend_path "PKG_CONFIG_PATH", Formula["mozjpeg"].opt_lib/"pkgconfig"
mkdir "build" do
system "meson", *std_meson_args, ".."
system "ninja"
system "ninja", "install"
end
end
test do
system "#{bin}/vips", "-l"
cmd = "#{bin}/vipsheader -f width #{test_fixtures("test.png")}"
assert_equal "8", shell_output(cmd).chomp
# --trellis-quant requires mozjpeg, vips warns if it's not present
cmd = "#{bin}/vips jpegsave #{test_fixtures("test.png")} #{testpath}/test.jpg --trellis-quant 2>&1"
assert_equal "", shell_output(cmd)
# [palette] requires libimagequant, vips warns if it's not present
cmd = "#{bin}/vips copy #{test_fixtures("test.png")} #{testpath}/test.png[palette] 2>&1"
assert_equal "", shell_output(cmd)
end
end