homebrew-core/Formula/vips.rb

95 lines
2.7 KiB
Ruby

class Vips < Formula
desc "Image processing library"
homepage "https://github.com/libvips/libvips"
url "https://github.com/libvips/libvips/releases/download/v8.12.2/vips-8.12.2.tar.gz"
sha256 "565252992aff2c7cd10c866c7a58cd57bc536e03924bde29ae0f0cb9e074010b"
license "LGPL-2.1-or-later"
revision 1
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 arm64_monterey: "202e3c8c52238852805b826388dd7a132b4c27105fde9a19e563a04b65f93064"
sha256 arm64_big_sur: "1fc16d91462fb374a545991749e9cb94e866099b97083efb02d291d027380b35"
sha256 monterey: "e5bc07add0a83ed23b0aecf3e69ceb1bbc93c857c05140848cb25d16e1570da4"
sha256 big_sur: "6abc2b1acd756abc58782d62560d123f4e1fed932fb50310091dfa4f786967ab"
sha256 catalina: "7d6ffbd280f9496bd282706c429bf6d59e9cc8992c4dbead8e8bf8de790bf38e"
sha256 x86_64_linux: "dd9a6a36be1c4079b5422e99a51218e74b7f0bd9ecc77508bd5c82238ce3b0c2"
end
depends_on "pkg-config" => :build
depends_on "cairo"
depends_on "cfitsio"
depends_on "cgif"
depends_on "fftw"
depends_on "fontconfig"
depends_on "freetype"
depends_on "gdk-pixbuf"
depends_on "gettext"
depends_on "glib"
depends_on "harfbuzz"
depends_on "hdf5"
depends_on "imagemagick"
depends_on "imath"
depends_on "jpeg-xl"
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 "libxml2"
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"
on_linux do
depends_on "gcc"
depends_on "gobject-introspection"
end
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"
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
]
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