Skip to content

Commit

Permalink
imagemagick: options for exr, hdri, quantum depth
Browse files Browse the repository at this point in the history
Closes Homebrew#6715.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
  • Loading branch information
allesblinkt authored and mistydemeo committed Feb 1, 2012
1 parent 991e240 commit ef755ec
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion Library/Formula/imagemagick.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,10 +21,31 @@ def disable_openmp?
ARGV.include? '--disable-openmp' ARGV.include? '--disable-openmp'
end end


def enable_hdri?
ARGV.include? '--enable-hdri'
end

def magick_plus_plus? def magick_plus_plus?
ARGV.include? '--with-magick-plus-plus' ARGV.include? '--with-magick-plus-plus'
end end


def use_exr?
ARGV.include? '--use-exr'
end

def quantum_depth_8?
ARGV.include? '--with-quantum-depth-8'
end

def quantum_depth_16?
ARGV.include? '--with-quantum-depth-16'
end

def quantum_depth_32?
ARGV.include? '--with-quantum-depth-32'
end


class Imagemagick < Formula class Imagemagick < Formula
# Using an unofficial Git mirror to work around: # Using an unofficial Git mirror to work around:
# * Stable tarballs disappearing # * Stable tarballs disappearing
Expand All @@ -49,6 +70,8 @@ class Imagemagick < Formula


depends_on 'libwmf' if use_wmf? depends_on 'libwmf' if use_wmf?
depends_on 'liblqr' if use_lqr? depends_on 'liblqr' if use_lqr?
depends_on 'openexr' if use_exr?



def skip_clean? path def skip_clean? path
path.extname == '.la' path.extname == '.la'
Expand All @@ -59,8 +82,13 @@ def options
['--with-ghostscript', 'Compile against ghostscript (not recommended.)'], ['--with-ghostscript', 'Compile against ghostscript (not recommended.)'],
['--use-wmf', 'Compile with libwmf support.'], ['--use-wmf', 'Compile with libwmf support.'],
['--use-lqr', 'Compile with liblqr support.'], ['--use-lqr', 'Compile with liblqr support.'],
['--use-exr', 'Compile with openexr support.'],
['--disable-openmp', 'Disable OpenMP.'], ['--disable-openmp', 'Disable OpenMP.'],
['--with-magick-plus-plus', 'Compile with C++ interface.'] ['--enable-hdri', 'Compile with HDRI support enabled'],
['--with-magick-plus-plus', 'Compile with C++ interface.'],
['--with-quantum-depth-8', 'Compile with a quantum depth of 8 bit'],
['--with-quantum-depth-16', 'Compile with a quantum depth of 16 bit'],
['--with-quantum-depth-32', 'Compile with a quantum depth of 32 bit'],
] ]
end end


Expand All @@ -81,6 +109,17 @@ def install
args << "--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts" \ args << "--with-gs-font-dir=#{HOMEBREW_PREFIX}/share/ghostscript/fonts" \
unless ghostscript_srsly? or ghostscript_fonts? unless ghostscript_srsly? or ghostscript_fonts?
args << "--without-magick-plus-plus" unless magick_plus_plus? args << "--without-magick-plus-plus" unless magick_plus_plus?
args << "--enable-hdri=yes" if enable_hdri?

if quantum_depth_32?
quantum_depth = 32
elsif quantum_depth_16?
quantum_depth = 16
elsif quantum_depth_8?
quantum_depth = 8
end

args << "--with-quantum-depth=#{quantum_depth}" if quantum_depth


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

0 comments on commit ef755ec

Please sign in to comment.