From: Alex Efros <powerman@powerman.asdfgroup.com>
To: gentoo-perl@lists.gentoo.org
Subject: [gentoo-perl] Scalar::Util qw( weaken )
Date: Wed, 25 Mar 2009 10:51:18 +0200 [thread overview]
Message-ID: <20090325085117.GA8255@home.power> (raw)
Hi!
I've no idea is installing perl modules from CPAN using
cpan/cpansite/manually instead of using emerge is supported by Gentoo, but
the truth is, dev-perl/ has only 772 packages now while CPAN has much much
more and so it's unavoidable to install a lot of modules from CPAN using
cpan/cpansite/manually if you do a lot of perl development.
Probably g-cpan tool may help here, but I've not tried it yet.
Is it able to:
- automatically resolve and install deep perl module dependencies
- handle interactive Makefile.PL
- run tests for all modules by default (without forcing make test on all
other packages in portage)
- force install on failed tests
- local cpan overlays (like cpansite from CPAN::Site)
?
After installing many modules using cpan/cpansite/manually you find
yourself managing some perl modules using emerge and others using cpan -
that's not ease and finally you'll unmerge all modules and will
install/update *all* modules using cpan/cpansite. (You will have to add
some perl modules to /etc/portage/profile/package.provided to stop portage
from emerging them.)
Now, we've a problem. After (re-)emerging perl, module Scalar::Util become
broken (and so many other modules which need weaken() function):
$ perl -e 'use Scalar::Util; print "ok\n"'
ok
$ perl -e 'use Scalar::Util qw( weaken ); print "ok\n"'
Weak references are not implemented in the version of perl at -e line 1
BEGIN failed--compilation aborted at -e line 1.
$ perl -e 'use Compress::Zlib; print "ok\n"'
is only avaliable with the XS version at /usr/lib/perl5/site_perl/5.8.8/Compress/Zlib.pm line 9
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/Compress/Zlib.pm line 9.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
This bug probably related to http://bugs.gentoo.org/show_bug.cgi?id=247585
Because of broken Compress::Zlib we can't use cpan command anymore to
reinstall Scalar::Util, and have to download/unpack/install it manually.
So, it looks like only way to work around this issue is use hook in
/etc/portage/bashrc to reinstall Scalar::Util on "postinst" EBUILD_PHASE
for dev-lang/perl package. Is there any better solution exists?
P.S. Here is my /etc/portage/bashrc.d/dev-lang/perl.postinst:
---cut---
#!/bin/bash
ewarn "Reinstalling Scalar::Util!"
latest=$(lynx -dump -listonly http://cpan.org/modules/by-module/Scalar/ |
grep '/Scalar-List-Utils-.*\.tar\.gz' |
awk '{print $2}' |
perl -Mversion -ne '
($n)=/-([\d.]+)/; ($p,$s)=($n,$_) if qv($p)<qv($n); END{print$s}
')
if [ "x$latest" != "x" ]; then
mkdir /tmp/perl-$$/
wget -q -O - "$latest" | tar xzf - -C /tmp/perl-$$/
( cd /tmp/perl-$$/* && perl Makefile.PL && make && make install )
rm -rf /tmp/perl-$$/
fi
---cut---
--
WBR, Alex.
next reply other threads:[~2009-03-25 8:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-25 8:51 Alex Efros [this message]
2009-03-25 9:35 ` [gentoo-perl] Scalar::Util qw( weaken ) Michele Beltrame
2009-03-25 9:45 ` Alex Efros
2009-03-25 10:10 ` Michele Beltrame
2009-03-25 10:14 ` Yuval Yaari
2009-03-25 10:03 ` Yuval Yaari
2009-03-25 10:16 ` Yuval Yaari
2009-03-25 10:45 ` Steven Lembark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090325085117.GA8255@home.power \
--to=powerman@powerman.asdfgroup.com \
--cc=gentoo-perl@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox