File Coverage

blib/lib/Alien/Build/Plugin/Gather/Dino.pm
Criterion Covered Total %
statement 26 26 100.0
branch 4 4 100.0
condition n/a
subroutine 8 8 100.0
pod 1 1 100.0
total 39 39 100.0


line stmt bran cond sub pod time code
1             package Alien::Build::Plugin::Gather::Dino;
2              
3 3     3   222423 use strict;
  3         20  
  3         103  
4 3     3   19 use warnings;
  3         5  
  3         82  
5 3     3   80 use 5.008001;
  3         15  
6 3     3   575 use Alien::Build::Plugin;
  3         4049  
  3         31  
7 3     3   1307 use FFI::CheckLib qw( find_lib );
  3         7154  
  3         244  
8 3     3   529 use Path::Tiny qw( path );
  3         9187  
  3         586  
9              
10             # ABSTRACT: Experimental support for dynamic share Alien install
11             our $VERSION = '0.06'; # VERSION
12              
13              
14             sub init
15             {
16 4     4 1 492 my($self, $meta) = @_;
17            
18             $meta->after_hook(
19             gather_share => sub {
20 4     4   37825393 my($build) = @_;
21            
22 4         34 foreach my $path (map { path('.')->absolute->child($_) } qw( bin lib dynamic ))
  12         1556  
23             {
24 12 100       1842 next unless -d $path;
25 8 100       193 if(find_lib(lib => '*', libpath => $path->stringify, systempath => []))
26             {
27 4         1165 push @{ $build->runtime_prop->{rpath} }, $path->basename;
  4         26  
28             }
29             }
30             },
31 4         62 );
32             }
33              
34             1;
35              
36             __END__