homebrew-core/Formula/imagemagick@6.rb

80 lines
2.5 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.11-29.tar.xz"
mirror "https://www.imagemagick.org/download/releases/ImageMagick-6.9.11-29.tar.xz"
sha256 "a26851d223fac5384ba030aeccd78f14938c32db34533e32f58f0c4c154602e9"
license "ImageMagick"
head "https://github.com/imagemagick/imagemagick6.git"
livecheck do
url "https://www.imagemagick.org/download/"
regex(/href=.*?ImageMagick[._-]v?(6(?:\.\d+)+(?:-\d+)?)\.t/i)
end
bottle do
sha256 "7a8f75945938003f29e5e40f6d03341b87c491391f3bca1c8dfd4a3c261d8202" => :catalina
sha256 "e88dc7a085268dc3a97544f3a430d534571215a2af49a62b7dc65692be3f7719" => :mojave
sha256 "fa9721c12d0e1dce885eb2e99629821ad8c812cc80dc4c1b79d308cb26c0f69d" => :high_sierra
end
keg_only :versioned_formula
depends_on "pkg-config" => :build
depends_on "freetype"
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
--without-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_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