Alien-Build

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

  - Fixed windows + autoconf regression

0.46      2017-06-22 13:02:52 -0400
  - Added Alien::Build::Plugin::Fetch::PromptBeforeDownload
  - Fixed typo in Alien::Build::Plugin::GnuWin32

0.45      2017-06-16 13:36:36 -0400
  - Documentation improvements

0.44      2017-06-12 10:52:08 -0400
  - Decode::HTML plugin unescapes URI encoded filenames, as it should (kiwiroy++ gh#17)

0.43      2017-06-11 21:23:55 -0400
  - Fix documentaton coverage for Alien::*::Install::Files
  - Additional fixes for Alien::*::Install::Files support

0.42      2017-06-11 09:09:55 -0400
  - Added Gather::IsolateDynamic plugin
  - This version includes The Answer to Life, the Universe and Everything.

0.41      2017-06-10 19:03:49 -0400

lib/Alien/Base.pm  view on Meta::CPAN


sub split_flags_unix {
  my ($class, $line) = @_;
  shellwords($line);
}

sub split_flags_windows {
  # NOTE a better approach would be to write a function that understands cmd.exe metacharacters.
  my ($class, $line) = @_;

  # Double the backslashes so that when they are unescaped by shellwords(),
  # they become a single backslash. This should be fine on Windows since
  # backslashes are not used to escape metacharacters in cmd.exe.
  $line =~ s,\\,\\\\,g;
  shellwords($line);
}


sub dynamic_libs {
  my ($class) = @_;

  require FFI::CheckLib;

lib/Alien/Build/Plugin/Build/SearchDep.pm  view on Meta::CPAN


  $meta->after_hook(
    gather_share => sub {
      my($build) = @_;

      $build->runtime_prop->{libs}        = '' unless defined $build->runtime_prop->{libs};
      $build->runtime_prop->{libs_static} = '' unless defined $build->runtime_prop->{libs_static};

      if($self->public_l)
      {
        $build->runtime_prop->{$_} = join(' ', _space_escape(@{ $build->install_prop->{plugin_build_searchdep_libs} })) . ' ' . $build->runtime_prop->{$_}
          for qw( libs libs_static );
      }

      $build->runtime_prop->{$_} = join(' ', _space_escape(@{ $build->install_prop->{plugin_build_searchdep_ldflags} })) . ' ' . $build->runtime_prop->{$_}
        for qw( libs libs_static );

      if($self->public_I)
      {
        $build->runtime_prop->{cflags}        = '' unless defined $build->runtime_prop->{cflags};
        $build->runtime_prop->{cflags_static} = '' unless defined $build->runtime_prop->{cflags_static};
        $build->runtime_prop->{$_} = join(' ', _space_escape(@{ $build->install_prop->{plugin_build_searchdep_cflags} })) . ' ' . $build->runtime_prop->{$_}
          for qw( cflags cflags_static );
      }
    },
  );
}

sub _space_escape
{
  map {
    my $str = $_;
    $str =~ s{(\s)}{\\$1}g;
    $str;
  } @_;
}

1;

lib/Alien/Build/Plugin/Decode/HTML.pm  view on Meta::CPAN

        $base = URI->new($links{href});
      }
      elsif($tag eq 'a' && $links{href})
      {
        my $href = $links{href};
        return if $href =~ m!^\.\.?/?$!;
        my $url = URI->new_abs($href, $base);
        my $path = $url->path;
        $path =~ s{/$}{}; # work around for Perl 5.8.7- gh#8
        push @list, {
          filename => URI::Escape::uri_unescape(File::Basename::basename($path)),
          url      => URI::Escape::uri_unescape($url->as_string),
        };
      }
    });

    $p->parse($res->{content});

    return {
      type => 'list',
      list => \@list,
    };

lib/Alien/Build/Plugin/Decode/Mojo.pm  view on Meta::CPAN

    {
      my $href = $base_element->attr('href');
      $base = URI->new($href) if defined $href;
    }

    my @list = map {
                 my $url = URI->new_abs($_, $base);
                 my $path = $url->path;
                 $path =~ s{/$}{}; # work around for Perl 5.8.7- gh#8
                 {
                   filename => URI::Escape::uri_unescape(File::Basename::basename($path)),
                   url      => URI::Escape::uri_unescape($url->as_string),
                 }
               }
               grep !/^\.\.?\/?$/,
               map { $_->attr('href') || () }
               @{ $dom->find('a')->to_array };

    return {
      type => 'list',
      list => \@list,
    };

lib/Alien/Build/Plugin/Fetch/Local.pm  view on Meta::CPAN

    my($build, $path, %options) = @_;

    $build->log("plugin Fetch::Local does not support http_headers option") if $options{http_headers};

    $path ||= $self->url;

    if($path =~ /^file:/)
    {
      my $root = URI::file->new($self->root);
      my $url = URI->new_abs($path, $root);
      $path = URI::Escape::uri_unescape($url->path);
      $path =~ s{^/([a-z]:)}{$1}i if $^O eq 'MSWin32';
    }

    $path = Path::Tiny->new($path)->absolute($self->root);

    if(-d $path)
    {
      return {
        type     => 'list',
        protocol => 'file',

lib/Test/Alien.pm  view on Meta::CPAN

}


sub run_ok
{
  my($command, $message) = @_;

  my(@command) = ref $command ? @$command : (do {
    my $command = $command; # make a copy

    # Double the backslashes so that when they are unescaped by shellwords(),
    # they become a single backslash. This should be fine on Windows since
    # backslashes are not used to escape metacharacters in cmd.exe.
    $command =~ s/\\/\\\\/g if $^O eq 'MSWin32';
    shellwords $command;
  });
  $message ||= ref $command ? "run @command" : "run $command";

  require Test::Alien::Run;
  my $run = bless {
    out    => '',
    err    => '',
    exit   => 0,

t/bin/httpd  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;
use Path::Tiny qw( path );
use Getopt::Long qw( GetOptions );
use URI;
use URI::Escape qw( uri_unescape );
use JSON::PP qw( encode_json decode_json );
use HTTP::Server::PSGI;
use Plack::Builder;
use Plack::App::Directory;


my $daemon = 0;
my $kill   = 0;
my $host   = 'localhost';

t/bin/httpd  view on Meta::CPAN

my $app = builder {
  mount '/corpus/dist/test1/' => sub {
    my $env = shift;
    my %headers;
    foreach my $key (keys %$env)
    {
      next unless $key =~ /^HTTP_(.*)$/;
      my $name = join '-', map { ucfirst $_ }map { lc $_ } split /_/, $1;
      $headers{$name} = $env->{$key};
    }
    my $uri = URI->new($env->{'psgi.url_scheme'} . '://' . $env->{SERVER_NAME} . uri_unescape($env->{REQUEST_URI}), $env->{'psgi.url_scheme'});
    $uri->port($env->{SERVER_PORT});

    my %query;
    my @query = $uri->query_form;
    while(@query)
    {
      my $key = shift @query;
      my $value = shift @query;
      push @{ $query{$key} }, $value;
    }



( run in 0.514 second using v1.01-cache-2.11-cpan-c21f80fb71c )