Subject: installing perl modules as user in an own PREFIX
To: None <netbsd-help@netbsd.org>
From: Raketnet <jordivvz@raketnet.nl>
List: netbsd-help
Date: 05/15/2003 09:55:26
I want to install modules as a normal user in my own directory, things don't
go so clean. Perl documentation indicates you should do this using the PREFIX
variable. So the process for installing modules, would be:
perl Makefile.PL PREFIX=
make
make test
make install
But some modules will fail using "PREFIX"... First I show an example with the
module Xmms-Perl-0.12, this module depends on Term-ReadLine-Perl-1.0203, so I
install Term-ReadLine-Perl-1.0203
perl Makefile.PL PREFIX=~/mhroot/perl
make
make test
make install
everything goes well.
Now back to Xmms-Perl-0.12
perl Makefile.PL PREFIX=~/mhroot/perl
Checking if your kit is complete...
Looks good
Warning: prerequisite Term::ReadLine::Perl failed to load: Can't locate
Term/ReadLine/Perl.pm in @INC (@INC contains:
/usr/pkg/lib/perl5/site_perl/5.6.1/i386-netbsd
/usr/pkg/lib/perl5/site_perl/5.6.1 /usr/pkg/lib/perl5/site_perl
/usr/pkg/lib/perl5/5.6.1/i386-netbsd /usr/pkg/lib/perl5/5.6.1 .) at (eval 17)
line 3.
Writing Makefile for Xmms::Config
Abort trap (core dumped)
Here an error, of course Perl.pm is in PREFIX wich I installed before but @INC
doesn't search in PREFIX... this I fixed with setenv PERL5LIB and defining the
new paths in PREFIX. After that everything works. I don't know if it's a clean
way.
Next example the module TermReadKey-2.21
perl Makefile.PL PREFIX=~/mhroot/perl
make (everything goes well)
make test
PERL_DL_NONLAZY=1 /usr/pkg/bin/perl -Iblib/arch -Iblib/lib
-I/usr/pkg/lib/perl5/5.6.1/i386-netbsd -I/usr/pkg/lib/perl5/5.6.1 -w test.pl
1 .. 8
Can't load 'blib/arch/auto/Term/ReadKey/ReadKey.so' for module Term::ReadKey:
Shared object "libperl.so" not found at
/usr/pkg/lib/perl5/5.6.1/i386-netbsd/DynaLoader.pm line 206.
at test.pl line 22
Compilation failed in require at test.pl line 22.
BEGIN failed--compilation aborted at test.pl line 22.
*** Error code 255
Stop.
make: stopped in /home/joe/.cpan/build/TermReadKey-2.21
make compiles using PREFIX, with LD_LIBRARY_PATH in this way:
of course libperl.so exists in the system, defining the env variable
LD_LIBRARY_PATH and perl localbase paths /usr/pkg/lib/perl5... makes things
work. But I think here this is not a clean way.
LD_RUN_PATH="" cc --whole-archive -shared -Wl,-R/usr/pkg/lib -L/usr/pkg/lib
ReadKey.o -o blib/arch/auto/Term/ReadKey/ReadKey.so
-L/usr/pkg/lib/perl5/5.6.1/i386-netbsd/CORE
-Wl,-R/home/joe/mhroot/perl/lib/5.6.1/i386-netbsd/CORE -lperl
at the end this line isn't well:
-R/home/joe/mhroot/perl/lib/5.6.1/i386-netbsd/CORE -lperl
should be -R /usr/pkg/perl5/lib/5.6.1/i386-netbsd/CORE -lperl and it wouldn't
complain about libperl.so missing without need of LD_LIBRARY_PATH. Because
even if you define LD_LIBRARY_PATH, that make thing work, it still compiles
linking to -R/home/joe/mhroot/perl/lib/5.6.1/i386-netbsd/CORE -lperl
I post this because I think maybe it's possible the pkgsrc/perl5 isn't well
build. Or does anyone know a clean process for installing modules as user in
an own PREFIX?
-=================================================-
Deze mail werd verstuurd met Webmail van RaketNet
Meer informatie? http://www.raketnet.nl
-=================================================-