From 59236a42659d14597b551cd5b55c01377a92f408 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 3 Sep 2013 18:10:10 -0400 Subject: don't try to build the xs part if PUREPERL_ONLY is specified see https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/lancaster-consensus.md --- inc/MMPackageStash.pm | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/inc/MMPackageStash.pm b/inc/MMPackageStash.pm index dd658da..5971c98 100644 --- a/inc/MMPackageStash.pm +++ b/inc/MMPackageStash.pm @@ -10,10 +10,11 @@ around _build_MakeFile_PL_template => sub { my $xs_version = $self->zilla->prereqs->requirements_for('runtime', 'recommends')->as_string_hash->{'Package::Stash::XS'}; - # copied from M::I - my $can_cc = <<'CAN_CC'; + # can_run and can_cc copied from M::I + my $helpers = <<'HELPERS'; use Config (); use File::Spec (); +use Text::ParseWords (); # check if we can run some command sub can_run { @@ -42,16 +43,28 @@ sub can_cc { return; } -CAN_CC + +# XXX this is gross, but apparently it's the least gross option? +sub parse_args { + my $tmp = {}; + # copied from EUMM + ExtUtils::MakeMaker::parse_args( + $tmp, + Text::ParseWords::shellwords($ENV{PERL_MM_OPT} || ''), + @ARGV, + ); + return $tmp->{ARGS} || {}; +} +HELPERS my $fixup_prereqs = <{PUREPERL_ONLY} && can_cc(); PREREQS my $template = $self->$orig(@_); $template =~ s/(WriteMakefile\()/$fixup_prereqs\n$1/; - $template .= $can_cc; + $template .= $helpers; return $template; }; -- cgit v1.2.3