-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile.PL
110 lines (100 loc) · 3.51 KB
/
Makefile.PL
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
use strict;
use warnings;
use 5.006;
use ExtUtils::MakeMaker 6.56;
use Getopt::Long;
use Config;
### Makefile.PL commandline params
# e.g. Makefile.PL --script=ppkg-config --script=pkg-config
Getopt::Long::GetOptions("script=s" => \my @scripts);
if (@scripts == 0 && defined $ENV{PERL_PKG_CONFIG_SCRIPTS})
{
@scripts = ($ENV{PERL_PKG_CONFIG_SCRIPTS});
}
if (@scripts) {
@scripts = map { split /,/ } @scripts;
if (grep /^none$/, @scripts) {
@scripts = ();
} else {
@scripts = map { "script/$_" } @scripts;
-f $_ or die "non-existing '$_'" for (@scripts);
}
}
else {
@scripts = ( 'script/ppkg-config', $^O ne 'MSWin32' ? 'script/pkg-config.pl' : () );
if($^O eq 'MSWin32' && $Config{myuname} =~ /strawberry-perl/) {
if(eval q{ require 5.020 }) {
push @scripts, 'script/pkg-config';
print "\n\n";
print "!!! Note that script will be installed as pkg-config !!!\n";
print "!!! in addition to ppkg-config since you are using !!!\n";
print "!!! Strawberry Perl 5.20 or better. This is probably !!!\n";
print "!!! What you want !!!\n";
print "\n\n";
if($Config{myuname} =~ /strawberry-perl 5\.20\.0\.1/)
{
print "\n\n";
print "!!! Some of the .pc files that come with your version !!!\n";
print "!!! of Strawberry Perl may not work correctly with !!!\n";
print "!!! this version of PkgConfig. You should consider !!!\n";
print "!!! patching them. See README.win32 for details. !!!\n";
print "\n\n";
}
} else {
print "\n\n";
print "!!! You may want to consider installing the script as !!!\n";
print "!!! pkg-config as it can then be used by !!!\n";
print "!!! ExtUtils::PkgConfig (This is how it works in !!!\n";
print "!!! Strawberry 5.20 and better in fact). Please see !!!\n";
print "!!! details in README.win32 if you are interested. !!!\n";
print "\n\n";
}
}
}
WriteMakefile(
NAME => 'PkgConfig',
AUTHOR => q{M. Nunberg <mnunberg@haskalah.org>},
VERSION_FROM => 'lib/PkgConfig.pm',
ABSTRACT_FROM => 'lib/PkgConfig.pm',
LICENSE => 'perl',
MIN_PERL_VERSION => '5.006000',
PL_FILES => {},
EXE_FILES => \@scripts,
PREREQ_PM => {
'Test::More' => '0.94',
},
BUILD_REQUIRES => {
'ExtUtils::MakeMaker' => '6.56',
},
PM => {
"lib/PkgConfig.pm" => "\$(INST_LIB)/PkgConfig.pm",
},
META_MERGE => {
'meta-spec' => { version => 2 },
resources => {
bugtracker => {
web => 'https://github.com/PerlPkgConfig/perl-PkgConfig/issues',
},
homepage => 'https://metacpan.org/pod/PkgConfig',
repository => {
type => 'git',
url => 'https://github.com/PerlPkgConfig/perl-PkgConfig.git',
web => 'https://github.com/PerlPkgConfig/perl-PkgConfig',
},
x_IRC => "irc://irc.perl.org/#native",
},
provides => {
PkgConfig => {
file => "lib/PkgConfig.pm",
version => do { require "./lib/PkgConfig.pm"; $PkgConfig::VERSION; },
},
},
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'PkgConfig-*' },
);
sub MY::test_via_harness
{
my($self, $perl, $tests) = @_;
"\t$perl run_test.pl"
}