diff --git a/Formula/graphicsmagick.rb b/Formula/graphicsmagick.rb index ae745944dc9..c5053a5872e 100644 --- a/Formula/graphicsmagick.rb +++ b/Formula/graphicsmagick.rb @@ -27,6 +27,7 @@ class Graphicsmagick < Formula option 'with-x', 'Compile with X11 support.' option 'without-magick-plus-plus', "Don't build C++ library." + depends_on 'libtool' => :build depends_on 'jpeg' => :recommended depends_on :libpng depends_on :x11 if build.include? 'with-x' @@ -48,12 +49,19 @@ class Graphicsmagick < Formula def install # versioned stuff in main tree is pointless for us inreplace 'configure', '${PACKAGE_NAME}-${PACKAGE_VERSION}', '${PACKAGE_NAME}' + # Homebrew cleans ".la" files from lib but this configure looks for them. + # Maintainers: This will be fixed in the next version >= 1.3.18 (probably) + # Then the next line will not be needed anymore. Further the --with-ltdl... flags + # further down can be removed then! + inreplace 'configure', 'if test -f "$with_ltdl_lib/libltdl.la"', 'if test -f "$with_ltdl_lib/libltdl.a"' args = ["--disable-dependency-tracking", "--prefix=#{prefix}", "--enable-shared", "--disable-static"] args << "--without-magick-plus-plus" if build.include? 'without-magick-plus-plus' args << "--disable-openmp" if MacOS.version == :leopard or not ENV.compiler == :gcc # libgomp unavailable + args << "--with-ltdl-include=#{Formula.factory('libtool').opt_prefix}/include" # avoid to ship it's own ltdl + args << "--with-ltdl-lib=#{Formula.factory('libtool').opt_prefix}/lib" # avoid to ship it's own ltdl args << "--with-gslib" if ghostscript_srsly? args << "--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts" \ unless ghostscript_fonts?