convert Makefile.PL to using Distar
[p5sagit/Devel-Declare.git] / Makefile.PL
1 use strict;
2 use warnings FATAL => 'all';
3
4 use 5.008001;
5 use ExtUtils::MakeMaker;
6 (do 'maint/Makefile.PL.include' or die $@) unless -f 'META.yml';
7
8 use ExtUtils::Depends;
9 my $pkg = ExtUtils::Depends->new('Devel::Declare', 'B::Hooks::OP::Check');
10
11 my %TEST_DEPS = (
12     'B::Hooks::OP::Check' => '0.19',
13     'Test::More' => '0.88',
14     'Test::Requires' => '0',
15 );
16
17 # have to do this since old EUMM dev releases miss the eval $VERSION line
18 my $mymeta_works = do { no warnings; $ExtUtils::MakeMaker::VERSION >= 6.5707 };
19
20 *MY::postamble = sub {
21     my ($self, %extra) = @_;
22     join('', %extra) if keys %extra;
23 } if not &MY::postamble;
24
25 WriteMakefile(
26     NAME => 'Devel::Declare',
27     AUTHOR => ['Matt S Trout - <mst@shadowcat.co.uk> - original author'],
28     VERSION_FROM => 'lib/Devel/Declare.pm',
29     MIN_PERL_VERSION => '5.008001',
30
31     CONFIGURE_REQUIRES => {
32         # minimum version that works on Win32+gcc
33         'ExtUtils::Depends' => 0.302,
34
35         # minimum version that depends on ExtUtils::Depends 0.302
36         'B::Hooks::OP::Check' => '0.19',
37     },
38
39     PREREQ_PM => {
40         'Scalar::Util' => 1.11, # set_prototype appeared in this version
41         'B::Hooks::OP::Check' => '0.19',
42         'B::Hooks::EndOfScope' => '0.05',
43         'Sub::Name' => 0,
44         ($mymeta_works ? () : (%TEST_DEPS)),
45     },
46
47     $mymeta_works ? (BUILD_REQUIRES => \%TEST_DEPS) : (),
48
49     META_MERGE => {
50         dynamic_config => 0,
51
52         resources => {
53             # r/w: p5sagit@git.shadowcat.co.uk:Devel-Declare.git
54             repository => 'git://git.shadowcat.co.uk/p5sagit/Devel-Declare.git',
55             homepage => 'http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/Devel-Declare.git',
56         },
57     },
58
59     C => [ 'stolen_chunk_of_toke.c' ],
60     XS => { 'Declare.xs' => 'Declare.c' },
61     postamble => { '' => '$(OBJECT) : stolen_chunk_of_toke.c' },
62
63     $pkg->get_makefile_vars,
64 );
65