67 lines
2.0 KiB
Ruby
67 lines
2.0 KiB
Ruby
class Vips < Formula
|
|
desc "Image processing library"
|
|
homepage "https://github.com/libvips/libvips"
|
|
url "https://github.com/libvips/libvips/releases/download/v8.9.1/vips-8.9.1.tar.gz"
|
|
sha256 "45633798877839005016c9d3494e98dee065f5cb9e20f4552d3b315b8e8bce91"
|
|
|
|
bottle do
|
|
rebuild 1
|
|
sha256 "b70ae725cab853130ac9a1c14873a8cb4929a4ca8d5ddbfdb65908cb345fe74a" => :catalina
|
|
sha256 "62b0f72d537fe8b92efaaa37563f6840caafa16f89c602a89a4b560dbb4c5fa2" => :mojave
|
|
sha256 "4558e29fb5b4ab515e3d21b8d116edead14c847b3fd3f306a47b93e9440e94fd" => :high_sierra
|
|
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 "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"
|
|
|
|
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
|