Image::Magick 6.77 fails to install on windows [with patch]
Posted: 2012-06-09T15:09:08-07:00
I installed this version of ImageMagick: ImageMagick-6.7.7-6-Q16-windows-dll.exe
Then i tried to install Image::Magick via CPAN, but it was still unable to find the header files.
On inspection with procmon it turned out that it was trying to look for them like this: C:\Program Files (x86)\include\magick\MagickCore.h
Inspection of Makefile.PL turned out that it was trying to find the IM dir based on this line:
Using this kind of code:
The following diff fixes that problem:
Sadly this fixes not all the problems though, since all the tests still fail due to mismatches in the signatures.
Then i tried to install Image::Magick via CPAN, but it was still unable to find the header files.
On inspection with procmon it turned out that it was trying to look for them like this: C:\Program Files (x86)\include\magick\MagickCore.h
Inspection of Makefile.PL turned out that it was trying to find the IM dir based on this line:
Code: Select all
Path: C:\Program Files (x86)\ImageMagick-6.7.7-Q16\configure.xml
Code: Select all
push @l, catfile($dirpath,'..','lib');
Code: Select all
d96061efca0ff6cb104584682eccce20721aa851
Makefile.PL | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Makefile.PL b/Makefile.PL
index 887c5ed..a250698 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -44,12 +44,15 @@ sub AutodetectWin32gcc {
my (@l,@b,@i) = ( (),(),() );
# try to detect 'lib' dir
+ push @l, catfile($dirpath,'lib');
push @l, catfile($dirpath,'..','lib');
push @l, catfile($dirpath,'..','..','lib');
push @l, catfile($dirpath,'..','..','..','lib');
foreach (@l) { push @libdir, $_ if (-d $_) };
# try to detect 'bin' dir
+ push @b, catfile($dirpath);
+ push @b, catfile($dirpath,'bin');
push @b, catfile($dirpath,'..');
push @b, catfile($dirpath,'..','bin');
push @b, catfile($dirpath,'..','..');
@@ -59,6 +62,8 @@ sub AutodetectWin32gcc {
foreach (@b) { push @bindir, $_ if (-e "$_/convert.exe" || -e "$_/identify.exe") };
# try to detect 'include' dir
+ push @i, catfile($dirpath,'include');
+ push @i, catfile($dirpath,'include','ImageMagick');
push @i, catfile($dirpath,'..','include');
push @i, catfile($dirpath,'..','include','ImageMagick');
push @i, catfile($dirpath,'..','..','include');