homebrew-core/Formula/imagemagick.rb

84 lines
2.5 KiB
Ruby

class Imagemagick < Formula
desc "Tools and libraries to manipulate images in many formats"
homepage "https://www.imagemagick.org/"
url "https://dl.bintray.com/homebrew/mirror/ImageMagick-7.0.10-24.tar.xz"
mirror "https://www.imagemagick.org/download/releases/ImageMagick-7.0.10-24.tar.xz"
sha256 "8f8d4715ac995aaae14dc1567608a05833764c13cd0c16cbac2a3a8e229e7f43"
license "ImageMagick"
head "https://github.com/ImageMagick/ImageMagick.git"
bottle do
sha256 "e4ff7a97919d4113706132b138abfad1dbe10973b2a1c94f5562b9cdfca9ed38" => :catalina
sha256 "b035e1d0706fdce526d8aaf43733415b6302f4042423cefddb35bf4be20bd17d" => :mojave
sha256 "2bb101df6142695a1c8f08e3ffdb40fde3290bcfe6ed0390192b6165b65221b4" => :high_sierra
end
depends_on "pkg-config" => :build
depends_on "freetype"
depends_on "ghostscript"
depends_on "jpeg"
depends_on "libheif"
depends_on "liblqr"
depends_on "libomp"
depends_on "libpng"
depends_on "libtiff"
depends_on "libtool"
depends_on "little-cms2"
depends_on "openexr"
depends_on "openjpeg"
depends_on "webp"
depends_on "xz"
uses_from_macos "bzip2"
uses_from_macos "libxml2"
skip_clean :la
def install
# Avoid references to shim
inreplace Dir["**/*-config.in"], "@PKG_CONFIG@", Formula["pkg-config"].opt_bin/"pkg-config"
args = %W[
--disable-osx-universal-binary
--prefix=#{prefix}
--disable-dependency-tracking
--disable-silent-rules
--disable-opencl
--enable-shared
--enable-static
--with-freetype=yes
--with-modules
--with-openjp2
--with-openexr
--with-webp=yes
--with-heic=yes
--with-gslib
--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts
--with-lqr
--without-fftw
--without-pango
--without-x
--without-wmf
--enable-openmp
ac_cv_prog_c_openmp=-Xpreprocessor\ -fopenmp
ac_cv_prog_cxx_openmp=-Xpreprocessor\ -fopenmp
LDFLAGS=-lomp
]
# 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
assert_match "Helvetica", shell_output("#{bin}/identify -list font")
end
end