102 lines
3.6 KiB
Ruby
102 lines
3.6 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-22.tar.xz"
|
|
mirror "https://www.imagemagick.org/download/ImageMagick-7.0.8-22.tar.xz"
|
|
sha256 "aed08cd853a193d3f7d402125e362241561ab6fc2b01b4a44dc268c4ea208dde"
|
|
head "https://github.com/ImageMagick/ImageMagick.git"
|
|
|
|
bottle do
|
|
sha256 "b798c2e4ca87a7d1cd5a0ef495c1954b9b3b692f399806a19b7fbc2ae8a40f83" => :mojave
|
|
sha256 "796f73e08e9ec330872c8e07e448f3519340432612d9b8e251ae36d7e32dc8a5" => :high_sierra
|
|
sha256 "5e436e2a0b5a41de8f187f05c305c0ca8b9e94f2891e6f7dd2408351209152bc" => :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-perl", "Compile with PerlMagick"
|
|
|
|
deprecated_option "enable-hdri" => "with-hdri"
|
|
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 "little-cms2"
|
|
depends_on "openjpeg"
|
|
depends_on "webp"
|
|
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 "openexr" => :optional
|
|
depends_on "pango" => :optional
|
|
depends_on "perl" => :optional
|
|
depends_on :x11 => :optional
|
|
|
|
skip_clean :la
|
|
|
|
def install
|
|
args = %W[
|
|
--disable-osx-universal-binary
|
|
--prefix=#{prefix}
|
|
--disable-dependency-tracking
|
|
--disable-silent-rules
|
|
--disable-opencl
|
|
--disable-openmp
|
|
--enable-shared
|
|
--enable-static
|
|
--with-freetype=yes
|
|
--with-modules
|
|
--with-openjp2
|
|
--with-webp=yes
|
|
]
|
|
|
|
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 << "--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
|