line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::LibMagic; |
2
|
|
|
|
|
|
|
$Alien::LibMagic::VERSION = '0.002_01'; # TRIAL |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
1500
|
$Alien::LibMagic::VERSION = '0.00201';use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
63
|
|
5
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
52
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
1627
|
use Path::Tiny; |
|
2
|
|
|
|
|
22670
|
|
|
2
|
|
|
|
|
112
|
|
8
|
2
|
|
|
2
|
|
959
|
use parent 'Alien::Base'; |
|
2
|
|
|
|
|
565
|
|
|
2
|
|
|
|
|
12
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub cflags { |
11
|
1
|
|
|
1
|
1
|
46
|
my ($self) = @_; |
12
|
1
|
|
|
|
|
56
|
my $top_include = File::Spec->catfile( File::Spec->rel2abs($self->dist_dir), qw(include) ); |
13
|
1
|
|
|
|
|
728
|
return "-I$top_include"; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub libs { |
17
|
2
|
|
|
2
|
1
|
20213
|
my ($self) = @_; |
18
|
2
|
|
|
|
|
19
|
my $top_lib = File::Spec->catfile( File::Spec->rel2abs($self->dist_dir), qw(lib) ); |
19
|
2
|
|
|
|
|
646
|
my $la_file = path( File::Spec->catfile( $top_lib, 'libmagic.la' ) ); |
20
|
2
|
|
|
|
|
94
|
my ($deps) = $la_file->slurp_utf8 =~ /^dependency_libs=' (.*)'$/m; |
21
|
2
|
|
|
|
|
3356
|
return "-L$top_lib -lmagic $deps"; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub Inline { |
25
|
1
|
|
|
1
|
0
|
139131
|
my ($self, $lang) = @_; |
26
|
|
|
|
|
|
|
|
27
|
1
|
50
|
|
|
|
44
|
if( $lang eq 'C' ) { |
28
|
1
|
|
|
|
|
15
|
my $params = Alien::Base::Inline(@_); |
29
|
|
|
|
|
|
|
$params->{MYEXTLIB} .= ' ' . |
30
|
|
|
|
|
|
|
join( " ", |
31
|
1
|
|
|
|
|
15
|
map { File::Spec->catfile( |
|
1
|
|
|
|
|
4
|
|
32
|
|
|
|
|
|
|
File::Spec->rel2abs($self->dist_dir), |
33
|
|
|
|
|
|
|
'lib', $_ ) } |
34
|
|
|
|
|
|
|
qw(libmagic.a) |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
# Use static linking instead of dynamic linking on macOS. |
37
|
1
|
50
|
|
|
|
282
|
if( $^O eq 'darwin' ) { |
38
|
0
|
|
|
|
|
0
|
$params->{LIBS} =~ s/-lmagic//g; |
39
|
|
|
|
|
|
|
} |
40
|
1
|
|
|
|
|
6
|
return $params; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub inline_auto_include { |
45
|
2
|
|
|
2
|
1
|
28
|
return [ 'magic.h' ]; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=pod |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=encoding UTF-8 |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 NAME |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Alien::LibMagic - Alien package for the libmagic library |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 VERSION |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
version 0.002_01 |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 Inline support |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This module supports L. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SEE ALSO |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
L, L, L |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHOR |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Zakariyya Mughal |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This software is copyright (c) 2014 by Zakariyya Mughal. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
79
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |