File: PkgConfigPP.pm

package info (click to toggle)
libffi-platypus-perl 2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,860 kB
  • sloc: perl: 7,388; ansic: 6,862; cpp: 53; sh: 19; makefile: 14
file content (53 lines) | stat: -rw-r--r-- 642 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package Alien::FFI::PkgConfigPP;

use strict;
use warnings;

our $VERBOSE = !!$ENV{V};

my $pkg;

sub _pkg
{
  $pkg ||= eval {
    require PkgConfig;
    my $pkg = PkgConfig->find('libffi');
    die $pkg->errmsg if $pkg->errmsg;
    $pkg;
  };
  die "libffi not found" unless $pkg;
  $pkg;
}

sub exists
{
  !!eval { _pkg };
}

sub version {
  _pkg->pkg_version;
}

sub config
{
  my($class, $key) = @_;
  die "unimplemented for $key" unless $key eq 'version';
  $class->version;
}

sub cflags
{
  scalar _pkg->get_cflags;
}

sub libs
{
  scalar _pkg->get_ldflags;
}

sub install_type { return 'system' }

sub runtime_prop { return {} }

1;