Fixing imagemagick on mac osx lion 10.7 with MacPorts
After installing lion, imagemagick started playing up. No surprises there. The problem is that Imagemagick relies on Perl 5.8 which wasn’t installing correctly on lion due to some internal changes.
This is all laid out in the ticket, but I thought I might be able to confirm it.
So here’s how I got it back up and running again. I’ve been on MacPorts for a long time, I know Homebrew is shinier, but I’m too scared to start scratch, so rather push on with Ports.
- Upgraded to the newest MacPorts using their click installer from here: http://www.macports.org/install.php
- Copied this patch from the MacPorts site: https://trac.macports.org/attachment/ticket/30032/patch-Configure-libc.diff into ‘/opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/perl5.8/files’ as specified in this ticket: https://trac.macports.org/ticket/30032
Now clean and install Perl 5.8
sudo port clean perl5.8
sudo port install perl5.8
That should allow you to properly install the Perl 5.8 port.
Then go for
sudo port install imagemagick
Then your laptop or desktop’s fan is going to try and fly to the moon for a few minutes, assuming you have one. It’s time for a coffee now as all the packages are installed. Seriously, this will take a while.
Then go and test a project which uses imagemagick under the hood like paperclip or carrierwave.
PS. The patchfile contents should look like this … not just the green bits … ;)
Index: Configure
===================================================================
--- Configure 2011-07-24 09:17:26.000000000 -0700
+++ /Users/jcm/Configure 2011-07-24 09:18:11.000000000 -0700
@@ -7455,6 +7455,10 @@
. ./getfile
libc="$ans"
+# Adding distributed libc madness on osx
+distr_libc=`otool -L /usr/lib/libc.dylib | awk '{print $1}'`
+libc="$libc $distr_libc"
+
echo " "
echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
set X `cat libnames`
5 Notes/ Hide
-
82times liked this
-
matthewling posted this