diff --git a/Formula/imagemagick.rb b/Formula/imagemagick.rb index 658affd40e..afc2eddc1b 100644 --- a/Formula/imagemagick.rb +++ b/Formula/imagemagick.rb @@ -57,6 +57,8 @@ class Imagemagick < Formula skip_clean :la def install + ENV.delete "PERL_MM_OPT" + args = %W[ --disable-osx-universal-binary --prefix=#{prefix} @@ -74,7 +76,7 @@ class Imagemagick < Formula end args << "--disable-opencl" if build.without? "opencl" args << "--without-gslib" if build.without? "ghostscript" - args << "--without-perl" if build.without? "perl" + 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 << "--without-magick-plus-plus" if build.without? "magick-plus-plus" args << "--enable-hdri=yes" if build.with? "hdri" @@ -83,7 +85,7 @@ class Imagemagick < Formula if build.with? "quantum-depth-32" quantum_depth = 32 - elsif build.with? "quantum-depth-16" + elsif build.with?("quantum-depth-16") || build.with?("perl") quantum_depth = 16 elsif build.with? "quantum-depth-8" quantum_depth = 8 @@ -110,14 +112,8 @@ class Imagemagick < Formula def caveats s = <<-EOS.undent - For full Perl support you must install the Image::Magick module from the CPAN. - https://metacpan.org/module/Image::Magick - - The version of the Perl module and ImageMagick itself need to be kept in sync. - If you upgrade one, you must upgrade the other. - - For this version of ImageMagick you should install - version #{version} of the Image::Magick Perl module. + 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