| 1 | package Dist::Inkt::Role::StaticInstall; | ||
| 2 | |||
| 3 | our $AUTHORITY = 'cpan:TOBYINK'; | ||
| 4 | our $VERSION = '0.026'; | ||
| 5 | |||
| 6 | use Moose::Role; | ||
| 7 | use Path::Tiny 'path'; | ||
| 8 | use namespace::autoclean; | ||
| 9 | |||
| 10 | has no_static_install => (is => 'ro', default => sub { !!0 }); | ||
| 11 | |||
| 12 | after PopulateMetadata => sub | ||
| 13 | { | ||
| 14 | my $self = shift; | ||
| 15 | |||
| 16 | return if $self->no_static_install; | ||
| 17 | |||
| 18 | return if $self->needs_conflict_check_code; | ||
| 19 | return if $self->needs_optional_features_code; | ||
| 20 | return if $self->sourcefile->child('meta/DYNAMIC_CONFIG.PL')->exists; | ||
| 21 | return if $self->sourcefile->child('bin')->exists; | ||
| 22 | return if $self->sourcefile->children( qr/\.(h|c|xs)$/ ); | ||
| 23 | |||
| 24 | $self->log('Distribution seems suitable for static install'); | ||
| 25 | |||
| 26 | $self->metadata->{x_static_install} //= 1; | ||
| 27 | }; | ||
| 28 | |||
| 29 | 1; |