line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Plugin::FFI::Package; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
655557
|
use strict; |
|
3
|
|
|
|
|
21
|
|
|
3
|
|
|
|
|
87
|
|
4
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
86
|
|
5
|
3
|
|
|
3
|
|
84
|
use 5.008001; |
|
3
|
|
|
|
|
12
|
|
6
|
3
|
|
|
3
|
|
1438
|
use FFI::CheckLib 0.11 qw( find_lib ); |
|
3
|
|
|
|
|
7149
|
|
|
3
|
|
|
|
|
194
|
|
7
|
3
|
|
|
3
|
|
22
|
use Cwd qw( getcwd ); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
129
|
|
8
|
3
|
|
|
3
|
|
19
|
use File::Basename qw( basename ); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
716
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Plugin to test bundled FFI code without EUMM |
11
|
|
|
|
|
|
|
our $VERSION = '0.04'; # VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import |
15
|
|
|
|
|
|
|
{ |
16
|
3
|
|
|
3
|
|
1967
|
require FFI::Platypus; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
20074
|
my $old = \&FFI::Platypus::package; |
19
|
|
|
|
|
|
|
my $new = sub { |
20
|
3
|
|
|
3
|
|
10
|
my($ffi, $module, $modlibname) = @_; |
21
|
3
|
50
|
|
|
|
23
|
($module, $modlibname) = caller() unless defined $modlibname; |
22
|
3
|
|
|
|
|
7
|
my $dist = $module; |
23
|
3
|
|
|
|
|
24
|
$dist =~ s/::/-/g; |
24
|
3
|
50
|
|
|
|
289
|
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
|
|
|
|
|
22
|
$old->($ffi, $module, $modlibname); |
38
|
3
|
|
|
|
|
16
|
}; |
39
|
|
|
|
|
|
|
|
40
|
3
|
|
|
3
|
|
25
|
no warnings 'redefine'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
177
|
|
41
|
3
|
|
|
|
|
3834
|
*FFI::Platypus::package = $new; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |