Last active
August 17, 2016 05:56
-
-
Save oetiker/c62874b5bd03d83d209f39e1098083ff to your computer and use it in GitHub Desktop.
build missing modules locally details on https://medium.com/@oetiker/teach-makefile-pl-to-use-cpanm-b36ba9df487e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub MY::postamble { | |
my $self = shift; | |
my %r = (%{ $self->{PREREQ_PM} || {} }, %{ $self->{BUILD_REQUIRES} || {} }, %{ $self->{TEST_REQUIRES} || {} } ); | |
my $modules = join " ", grep !/^perl\@/, map { $r{$_} ? $_ .'@'. $r{$_} : $_ } keys %r; | |
my $tpd = "$FindBin::RealBin/3rd"; | |
warn "** call 'make builddeps' to build missing dependencies ...\n"; | |
return <<"EOF"; | |
builddeps: $tpd/touch | |
mkdir -p $tpd | |
$tpd/touch: Makefile | |
\@echo "*** INSTALLING MISSING BITS FOR TESTING ***" | |
curl -L https://cpanmin.us | PERL_CPANM_HOME=$tpd \$(PERL) - -q --notest --local-lib-contained $tpd $modules && touch $tpd/touch | |
EOF | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment