homebrew-core/Formula/vips.rb

80 lines
2.3 KiB
Ruby

class Vips < Formula
desc "Image processing library"
homepage "https://github.com/libvips/libvips"
url "https://github.com/libvips/libvips/releases/download/v8.10.6/vips-8.10.6.tar.gz"
sha256 "2468088d958e0e2de1be2991ff8940bf45664a826c0dad12342e1804e2805a6e"
license "LGPL-2.1-or-later"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 arm64_big_sur: "733e12592fffe4af3030d8d4b41021ba6a0c1fa0b33d103157c10e700897c6b5"
sha256 big_sur: "243e3d395b4b01d4ead0745641a568a95ef7390135ac968e8bed2d02dc819499"
sha256 catalina: "1be6309e22aecaf7f0944fef1f4082d3b30280c0e8d4e93b0fe4e03606873cfe"
sha256 mojave: "05aa7f2bbbfa95a7475ac344f3d94f472d47fb0fcd357e113cbe6f6a4f233194"
end
depends_on "pkg-config" => :build
depends_on "cfitsio"
depends_on "fftw"
depends_on "fontconfig"
depends_on "gettext"
depends_on "giflib"
depends_on "glib"
depends_on "imagemagick"
depends_on "libexif"
depends_on "libgsf"
depends_on "libheif"
depends_on "libimagequant"
depends_on "libmatio"
depends_on "libpng"
depends_on "librsvg"
depends_on "libspng"
depends_on "libtiff"
depends_on "little-cms2"
depends_on "mozjpeg"
depends_on "openexr"
depends_on "openslide"
depends_on "orc"
depends_on "pango"
depends_on "poppler"
depends_on "webp"
uses_from_macos "zlib"
on_linux do
depends_on "gobject-introspection"
end
def install
# mozjpeg needs to appear before libjpeg, otherwise it's not used
ENV.prepend_path "PKG_CONFIG_PATH", Formula["mozjpeg"].opt_lib/"pkgconfig"
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--with-magick
]
system "./configure", *args
system "make", "install"
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