You are not logged in.

#1 2006-01-20 07:49:50

eyolf
Member
From: Copenhagen
Registered: 2005-11-29
Posts: 339
Website

Help needed with perl Image::Magick module

I don't know if this is the right place to post this (it might belong in the Newbie corner instead), but I'll give it a try.
I need an Image::Magick Perl module (and a load of other modules, which I have found) for a program I desperately need. Now, the only thing I know about Perl is that v. 6 is supposed to be coming out soon - apart from that, I'm blank. The installation is giving me some problems.
The installation guide is somewhat ambiguous. It says:

Next, edit Makefile.PL and change LIBS and INC to include the appropriate path information to the required libMagick library. You will also need paths to JPEG, PNG, TIFF, etc. delegates if they were included with your installed version of ImageMagick.

In the Makefile.PL which comes with the package, these two are defined:

   'INC'    => '-I../ -I.. -I/usr/include/freetype2 -I/usr/X11R6/include -I/usr/X11R6/include/X11 -I/usr/include/libxml2',
   
   'LIBS'    => ['-L/usr/lib -lMagick -L/usr/X11R6/lib64 -L/usr/lib -ltiff -ljpeg -lpng -ldpstk -ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lpthread -lm -lpthread'],

I haven't changed anything in them, because I haven't got the slightest idea what to change and to what. When I run the installation procedure ('perl Makefile.PL', 'make', and 'make test'), I get an error message during the test (but not before that). Here's the entire output from 'make test':

