homebrew-core/Formula/imagemagick@6.rb

82 lines
2.6 KiB
Ruby

class ImagemagickAT6 < Formula
desc "Tools and libraries to manipulate images in many formats"
homepage "https://legacy.imagemagick.org/"
# Please always use a mirror as the primary URL as the
# ImageMagick site removes tarballs regularly which means we get issues
# unnecessarily and older versions of the formula are broken.
url "https://www.imagemagick.org/download/releases/ImageMagick-6.9.12-13.tar.xz"
sha256 "a72cb13e79a0878a6fd07f877a61e683c29b646d4fd3ca9ff1ddc042cae846c6"
license "ImageMagick"
revision 1
head "https://github.com/imagemagick/imagemagick6.git"
livecheck do
url "https://download.imagemagick.org/ImageMagick/download/"
regex(/href=.*?ImageMagick[._-]v?(6(?:\.\d+)+(?:-\d+)?)\.t/i)
end
bottle do
sha256 arm64_big_sur: "ee53c13fb9d6cbc73c23349e5cca9d26bb9452e0df8fbc573bcb39b58ab5808c"
sha256 big_sur: "76f2f81839072a2165f347f3650309883ae7c0bf1ce0e5dfd22ed0cc035fee35"
sha256 catalina: "9e74fe2e1e4fdd96105deddf75ea03b05f49799e3a9f58bee35414ba4cd7af25"
sha256 mojave: "6ed1aa22d2488cc26ddb97ece819033ab82a198e8fbed8284f772abef02cdb05"
end
keg_only :versioned_formula
depends_on "pkg-config" => :build
depends_on "freetype"
depends_on "ghostscript"
depends_on "jpeg"
depends_on "libpng"
depends_on "libtiff"
depends_on "libtool"
depends_on "little-cms2"
depends_on "openjpeg"
depends_on "webp"
depends_on "xz"
skip_clean :la
def install
# Avoid references to shim
inreplace Dir["**/*-config.in"], "@PKG_CONFIG@", Formula["pkg-config"].opt_bin/"pkg-config"
args = %W[
--enable-osx-universal-binary=no
--prefix=#{prefix}
--disable-dependency-tracking
--disable-silent-rules
--disable-opencl
--disable-openmp
--enable-shared
--enable-static
--with-freetype=yes
--with-modules
--with-webp=yes
--with-openjp2
--with-gslib
--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts
--without-fftw
--without-pango
--without-x
--without-wmf
]
# versioned stuff in main tree is pointless for us
inreplace "configure", "${PACKAGE_NAME}-${PACKAGE_BASE_VERSION}", "${PACKAGE_NAME}"
system "./configure", *args
system "make", "install"
end
test do
assert_match "PNG", shell_output("#{bin}/identify #{test_fixtures("test.png")}")
# Check support for recommended features and delegates.
features = shell_output("#{bin}/convert -version")
%w[Modules freetype jpeg png tiff].each do |feature|
assert_match feature, features
end
end
end