-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathMakefile.PL
103 lines (88 loc) · 2.69 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
use strict;
use warnings;
use ExtUtils::MakeMaker;
use Carp;
my $mm_version = $ExtUtils::MakeMaker::VERSION;
if ( $mm_version < 6.58 ) {
croak("Sorry, but MakeMaker 6.58 or better is needed to build this package.");
}
WriteMakefile(
NAME => 'Term::ReadKey',
DISTNAME => 'TermReadKey',
LICENSE => 'perl',
ABSTRACT => 'Change terminal modes, and perform non-blocking reads.',
AUTHOR => ['Kenneth Albanowski','Jonathan Stowe'],
CONFIGURE_REQUIRES => {
'ExtUtils::MakeMaker' => 6.58,
},
BUILD_REQUIRES => {
'ExtUtils::MakeMaker' => 6.58,
},
META_ADD => { # needs to _ADD because I want over-ride the dynamic_config
dynamic_config => 1,
no_index => {
file => [ qw(Configure.pm) ],
package => [ qw(Configure) ],
},
provides => {
'Term::ReadKey' => {
file => 'ReadKey.pm.PL',
version => '2.38',
},
},
'meta-spec' => { version => 2 },
resources => {
repository => {
type => 'git',
url => 'https://github.com/jonathanstowe/TermReadKey.git',
web => 'https://github.com/jonathanstowe/TermReadKey',
},
},
},
VERSION_FROM => 'ReadKey.pm.PL',
XSPROTOARG => '-noprototypes',
PL_FILES => { 'ReadKey.pm.PL' => 'ReadKey.pm' },
PM => { 'ReadKey.pm' => '$(INST_ARCHLIBDIR)/ReadKey.pm' },
clean => { FILES => 'cchars.h ReadKey.pm' },
SIGN => 1,
# Uncomment these to allow testing of sgtty under Linux. Not needed normally.
# INC => "-I/usr/include/bsd",
# LIBS => "-lbsd"
);
sub MY::top_targets {
my $self = shift;
$_ = $self->MM::top_targets();
# ensure that the XS is built before the PM
s/pure_all :: config pm_to_blib (.* )linkext/pure_all :: config linkext pm_to_blib $1/;
$_ .= "
sgtty cchars.h: genchars.pl
\$(PERLRUN) genchars.pl
distcc: genchars.pl
\$(PERLRUN) genchars.pl dist
ReadKey\$(OBJ_EXT): ReadKey.c cchars.h
";
return $_;
}
# The template needs DynaLoader. don't use miniperl (dual-life only)
sub MY::processPL {
my $self = shift;
$_ = $self->MM::processPL();
s/ReadKey.pm :: ReadKey.pm.PL/ReadKey.pm :: ReadKey.pm.PL dynamic/;
s/\$\(PERLRUN\)/\$(FULLPERLRUNINST)/;
return $_;
}
sub MY::test {
my $self = shift;
$_ = $self->MM::test();
s#example/test.pl#-w example/test.pl#;
return $_;
}
sub MY::test_interactive {
return "Fooo";
}
sub MY::pure_site_install {
my $self = shift;
my $new = $self->MM::test();
$new .= "\n\t./register_module Term::ReadKey";
return $new;
}