-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.PL
98 lines (86 loc) · 2.76 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
use strict;
use ExtUtils::MakeMaker;
use Alien::SDL;
use File::Spec;
sub _slurp
{
my $filename = shift;
open my $in, '<', $filename
or die "Cannot open '$filename' for slurping - $!";
local $/;
my $contents = <$in>;
close($in);
return $contents;
}
my $lib = 'betweener';
my $test = 'betweener_unit_tests';
my $cpp_path = 'src/cpp';
my $lib_ar = "$cpp_path/lib$lib\$(LIB_EXT)";
my $cc = 'g++';
WriteMakefile(
NAME => 'SDLx::Betweener',
VERSION_FROM => 'lib/SDLx/Betweener.pm',
PREREQ_PM => {
'Alien::SDL' => '1.430',
'SDL' => '2.536',
'Moose' => '2.0402',
},
CC => $cc,
LD => '$(CC)',
($] >= 5.005 ?
(ABSTRACT => 'SDL Perl XS Tweening Animation Library',
AUTHOR => 'eilara <[email protected]>') : ()),
LIBS => Alien::SDL->config('libs', '-lm'),
DEFINE => '', # e.g., '-DHAVE_SOMETHING'
INC => Alien::SDL->config('cflags'). ' -I. -Isrc/cpp -Isrc/cpp_xs',
OBJECT => '$(O_FILES)',
'MYEXTLIB' => $lib_ar,
(($ExtUtils::MakeMaker::VERSION >= 6.48)
? (MIN_PERL_VERSION => '5.012',)
: ()
),
(($ExtUtils::MakeMaker::VERSION >= 6.48)
? (LICENSE => 'perl',)
: ()
),
(($ExtUtils::MakeMaker::VERSION >= 6.48)
? (
META_MERGE =>
{
"meta-spec" => { version => 2 },
provides => {
'SDLx::Betweener' => {
file => "lib/SDLx/Betweener.pm",
version => sub {
my $contents = _slurp(File::Spec->catfile(File::Spec->curdir, qw( lib SDLx Betweener.pm)));
if (my ($version) = ($contents =~ /^our \$VERSION = '([^']*)'/ms))
{
return $version;
}
else
{
die "Cannot find version in file.";
}
}->(),
},
},
resources => {
repository => {
type => 'git',
url => 'git://github.com/shlomif/SDLx-Betweener.git',
web => 'https://github.com/shlomif/SDLx-Betweener',
},
},
,
},
)
: ()
),
# clean => {'FILES' => ''},
);
sub MY::postamble {
'
$(MYEXTLIB): src/Makefile
cd src && $(MAKE) $(PASSTHRU)
';
}