Commit | Line | Data |
004ac8d9 |
1 | package inc::MakeMaker; |
2 | |
3 | use Moose; |
4 | |
6bf5d14d |
5 | use lib 'inc'; |
6 | |
004ac8d9 |
7 | use MMHelper; |
8 | |
6bf5d14d |
9 | extends 'Dist::Zilla::Plugin::MakeMaker::Awesome'; |
10 | |
11 | override _build_MakeFile_PL_template => sub { |
12 | my $self = shift; |
13 | |
14 | my $tmpl = super(); |
15 | |
6ae2c8a1 |
16 | my $ccflags = MMHelper::ccflags_dyn(); |
17 | $tmpl =~ s/^(WriteMakefile\()/\$WriteMakefileArgs{CCFLAGS} = $ccflags;\n\n$1/m; |
18 | |
6bf5d14d |
19 | return $tmpl . "\n\n" . MMHelper::my_package_subs(); |
20 | }; |
21 | |
22 | override _build_WriteMakefile_args => sub { |
23 | my $self = shift; |
24 | |
25 | my $args = super(); |
26 | |
27 | return { |
28 | %{$args}, |
29 | MMHelper::mm_args(), |
30 | }; |
31 | }; |
32 | |
aa0d8521 |
33 | override test => sub { |
34 | my $self = shift; |
35 | |
36 | local $ENV{PERL5LIB} = join ':', |
37 | grep {defined} @ENV{ 'PERL5LIB', 'DZIL_TEST_INC' }; |
38 | |
39 | super(); |
40 | }; |
41 | |
6bf5d14d |
42 | 1; |