Subject: | ->atleast_version patch |
The ->atleast_version delegation to pkg-config doesn't seem to work for me (Ubuntu 12.04), since the actual option is --atleast-version and it returns via exit code rather than STDOUT.
I've worked around it using this, could probably be cleaned up a bit (relying on passing $? between methods is perhaps a bit nasty).
cheers,
Tom
--- lib/Alien/libtermkey.pm 2013-04-10 17:40:01.704722707 +0100
+++ /home/tom/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/x86_64-linux/Alien/libtermkey.pm 2013-04-10 17:39:11.037708475 +0100
@@ -50,6 +50,11 @@
return _get_pkgconfig( $AUTOLOAD, @_ );
}
+sub atleast_version {
+ _get_pkgconfig('atleast-version', @_);
+ return !($? >> 8);
+}
+
sub _get_pkgconfig
{
my ( $method, $self, @args ) = @_;
@@ -59,6 +64,7 @@
die "Cannot popen pkg-config - $!";
my $ret = do { local $/; <$eupc> }; chomp $ret;
+ close $eupc;
return $ret;
}