App-MechaCPAN

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

  - Fix bug where install couldn't handle modules starting with git
  - Fix bug that prevented reusable perls from being threaded

0.28  2021-08-12 23:26:06 EDT
  - Include core dependencies, because RedHat. Fixes GH#20
  - Be more forgiving of the limitations of the underlying OS
  - Don't fail a test because the optional --jobs option because make doesn't
    understand -h. Fixes GH#19

0.27  2021-08-10 22:53:01 EDT
  - Add the option to build and install relocatable binary perl archives
  - Add the --jobs option and try to detect if make doesn't support it
  - Correct an off-by-one error on the log's month
  - Be more clear when Makefile.PL or Build.PL couldn't be found and avoid
    dumping useless and/or binary data to the screen GH#15
  - Add file/line directives to the built script to aid diagnosis and errors
  - Improve tests to skip https requests when https is unavailable GH#14
  - Improve error reporting and error contents

0.26  2018-11-09 00:36:48 EST
  - Use the full form of File::Temp->new for older perls. GH#11

README  view on Meta::CPAN


 --directory=<path>

    Changes to a specified directory before any processing is done. This
    allows you to specify what directory you want local/ to be in. If this
    isn't provided, the current working directory is used instead.

 --build-reusable-perl

    Giving this options will override the mode of operation and generate a
    reusable, relocatable perl archive. This accepts the same parameters as
    the Perl command (i.e. "devel" and "threads") to generate the binary.
    Note that the lib/ directory is always included unless the --skip-lib
    option is included. The archive name will generally reflect what
    systems the resuling archive can run on. Because of the nature of how
    perl builds binaries, it cannot guarantee that it will work on any
    given system. This option will have the best luck if you use it with
    the same version of a distribution.

    Once you have a reusable binary archive, App::MechaCPAN::Perl can use
    that archive as a source file and install the binaries into the local

lib/App/MechaCPAN.pm  view on Meta::CPAN

=head2 --no-log

A log is normally outputted into the C<local/logs> directory. This option will prevent a log from being created.

=head2 --directory=<path>

Changes to a specified directory before any processing is done. This allows you to specify what directory you want C<local/> to be in. If this isn't provided, the current working directory is used instead.

=head2 --build-reusable-perl

Giving this options will override the mode of operation and generate a reusable, relocatable L<perl> archive. This accepts the same parameters as the L<Perl|App::MechaCPAN::Perl> command (i.e. L</devel> and L</threads>) to generate the binary. Note t...

Once you have a reusable binary archive, L<App::MechaCPAN::Perl> can use that archive as a source file and install the binaries into the local directory. This can be handy if you are building a lot of identical systems and only want to build L<perl> ...

The exact parameters included in the archive name are:

=over

=item * The version built

=item * The architecture name, as found in the first piece of $Config{archname}

lib/App/MechaCPAN/Perl.pm  view on Meta::CPAN


  my @config = (
    _build_configure( $perl_dir, $opts ),
    q[-Accflags=-DAPPLLIB_EXP=\"] . join( ":", @otherlib ) . q[\"],
    q{-Dstartperl='#!/usr/bin/env\ perl'},
    q{-Dperlpath='/usr/bin/env\ perl'},
    qq{-Dinstallprefix=/v$version},
    qq{-Dprefix=/v$version},
    q{-Dman1dir=.../../man/man1},
    q{-Dman3dir=.../../man/man3},
    q{-Duserelocatableinc},
  );

  if ( $opts->{threads} )
  {
    push @config, '-Dusethreads';
  }

  local %ENV = %ENV;
  delete @ENV{qw(PERL5LIB PERL5OPT)};
  $ENV{DESTDIR} = $perl_dir;

lib/App/MechaCPAN/Perl.pm  view on Meta::CPAN


  if ( !$skip_tests )
  {
    info $verstr, "Testing $verstr";
    _run_make('test_harness');
  }

  info $verstr, "Installing $verstr";
  _run_make('install');

  # Verify that the relocatable bits worked
  local $@;
  eval { _check_perl_binary("$perl_dir/v$version/bin/perl") };
  my $error = $@;
  if ($error)
  {
    die "The built relocatable binary appears broken: $error\n";
  }

  my $slugline = slugline("$perl_dir/v$version/bin/perl", undef, $opts->{threads});
  my $orig_dir = &get_project_dir;
  my $output   = "$slugline.tar.$compress";
  chdir $perl_dir;
  run("tar cf - v$version/ | $compress > $orig_dir/$output");

  success $verstr, "Created $verstr: $output";

t/11_perl.t  view on Meta::CPAN

chdir $pwd;
$tmpdir = tempdir( TEMPLATE => File::Spec->tmpdir . "/mechacpan_t_XXXXXXXX", CLEANUP => 1 );
chdir $tmpdir;

is(
  App::MechaCPAN::main(
    'perl',
    "$FindBin::Bin/../test_dists/FakePerlBin-5.12.0.tar.gz"
  ),
  0,
  'Can install "reusable/relocatbale perl" from a tar.gz'
);

chdir $pwd;
done_testing;

t/15_perl_reusable.t  view on Meta::CPAN

{
  Test::More::diag(@_);
};

is(
  App::MechaCPAN::main(
    '--build-reusable-perl',
    "$FindBin::Bin/../test_dists/FakePerl-5.12.0.tar.gz"
  ),
  0,
  'Can install "relocatable perl" from a tar.gz'
);

is(
  App::MechaCPAN::main(
    '--build-reusable-perl',
    'perl',
    "$FindBin::Bin/../test_dists/FakePerl-5.12.0.tar.gz"
  ),
  0,
  'Can also give the perl command without issue'



( run in 1.198 second using v1.01-cache-2.11-cpan-71847e10f99 )