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://www.imagemagick.org/"
# Please always keep the Homebrew 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://dl.bintray.com/homebrew/mirror/imagemagick%406-6.9.12-2.tar.xz"
mirror "https://www.imagemagick.org/download/releases/ImageMagick-6.9.12-2.tar.xz"
sha256 "4aab83830cd8f79d67a45f7f2b3277bd54230cdf4b07e303a918950fe32faa9d"
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: "48fc48baf32becfab4f7398c459fdc534bb932b08b03faae2b2207f7c19bf6e0"
sha256 big_sur: "4ea4cb6d4dcc99c4e1f1a57eeafdbcd6201227537cacacb1a59606aa1b2b00ad"
sha256 catalina: "739e313804179478d2bb781ad9e3491fff837a3f1983a25d8dccac1be79dbd11"
sha256 mojave: "8908e06e41b8ec9173e8d32390e05146de9cea460057ded6cbf679187b043786"
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