homebrew-core/Formula/imagemagick@6.rb

79 lines
2.5 KiB
Ruby

class ImagemagickAT6 < Formula
desc "Tools and libraries to manipulate images in many formats"
homepage "https://legacy.imagemagick.org/"
url "https://www.imagemagick.org/download/releases/ImageMagick-6.9.12-22.tar.xz"
sha256 "117e877f84c0881d42761aa29ae0ae8e1c73c8d772604d58be723b78e8023c3f"
license "ImageMagick"
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: "00a68448bde33db92f9a4c1ed0a3763380e2344a42835ea921b735b805c78e11"
sha256 big_sur: "4e3b02362059c3e4d66738effc8e7cbb1130bf9f90ab596273e511e5b02cce0d"
sha256 catalina: "e8f656a97171809c2f990a608e694dd8298baa01b5b62aeec8b46ac596465294"
sha256 mojave: "43d0f1ab0b603adc801ecf13d0f9949e07933dd1d45c12e727bbb5739f5336e0"
sha256 x86_64_linux: "179a5b3d5a7f77ef5944f9b4826a342b8666dcef25850bc9a4349f66f17d0edf"
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