line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Plugin::FFI::Package; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
649850
|
use strict; |
|
3
|
|
|
|
|
21
|
|
|
3
|
|
|
|
|
87
|
|
4
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
15
|
|
|
3
|
|
|
|
|
67
|
|
5
|
3
|
|
|
3
|
|
83
|
use 5.008001; |
|
3
|
|
|
|
|
10
|
|
6
|
3
|
|
|
3
|
|
1435
|
use FFI::CheckLib 0.11 qw( find_lib ); |
|
3
|
|
|
|
|
7238
|
|
|
3
|
|
|
|
|
198
|
|
7
|
3
|
|
|
3
|
|
23
|
use Cwd qw( getcwd ); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
127
|
|
8
|
3
|
|
|
3
|
|
27
|
use File::Basename qw( basename ); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
797
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Plugin to test bundled FFI code without EUMM |
11
|
|
|
|
|
|
|
our $VERSION = '0.05'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import |
15
|
|
|
|
|
|
|
{ |
16
|
3
|
|
|
3
|
|
1996
|
require FFI::Platypus; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
20201
|
my $old = \&FFI::Platypus::package; |
19
|
|
|
|
|
|
|
my $new = sub { |
20
|
3
|
|
|
3
|
|
13
|
my($ffi, $module, $modlibname) = @_; |
21
|
3
|
50
|
|
|
|
24
|
($module, $modlibname) = caller() unless defined $modlibname; |
22
|
3
|
|
|
|
|
8
|
my $dist = $module; |
23
|
3
|
|
|
|
|
23
|
$dist =~ s/::/-/g; |
24
|
3
|
50
|
|
|
|
263
|
if(basename(getcwd()) eq $dist) |
25
|
|
|
|
|
|
|
{ |
26
|
0
|
|
|
|
|
0
|
my @lib = find_lib( |
27
|
|
|
|
|
|
|
lib => '*', |
28
|
|
|
|
|
|
|
libpath => 'share/lib', |
29
|
|
|
|
|
|
|
systempath => [], |
30
|
|
|
|
|
|
|
); |
31
|
0
|
0
|
|
|
|
0
|
if(@lib) |
32
|
|
|
|
|
|
|
{ |
33
|
0
|
|
|
|
|
0
|
$ffi->lib(@lib); |
34
|
0
|
|
|
|
|
0
|
return; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
3
|
|
|
|
|
20
|
$old->($ffi, $module, $modlibname); |
38
|
3
|
|
|
|
|
16
|
}; |
39
|
|
|
|
|
|
|
|
40
|
3
|
|
|
3
|
|
30
|
no warnings 'redefine'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
171
|
|
41
|
3
|
|
|
|
|
3771
|
*FFI::Platypus::package = $new; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |