Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

graphicsmagick: Fix some options #22929

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 5 additions & 9 deletions Library/Formula/graphicsmagick.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Graphicsmagick < Formula
option 'with-quantum-depth-16', 'Compile with a quantum depth of 16 bit'
option 'with-quantum-depth-32', 'Compile with a quantum depth of 32 bit'
option 'without-magick-plus-plus', 'disable build/install of Magick++'
option 'with-svg', 'Compile with svg support'

depends_on :libltdl

Expand All @@ -25,11 +26,7 @@ class Graphicsmagick < Formula
depends_on 'little-cms2' => :optional
depends_on 'jasper' => :optional
depends_on 'libwmf' => :optional
depends_on 'librsvg' => :optional
depends_on 'liblqr' => :optional
depends_on 'openexr' => :optional
depends_on 'ghostscript' => :optional
depends_on 'webp' => :optional

opoo '--with-ghostscript is not recommended' if build.with? 'ghostscript'
if build.with? 'openmp' and (MacOS.version == 10.5 or ENV.compiler == :clang)
Expand All @@ -54,11 +51,9 @@ def install
"--with-modules"]

args << "--disable-openmp" unless build.include? 'enable-openmp'
args << "--disable-opencl" if build.include? 'disable-opencl'
args << "--without-gslib" unless build.with? 'ghostscript'
args << "--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts" unless build.with? 'ghostscript'
args << "--without-magick-plus-plus" if build.without? 'magick-plus-plus'
args << "--enable-hdri=yes" if build.include? 'enable-hdri'

if build.with? 'quantum-depth-32'
quantum_depth = 32
Expand All @@ -69,10 +64,11 @@ def install
end

args << "--with-quantum-depth=#{quantum_depth}" if quantum_depth
args << "--with-rsvg" if build.with? 'librsvg'
args << "--without-x" unless build.with? 'x11'
args << "--with-freetype=yes" if build.with? 'freetype'
args << "--with-webp=yes" if build.include? 'webp'
args << "--without-ttf" if build.without? 'freetype'
args << "--without-xml" unless build.with? 'svg'
args << "--without-lcms" unless build.with? 'little-cms'
args << "--without-lcms2" unless build.with? 'little-cms2'

# versioned stuff in main tree is pointless for us
inreplace 'configure', '${PACKAGE_NAME}-${PACKAGE_VERSION}', '${PACKAGE_NAME}'
Expand Down