awesome = =inc::MMPackageStash
CompileTests_skip = [Cc]onflicts$
+[=inc::DistMeta]
+dynamic_config = 1
+
[Prereqs]
perl = 5.8.1
Package::DeprecationManager = 0
-Package::Stash::XS = 0.22
Scalar::Util = 0
+[Prereqs / RuntimeRecommends]
+Package::Stash::XS = 0.22
+
[Prereqs / TestRequires]
Test::Fatal = 0
Test::More = 0.88
--- /dev/null
+package inc::DistMeta;
+use Moose;
+
+has metadata => (
+ is => 'ro',
+ isa => 'HashRef',
+ required => 1,
+);
+
+with 'Dist::Zilla::Role::MetaProvider';
+
+around BUILDARGS => sub {
+ my $orig = shift;
+ my $self = shift;
+
+ my $params = $self->$orig(@_);
+
+ my $zilla = delete $params->{zilla};
+ my $plugin_name = delete $params->{plugin_name};
+
+ return {
+ zilla => $zilla,
+ plugin_name => $plugin_name,
+ metadata => $params,
+ };
+};
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+
+1;
my $template = $self->$orig(@_);
- $template =~ s/(WriteMakefile\()/delete \$WriteMakefileArgs{PREREQ_PM}{'Package::Stash::XS'}\n unless can_cc();\n\n$1/;
+ my $xs_version = $self->zilla->prereqs->requirements_for('runtime', 'recommends')->as_string_hash->{'Package::Stash::XS'};
+
+ $template =~ s/(WriteMakefile\()/\$WriteMakefileArgs{PREREQ_PM}{'Package::Stash::XS'} = $xs_version\n if can_cc();\n\n$1/;
return $template . $can_cc;
};