Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add helpers #14

Merged
merged 1 commit into from Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@
Revision history for {{$dist->name}}

{{$NEXT}}
- Added helpers for automake and aclocal (gh#14)

0.17 2022-04-03 06:34:22 -0600
- Disable makeinfo documentation generation for share install (gh#11, gh#12)
Expand Down
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -22,6 +22,14 @@ will use that. If it cannot be found, the source code will be downloaded
from the internet and it will be installed in a private share location
for the use of other modules.

# HELPERS

This [Alien](https://metacpan.org/pod/Alien) provides the following helpers which will execute the corresponding command. You want
to use the helpers because they will use the correct incantation on Windows.

- `automake`
- `aclocal`

# CAVEATS

This module is currently configured to _always_ do a share install. This is because `system` installs for this alien are not reliable. Please see
Expand Down
31 changes: 31 additions & 0 deletions lib/Alien/automake.pm
Expand Up @@ -10,6 +10,19 @@ use base qw( Alien::Base );
# ALIEN SYNOPSIS
# ALIEN DESCRIPTION

=head1 HELPERS

This L<Alien> provides the following helpers which will execute the corresponding command. You want
to use the helpers because they will use the correct incantation on Windows.

=over 4

=item C<automake>

=item C<aclocal>

=back

=head1 CAVEATS

This module is currently configured to I<always> do a share install. This is because C<system> installs for this alien are not reliable. Please see
Expand All @@ -34,4 +47,22 @@ upstream alien uses the system library so you won't need to install this module.

=cut

my %helper;

foreach my $command (qw( automake aclocal ))
{
if($^O eq 'MSWin32')
{
$helper{$command} = sub { qq{sh -c "$command "\$*"" --} };
}
else
{
$helper{$command} = sub { $command };
}
}

sub alien_helper {
return \%helper;
}

1;
46 changes: 23 additions & 23 deletions perlcriticrc
@@ -1,30 +1,30 @@
severity = 1
only = 1

[Freenode::ArrayAssignAref]
[Freenode::BarewordFilehandles]
[Freenode::ConditionalDeclarations]
[Freenode::ConditionalImplicitReturn]
[Freenode::DeprecatedFeatures]
[Freenode::DiscouragedModules]
[Freenode::DollarAB]
[Freenode::Each]
[Freenode::EmptyReturn]
[Freenode::IndirectObjectNotation]
[Freenode::LexicalForeachIterator]
[Freenode::LoopOnHash]
[Freenode::ModPerl]
[Freenode::OpenArgs]
[Freenode::OverloadOptions]
[Freenode::POSIXImports]
[Freenode::PackageMatchesFilename]
[Freenode::PreferredAlternatives]
[Freenode::StrictWarnings]
[Community::ArrayAssignAref]
[Community::BarewordFilehandles]
[Community::ConditionalDeclarations]
[Community::ConditionalImplicitReturn]
[Community::DeprecatedFeatures]
[Community::DiscouragedModules]
[Community::DollarAB]
[Community::Each]
[Community::EmptyReturn]
[Community::IndirectObjectNotation]
[Community::LexicalForeachIterator]
[Community::LoopOnHash]
[Community::ModPerl]
[Community::OpenArgs]
[Community::OverloadOptions]
[Community::POSIXImports]
[Community::PackageMatchesFilename]
[Community::PreferredAlternatives]
[Community::StrictWarnings]
extra_importers = Test2::V0
[Freenode::Threads]
[Freenode::Wantarray]
[Freenode::WarningsSwitch]
[Freenode::WhileDiamondDefaultAssignment]
[Community::Threads]
[Community::Wantarray]
[Community::WarningsSwitch]
[Community::WhileDiamondDefaultAssignment]

[BuiltinFunctions::ProhibitBooleanGrep]
[BuiltinFunctions::ProhibitStringyEval]
Expand Down
13 changes: 2 additions & 11 deletions t/alien_automake.t
@@ -1,5 +1,5 @@
use Test2::V0 -no_srand => 1;
use Test::Alien;
use Test::Alien 2.52;
use Alien::autoconf;
use Alien::automake;
use Env qw( @PATH );
Expand All @@ -8,16 +8,7 @@ unshift @PATH, Alien::autoconf->bin_dir;

alien_ok 'Alien::automake';

my $wrapper = sub { [@_] };

if($^O eq 'MSWin32')
{
require Alien::MSYS;
unshift @PATH, Alien::MSYS::msys_path();
$wrapper = sub { [ 'sh', -c => "@_" ] };
}

run_ok($wrapper->($_, '--version'))
interpolate_run_ok("%{$_} --version")
->success
->note for qw( automake aclocal );

Expand Down
2 changes: 1 addition & 1 deletion xt/author/critic.t
@@ -1,6 +1,6 @@
use Test2::Require::Module 'Test2::Tools::PerlCritic';
use Test2::Require::Module 'Perl::Critic';
use Test2::Require::Module 'Perl::Critic::Freenode';
use Test2::Require::Module 'Perl::Critic::Community';
use Test2::V0;
use Perl::Critic;
use Test2::Tools::PerlCritic;
Expand Down