homebrew-core/Formula/imagemagick.rb
2019-03-26 00:03:43 +08:00

76 lines
2.4 KiB
Ruby

class Imagemagick < 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-7.0.8-35.tar.xz"
mirror "https://www.imagemagick.org/download/ImageMagick-7.0.8-35.tar.xz"
sha256 "898c3a87c15c2d84fce5edc2e24c56cdfe9482d0a9b2cb67f3740f5ac1380daf"
head "https://github.com/ImageMagick/ImageMagick.git"
bottle do
sha256 "94c9a0469ef2c6f1a17e4534d9a335020f14e27c3730bf530c2455445ab78439" => :mojave
sha256 "b7dd1e319f73b284f55fbc36a65e98e07354464aecae976ae1981144dec94179" => :high_sierra
sha256 "863b3b77064af2fe0422297597baee08c6f0656845d6bed47e37b63664b4131e" => :sierra
end
depends_on "pkg-config" => :build
depends_on "freetype"
depends_on "jpeg"
depends_on "libheif"
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"
skip_clean :la
def install
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
--without-gslib
--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts
--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
end
end