/bin/sh ../magick.sh PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/bzlib/*.t t/jng/*.t t/jpeg/*.t t/mpeg/*.t t/png/*.t t/ps/*.t t/tiff/*.t t/x/*.t t/xfig/*.t
/bin/sh: ../magick.sh: No such file or directory
make: *** [test_dynamic] Error 127 

There is mention somewhere that one might compile the module together with ImageMagick or with Perl, but I don't think I'm ready for that...
Is there anyone skilled in Perl who can tell me what it is that I'm doing wrong, alternatively make a package file...?

Offline

#2 2006-01-20 09:28:27

torindan2
Member
Registered: 2004-07-15
Posts: 74

Re: Help needed with perl Image::Magick module

As far as I know imagemagick package in arch already has perlmagick.
Try

pacman -Sy imagemagick; pacman -Ql imagemagick | grep perl

As about other modules you need...well, try to see maybe you already have them or there are packaged in arch.

pacman -Ss perl

Offline

#3 2006-01-20 09:46:27

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Help needed with perl Image::Magick module

torindan2 wrote:

As far as I know imagemagick package in arch already has perlmagick.

Indeed it has.

Have a look in the AUR as well - there are PKGBUILDs for plenty of perl modules there. I' ve built a few myself, so if you're stuck, let me know what you need and I'll have a go.

Offline

#4 2006-01-20 10:17:19

eyolf
Member
From: Copenhagen
Registered: 2005-11-29
Posts: 339
Website

Re: Help needed with perl Image::Magick module

I've found two other packages that I needed in AUR, but when I run the make test for the program that I need (fontlinge), it still complains that it can't find the Image::Magick module. I already have the imagemagick package installed, though, that's why I thought I'd have to install and compile the perl module separately.

Here's the output from the 'make test' for fontlinge:

 
make -C modules
make[1]: Entering directory `/home/eyolf/temp/src/fontlinge-2.0.1/modules'
make[2]: Entering directory `/home/eyolf/temp/src/fontlinge-2.0.1/modules/fontlinge'
make[2]: Leaving directory `/home/eyolf/temp/src/fontlinge-2.0.1/modules/fontlinge'
make[1]: Leaving directory `/home/eyolf/temp/src/fontlinge-2.0.1/modules'

./misc/check_for_modules.pl --skip-fontlinge-module


Ok.             Cwd 'abs_path'
Ok.             DBI
Ok.             User::pwent
Missing         Image::Magick
Ok.             Getopt::Long
Ok.             DBD::mysql
Ok.             File::Find
Ok.             File::Path
Ok.             ExtUtils::MakeMaker
Ok.             5.006
Ok.             bytes
Ok.             -utf8

It seems some required modules are missing.

How to get missing modules differs from _which_ module you are missing.

You can get modules like DBI from your distributions CD
or search the web for a RPM/DEB/...-file. www.cpan.org is always a good adress.

It may be a good idea to configure your perl-CPAN-Module as ROOT(!!!) by typing
perl -MCPAN -eshell

It is VERY important that you do not just 'su' to root but 'su -' on SuSE linux.

Once you have configured perl, you can install CPAN-modules by
perl -MCPAN -e 'install MODULENAME'

Other modules like Image::Magick require you to have the programs installed
they belong to.

If you are missing a 'fontlinge'-module, you have not installed this
program correctly. :-)

If the missing module begins with a '-' sign this module might miss,
because it is not possible to DEACTIVATE it, i.e. unwanted utf8 encoding.

make: *** [test] Error 255

If this makes sense to anyone, I'd be very happy. (For the record: Fontlinge is - or at least seems to be - the only decent font manager I've found for Linux. This seems to be a gaping, wide open black hole in the Linux world... There's gfontview, opcion, fontpage, and a couple of other minor apps that I've found, but none of them are functional for anything but the most basic operations, and on the whole, there doesn't seem to be much between the KDE font manager - which really makes one wonder how far the KDE people want to go in their emulation of windows... - and the font editor FontForge, which is great as a font editor, but overkill as a viewer, and hardly a manager.)

Offline

#5 2006-01-20 14:22:09

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Help needed with perl Image::Magick module

I've just tried it here, eyolf, and I'm getting the same error, even though I also have ImageMagick installed. As it happens, I've had this problem before with perl modules that were installed as part of larger apps - I've even raised a bug report on one occasion, which ended up being fixed without any real explanation.

I think the solution here is to build Image::Magick, as you were originally trying to do. I'll have a look at it later today.

Offline

#6 2006-01-21 00:59:07

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Help needed with perl Image::Magick module

Here's a PKGBUILD for you:

# Contributor: Tom K <tomk@runbox.com>

pkgname=perlmagick
pkgver=6.24
pkgrel=1
pkgdesc="Perl extension for calling ImageMagick's libMagick methods" 
url="http://search.cpan.org/~jcristy/PerlMagick-$pkgver/"
depends=('perl' 'imagemagick')
source=(http://search.cpan.org/CPAN/authors/id/J/JC/JCRISTY/PerlMagick-$pkgver.tar.gz)
md5sums=('cf86f823911b14d762141944afa39f37')

build() {
  cd $startdir/src/PerlMagick-$pkgver
  
  # Adjust include and library parameters
  sed -i 's#-I/usr/include/libxml2#-I/usr/include/libxml2 -I/usr/include/magick#;s#-lpng -ldpstk -ldps#-lpng#' Makefile.PL
  
  /bin/echo y | /usr/bin/perl Makefile.PL
  # ugly hack to make install location
  # compatible with newer versions of perl.
  # NOTE: if the perl version changes from 5.8.7, change the sed line too
  /bin/sed -i "s:5.8.7:current:g" Makefile
  /usr/bin/make || return 1
  /usr/bin/make install DESTDIR=$startdir/pkg

  # remove perllocal.pod, .packlist and empty dirs.
  /bin/rm -rf $startdir/pkg/usr/lib/perl5/current $startdir/pkg/usr/lib/perl5/site_perl/current/i686-linux-thread-multi/auto/Image/Magick/.packlist
}

Let me know if it works for you. Two things to consider:
- the install guide for perlmagick says the perl module version should correspond to the ImageMagick version. Our ImageMagick is 6.2.5 at the moment, but the latest perlmagick is 6.24. I don't know how this will affect you - hopefully, not at all.
- you will have to force the install, as these files have already been installed by ImageMagick, so do pacman -Af.

Offline

#7 2006-01-21 02:15:28

eyolf
Member
From: Copenhagen
Registered: 2005-11-29
Posts: 339
Website

Re: Help needed with perl Image::Magick module

Thanks a lot - seems to work. I still have to set up mysql and apache before I can test the target program itself, but the installation went fine.
I love arch! :-)

(I remember trying to set up mysql on Windows earlier - I got completely lost after a while. Now, after some months with arch, it seems like a breeze. Steep learning curve, but one actually learns...)

Offline

Board footer

Powered by FluxBB