I've downloaded the patch in the first link, applied to GraphicsMagick sources and then downloaded octave 3.40. but I'm not able to compile it
since it now says that my BLAS libraries are not compatible with the fortran compiler I have (I installed the binaries of gfortran found here
http://hpc.sourceforge.net/ , before installing it, it was saying that there was no fortran compiler).
Any clue? If I try to install octave from macports it tries to refetch graphicsmagick so I guess that is not the way to go.