6 name => 'namespace-clean',
9 abstract => 'Keep imports and functions out of your namespace',
11 'Robert \'phaylon\' Sedlacek <rs@474.at>',
12 'Florian Ragwitz <rafl@debian.org>',
13 'Jesse Luehrs <doy@tozt.net>',
14 'Peter Rabbitson <ribasushi@cpan.org>',
15 'Father Chrysostomos <sprout@cpan.org>',
21 'ExtUtils::MakeMaker' => 0,
26 'B::Hooks::EndOfScope' => '0.12',
32 'Test::More' => '0.47',
38 x_IRC => 'irc://irc.perl.org/#toolchain',
39 homepage => 'http://search.cpan.org/dist/namespace-clean',
42 url => 'git://git.shadowcat.co.uk/p5sagit/namespace-clean.git',
43 web => 'https://github.com/p5sagit/namespace-clean',
46 mailto => 'bug-namespace-clean@rt.cpan.org',
47 web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=namespace-clean',
53 # a sub-namer is needed if using the debugger on some perls
55 # sigh... so much unmitigated stupidity on #p5p these days...
56 local @INC = ('lib', @INC);
57 require namespace::clean::_Util;
60 namespace::clean::_Util::DEBUGGER_NEEDS_CV_RENAME()
62 namespace::clean::_Util::_namer_load_error()
64 usable_compiler_present()
66 # when changing version, also change $sn_ver in namespace/clean/_Util.pm
67 ? ( PREREQ_PM => { 'Sub::Name' => '0.04' } )
71 ## XS-checking BOILERPLATE ###################################################
72 sub usable_compiler_present {
73 return 0 if parse_args()->{PUREPERL_ONLY};
79 # poor man's inc::latest
80 my $euhc_fn = 'ExtUtils/HasCompiler.pm';
81 my $euhc_found_in_INC_dir;
83 ( ($euhc_found_in_INC_dir) = grep {
92 MM->parse_version("$euhc_found_in_INC_dir/$euhc_fn")
94 MM->parse_version("inc/$euhc_fn")
97 eval { require ExtUtils::HasCompiler };
99 unless ( $INC{'ExtUtils/HasCompiler.pm'} ) {
100 local @INC = ( "inc", @INC );
101 require ExtUtils::HasCompiler;
104 $ucp = ExtUtils::HasCompiler::can_compile_loadable_object(quiet => 1)
112 if( my $used_fn = $INC{'ExtUtils/HasCompiler.pm'} ) {
114 "ExtUtils::HasCompiler::can_compile_loadable_object() v%s (loaded from %s) returned: %s\n",
115 ExtUtils::HasCompiler->VERSION,
117 ( defined($ucp) ? $ucp : "UNKNOWN" ),
121 print "Something went wrong when trying to load/use ExtUtils::HasCompiler:\n$@\n\n";
128 # FIXME - this has been cargo-culted from
129 # https://metacpan.org/source/HAARG/strictures-2.000002/Makefile.PL
130 # There likely will be better ways to handle %ENV and @ARGV directly within
131 # EU::HC in the future
134 require ExtUtils::MakeMaker;
135 require Text::ParseWords;
136 ExtUtils::MakeMaker::parse_args(
138 Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''),
141 return $tmp->{ARGS} || {};
143 ## END XS-checking BOILERPLATE ###############################################
146 ## BOILERPLATE ###############################################################
147 require ExtUtils::MakeMaker;
149 # have to do this since old EUMM dev releases miss the eval $VERSION line
150 my $eumm_version = eval $ExtUtils::MakeMaker::VERSION;
151 my $mymeta = $eumm_version >= 6.57_02;
152 my $mymeta_broken = $mymeta && $eumm_version < 6.57_07;
154 ($MM_ARGS{NAME} = $META{name}) =~ s/-/::/g;
155 ($MM_ARGS{VERSION_FROM} = "lib/$MM_ARGS{NAME}.pm") =~ s{::}{/}g;
156 $META{license} = [ $META{license} ]
157 if $META{license} && !ref $META{license};
158 $MM_ARGS{LICENSE} = $META{license}[0]
159 if $META{license} && $eumm_version >= 6.30;
160 $MM_ARGS{NO_MYMETA} = 1
162 $MM_ARGS{META_ADD} = { 'meta-spec' => { version => 2 }, %META }
163 unless -f 'META.yml';
165 for (qw(configure build test runtime)) {
166 my $key = $_ eq 'runtime' ? 'PREREQ_PM' : uc $_.'_REQUIRES';
167 my $r = $MM_ARGS{$key} = {
168 %{$META{prereqs}{$_}{requires} || {}},
169 %{delete $MM_ARGS{$key} || {}},
171 defined $r->{$_} or delete $r->{$_} for keys %$r;
174 $MM_ARGS{MIN_PERL_VERSION} = delete $MM_ARGS{PREREQ_PM}{perl} || 0;
176 delete $MM_ARGS{MIN_PERL_VERSION}
177 if $eumm_version < 6.47_01;
178 $MM_ARGS{BUILD_REQUIRES} = {%{$MM_ARGS{BUILD_REQUIRES}}, %{delete $MM_ARGS{TEST_REQUIRES}}}
179 if $eumm_version < 6.63_03;
180 $MM_ARGS{PREREQ_PM} = {%{$MM_ARGS{PREREQ_PM}}, %{delete $MM_ARGS{BUILD_REQUIRES}}}
181 if $eumm_version < 6.55_01;
182 delete $MM_ARGS{CONFIGURE_REQUIRES}
183 if $eumm_version < 6.51_03;
185 ExtUtils::MakeMaker::WriteMakefile(%MM_ARGS);
186 ## END BOILERPLATE ###########################################################