Skip to content

Commit

Permalink
Fixed installation issue due to newer versions of ruby and imagemagick
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaiza committed Feb 1, 2013
1 parent 4c3d645 commit b8e690a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions ext/RMagick/extconf.rb
Expand Up @@ -125,7 +125,8 @@ def check_partial_imagemagick_versions()
if RUBY_PLATFORM !~ /mswin|mingw/

# Check for compiler. Extract first word so ENV['CC'] can be a program name with arguments.
cc = (ENV["CC"] or Config::CONFIG["CC"] or "gcc").split(' ').first
config = defined?(RbConfig) ? ::RbConfig : ::Config
cc = (ENV["CC"] or config::CONFIG["CC"] or "gcc").split(' ').first
unless find_executable(cc)
exit_failure "No C compiler found in ${ENV['PATH']}. See mkmf.log for details."
end
Expand Down Expand Up @@ -204,7 +205,7 @@ def check_partial_imagemagick_versions()

if RUBY_PLATFORM !~ /mswin|mingw/

unless have_library("MagickCore", "InitializeMagick", headers) || have_library("Magick", "InitializeMagick", headers) || have_library("Magick++","InitializeMagick",headers)
unless `Magick-config --libs`[/\bl\s*(MagickCore|Magick)\b/]
exit_failure "Can't install RMagick #{RMAGICK_VERS}. " +
"Can't find the ImageMagick library or one of the dependent libraries. " +
"Check the mkmf.log file for more detailed information.\n"
Expand Down
2 changes: 1 addition & 1 deletion setup.rb
Expand Up @@ -784,7 +784,7 @@ def ToplevelInstaller.load_rbconfig
else
require 'rbconfig'
end
::Config::CONFIG
defined?(RbConfig) ? ::RbConfig::CONFIG : ::Config::CONFIG
end

def initialize(ardir_root, config)
Expand Down
16 changes: 9 additions & 7 deletions uninstall.rb
Expand Up @@ -51,18 +51,20 @@ def rmdir(dir, no_check=false)
end

require rbconfig # get specified/default rbconfig.rb
config = defined?(RbConfig) ? ::RbConfig : ::Config
version = config::CONFIG['ruby_version']
arch = config::CONFIG['arch']

version = ::Config::CONFIG['ruby_version']
arch = ::Config::CONFIG['arch']

prefix ||= ::Config::CONFIG['prefix']
site_ruby ||= ::Config::CONFIG['sitelibdir']
so_dir ||= ::Config::CONFIG['sitearchdir']
prefix ||= config::CONFIG['prefix']
site_ruby ||= config::CONFIG['sitelibdir']
so_dir ||= config::CONFIG['sitearchdir']
doc_dir ||= File.join(prefix, 'share', 'RMagick')
dlext = ::Config::CONFIG['DLEXT']
dlext = config::CONFIG['DLEXT']

FileUtils.safe_unlink File.join(site_ruby, 'RMagick.rb'), :verbose => true
FileUtils.safe_unlink File.join(so_dir, 'RMagick.' + dlext), :verbose => true
puts site_ruby
puts doc_dir

rmdir File.join(site_ruby, 'rvg'), true
rmdir File.join(doc_dir, 'ex', 'images')
Expand Down

0 comments on commit b8e690a

Please sign in to comment.