Alien-Nodejs

 view release on metacpan or  search on metacpan

alienfile  view on Meta::CPAN


plugin 'Probe::CommandLine' => (
  command => 'node',
  args    => [ '--version' ],
  match   => qr/^v([0-9\.]+)$/,
  version => qr/^v([0-9\.]+)$/,
);


share {
  # Only supports binary style for now.
  # Will require Python for source install.
  start_url 'https://nodejs.org/en/download/';
  my $node_qr_prefix = qr/node-v([0-9\.]+)/;
  my $src_qr = qr/$node_qr_prefix\.tar\.gz/;
  my %os_arch_mapping = (
    "MSWin32:x86" => { name => 'win-x86', format => 'zip' },
    "MSWin32:x86_64" => { name => 'win-x64', format => 'zip' },
    "darwin:x86_64" => { name => 'darwin-x64', format => 'tar.gz' },
    "darwin:aarch64" => { name => 'darwin-arm64', format => 'tar.gz' },
    "linux:x86_64" => { name => 'linux-x64', format => 'tar.xz' },

alienfile  view on Meta::CPAN

  plugin Download => (
    filter  => qr/${node_qr_prefix}-\Q@{[ $os_arch_mapping{$os_arch}{name} ]}\E\.\Q@{[ $os_arch_mapping{$os_arch}{format} ]}\E/,
    version => qr/([0-9\.]+)/,
  );
  plugin Extract => $os_arch_mapping{$os_arch}{format};

  plugin 'Build::Copy';

  gather sub {
    my ($build) = @_;
    $build->runtime_prop->{'style'} = 'binary';
  };
}



( run in 0.584 second using v1.01-cache-2.11-cpan-49f99fa48dc )