Patches: Browse | Submit New | Admin

[#26150] Seamless support for MinGW

Date:
2009-06-05 21:55
Priority:
3
Submitted By:
Chauk-Mean Proum (chauk-mean)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Seamless support for MinGW

Detailed description
Hi,

With recent MSYS (1.0.11-rc1), building ImageMagick on MinGW provides Magick-config script utility. This enables a seamless
support of RMagick on MinGW. The only thing to take care is to call Magick-config from bash.exe. The provided patch
for extconf.rb (for RMagick 2.9.2) does the job.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-11-19 02:04
Sender: Roger Pack

did you have to install imagemagick from scratch in order for
this to work?
-r
Date: 2009-09-03 19:30
Sender: Chauk-Mean Proum

In addition to the pastie URL, the patch for RMagick-2.11.0
can also be found as an attached file.
Date: 2009-09-03 19:24
Sender: Chauk-Mean Proum

Hi,
Could you please integrate the patch to support MinGW.
This becomes really tedious to modify the extconf.rb file
for each successive release of RMagick (2.10, 2.11).

The patch for RMagick-2.11 can be found here :
http://pastie.org/604828

Thanks in advance.
Date: 2009-06-07 16:16
Sender: Tim Hunter

Thanks. Timely, too. I'm about to start working on a version
of RMagick that uses Luis Lavena's rake-compiler with Ruby 1.9.1.
Date: 2009-06-05 22:22
Sender: Chauk-Mean Proum

The copy/paste in the small text box has added artificial
new lines. I hope that you will be able to use it.
Date: 2009-06-05 22:21
Sender: Chauk-Mean Proum

The copy/paste in the small text box has added artificial
new lines. I hope that you will be able to use it.
Date: 2009-06-05 22:08
Sender: Chauk-Mean Proum

I've not been able to attach the patch file.
Below is a copy/paste of this patch.

52a53,59
>   
>   if RUBY_PLATFORM =~ /mingw/
>     shell = "bash.exe"
>   else
>     shell = ""
>   end
>   
58,59c65,66
<          vers = `#{file} --version`.chomp.strip
<          prefix = `#{file} --prefix`.chomp.strip
---
>          vers = `#{shell} #{file} --version`.chomp.strip
>          prefix = `#{shell} #{file} --prefix`.chomp.strip
135a143,148
>   
>   if RUBY_PLATFORM =~ /mingw/
>     magick_config = 'bash.exe Magick-config'
>   else
>     magick_config = 'Magick-config'
>   end
139c152
<     version = `Magick-config
--version`.chomp.tr(".","").to_i
---
>     version = `#{magick_config}
--version`.chomp.tr(".","").to_i
146c159
<     version = `Magick-config
--version`.chomp.tr(".","").to_i
---
>     version = `#{magick_config}
--version`.chomp.tr(".","").to_i
165c178
<   $magick_version = `Magick-config --version`.chomp
---
>   $magick_version = `#{magick_config} --version`.chomp
169c182
<     not (`Magick-config --version`["HDRI"])
---
>     not (`#{magick_config} --version`["HDRI"])
177,180c190,193
<   $CFLAGS     = ENV["CFLAGS"].to_s   + "
" +
`Magick-config --cflags`.chomp
<   $CPPFLAGS   = ENV["CPPFLAGS"].to_s + "
" +
`Magick-config --cppflags`.chomp
<   $LDFLAGS    = ENV["LDFLAGS"].to_s  + "
" +
`Magick-config --ldflags`.chomp
<   $LOCAL_LIBS = ENV["LIBS"].to_s     + "
" +
`Magick-config --libs`.chomp
---
>   $CFLAGS     = ENV["CFLAGS"].to_s   + "
" +
`#{magick_config} --cflags`.chomp
>   $CPPFLAGS   = ENV["CPPFLAGS"].to_s + "
" +
`#{magick_config} --cppflags`.chomp
>   $LDFLAGS    = ENV["LDFLAGS"].to_s  + "
" +
`#{magick_config} --ldflags`.chomp
>   $LOCAL_LIBS = ENV["LIBS"].to_s     + "
" +
`#{magick_config} --libs`.chomp

Attached Files:

Name Description Download
extconf.rb.patch patch file Download

Changes:

Field Old Value Date By
File Added4707: extconf.rb.patch2009-09-03 19:24chauk-mean