127 lines
4.2 KiB
Ruby
127 lines
4.2 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-12.tar.xz"
|
|
mirror "https://www.imagemagick.org/download/ImageMagick-7.0.8-12.tar.xz"
|
|
sha256 "48df5877fe85603940310fe5c811a89af416882b60379918a95dcd4de6582b55"
|
|
head "https://github.com/ImageMagick/ImageMagick.git"
|
|
|
|
bottle do
|
|
sha256 "23b2c045087eac2c8f0535c8f469f5f2f48f0a16c2e0fb83b1dc783d7dfcc80e" => :mojave
|
|
sha256 "a2c78ec559ff121868b854da28fe58b68155a6fdde11c8ee24b1e48d6273a69e" => :high_sierra
|
|
sha256 "baf6c3ec3eac5bbd571a077ab0c509d6d5f4f8f83010e5db9c6dc76bdfcb6f7f" => :sierra
|
|
end
|
|
|
|
option "with-fftw", "Compile with FFTW support"
|
|
option "with-hdri", "Compile with HDRI support"
|
|
option "with-libheif", "Compile with HEIF support"
|
|
option "with-openmp", "Compile with OpenMP support"
|
|
option "with-perl", "Compile with PerlMagick"
|
|
option "with-zero-configuration", "Disables depending on XML configuration files"
|
|
|
|
deprecated_option "enable-hdri" => "with-hdri"
|
|
deprecated_option "with-gcc" => "with-openmp"
|
|
deprecated_option "with-jp2" => "with-openjpeg"
|
|
deprecated_option "with-libde265" => "with-libheif"
|
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "freetype"
|
|
depends_on "jpeg"
|
|
depends_on "libpng"
|
|
depends_on "libtiff"
|
|
depends_on "libtool"
|
|
depends_on "xz"
|
|
|
|
depends_on "fftw" => :optional
|
|
depends_on "fontconfig" => :optional
|
|
depends_on "ghostscript" => :optional
|
|
depends_on "libheif" => :optional
|
|
depends_on "liblqr" => :optional
|
|
depends_on "librsvg" => :optional
|
|
depends_on "libwmf" => :optional
|
|
depends_on "little-cms" => :optional
|
|
depends_on "little-cms2" => :optional
|
|
depends_on "openexr" => :optional
|
|
depends_on "openjpeg" => :optional
|
|
depends_on "pango" => :optional
|
|
depends_on "perl" => :optional
|
|
depends_on "webp" => :optional
|
|
depends_on :x11 => :optional
|
|
|
|
if build.with? "openmp"
|
|
depends_on "gcc"
|
|
fails_with :clang
|
|
end
|
|
|
|
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
|
|
]
|
|
|
|
if build.with? "openmp"
|
|
args << "--enable-openmp"
|
|
else
|
|
args << "--disable-openmp"
|
|
end
|
|
|
|
if build.with? "webp"
|
|
args << "--with-webp=yes"
|
|
else
|
|
args << "--without-webp"
|
|
end
|
|
|
|
if build.with? "openjpeg"
|
|
args << "--with-openjp2"
|
|
else
|
|
args << "--without-openjp2"
|
|
end
|
|
|
|
args << "--without-gslib" if build.without? "ghostscript"
|
|
args << "--with-perl" << "--with-perl-options='PREFIX=#{prefix}'" if build.with? "perl"
|
|
args << "--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts" if build.without? "ghostscript"
|
|
args << "--enable-hdri=yes" if build.with? "hdri"
|
|
args << "--without-fftw" if build.without? "fftw"
|
|
args << "--without-pango" if build.without? "pango"
|
|
args << "--with-rsvg" if build.with? "librsvg"
|
|
args << "--without-x" if build.without? "x11"
|
|
args << "--with-fontconfig=yes" if build.with? "fontconfig"
|
|
args << "--enable-zero-configuration" if build.with? "zero-configuration"
|
|
args << "--without-wmf" if build.without? "libwmf"
|
|
|
|
# versioned stuff in main tree is pointless for us
|
|
inreplace "configure", "${PACKAGE_NAME}-${PACKAGE_VERSION}", "${PACKAGE_NAME}"
|
|
system "./configure", *args
|
|
system "make", "install"
|
|
end
|
|
|
|
def caveats
|
|
s = <<~EOS
|
|
For full Perl support you may need to adjust your PERL5LIB variable:
|
|
export PERL5LIB="#{HOMEBREW_PREFIX}/lib/perl5/site_perl":$PERL5LIB
|
|
EOS
|
|
s if build.with? "perl"
|
|
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
|