Alien-Base-ModuleBuild
view release on metacpan or search on metacpan
differentiate. In some cases packages will not have a clear version
number, in which case the string unknown would be a reasonable choice.
The default implementation relies on pkg-config, and other heuristics,
but you will probably want to override this with your own
implementation if the package you are building does not use pkg-config.
When this method is called, the current working directory will be the
build root.
If you see an error message like this:
Library looks like it installed, but no version was determined
After the package is built from source code then you probably need to
provide an implementation for this method.
alien_extract_archive
[version 0.024]
lib/Alien/Base/ModuleBuild.pm view on Meta::CPAN
# check to see if Alien::Base::ModuleBuild is running from blib.
# if so it is likely that this is the blib scheme
(undef, my $dir, undef) = File::Spec->splitpath( __FILE__ );
my @dirs = File::Spec->splitdir($dir);
shift @dirs while @dirs && $dirs[0] ne 'blib';
return unless @dirs;
if ( $dirs[1] && $dirs[1] eq 'lib' ) {
print qq{'blib' scheme is detected. Setting ALIEN_BLIB=1. If this has been done in error, please set ALIEN_BLIB and restart build process to disambiguate.\n};
return 1;
}
carp q{'blib' scheme is suspected, but uncertain. Please set ALIEN_BLIB and restart build process to disambiguate. Setting ALIEN_BLIB=1 for now.};
return 1;
}
###################
# Build Methods #
###################
lib/Alien/Base/ModuleBuild.pm view on Meta::CPAN
In some cases packages will not have a clear version number, in which
case the string C<unknown> would be a reasonable choice.
The default implementation relies on C<pkg-config>, and other heuristics,
but you will probably want to override this with your own implementation
if the package you are building does not use C<pkg-config>.
When this method is called, the current working directory will be the
build root.
If you see an error message like this:
Library looks like it installed, but no version was determined
After the package is built from source code then you probably need to
provide an implementation for this method.
=head2 alien_extract_archive
[version 0.024]
lib/Alien/Base/ModuleBuild/FAQ.pod view on Meta::CPAN
)->create_build_script;
There are a couple of short cuts here, C<%c> indicates the platform independent method for executing the
C<configure> script, plus any normal autoconf flags that are appropriate for Perl Alien libraries. The C<%c>
also tells L<Alien::Base::ModuleBuild> to use L<Alien::MSYS> on Windows platforms and to add that as a
dependency. The C<%s> is a placeholder for the location to which the package will be installed. This is
normally in a share directory specific to your distribution.
=head3 autoconf-like
If you see an error like this:
Unknown option "--with-pic".
It may be because your package provides a C<configure> script that provides an autoconf-style interface, but is
not actually autoconf. L<Alien::Base::ModuleBuild> is aggressive in using the C<--with-pic> option because when
supported by autoconf it produces position independent code (important for reliably building XS extensions), and
when not supported autoconf simply ignores the option. Unfortunately some autoconf-style C<configure> scripts
consider it an error when they see options that they do not recognize. You can tell L<Alien::Base::ModuleBuild>
to not use the C<--with-pic> option via the C<alien_autoconf_with_pic> property:
# Build.PL
use Alien::Base::ModuleBuild;
Alien::Base::ModuleBuild->new(
...
alien_autoconf_with_pic => 0,
...
)->create_build_script;
lib/Alien/Base/ModuleBuild/Repository.pm view on Meta::CPAN
die "File fetch is insecure and has no digest. Required by ALIEN_DOWNLOAD_RULE=digest_or_encrypt.";
}
} elsif($rule eq 'digest_and_encrypt') {
unless($self->is_secure_fetch && $self->has_digest) {
die "File fetch is insecure and has no digest. Both are required by ALIEN_DOWNLOAD_RULE=digest_and_encrypt.";
}
} else {
die 'internal error';
}
my $pattern = $self->{pattern};
my @files;
if ($self->{exact_filename}) {
# if filename provided, use that specific file
@files = ($self->{exact_filename});
} else {
lib/Alien/Base/ModuleBuild/Repository/HTTP.pm view on Meta::CPAN
my $protocol = $self->protocol;
my $host = $self->{host};
my $from = $self->location;
my $uri = $self->build_uri($protocol, $host, $from, $file);
$file = ($uri->path_segments())[-1];
die "Attempted downgrad from https to http on URL $uri" if $self->is_secure_fetch && $uri !~ /^https:/;
my $res = $self->connection->mirror($uri, $file);
my ( $is_error, $content, $headers ) = $self->check_http_response( $res );
croak "Download failed: " . $content if $is_error;
my $disposition = $headers->{"content-disposition"};
if ( defined($disposition) && ($disposition =~ /filename="([^"]+)"/ || $disposition =~ /filename=([^\s]+)/)) {
my $new_filename = $1;
rename $file, $new_filename;
$self->{new_filename} = $new_filename;
}
return $file;
}
lib/Alien/Base/ModuleBuild/Repository/HTTP.pm view on Meta::CPAN
my $protocol = $self->protocol;
my $host = $self->host;
my $location = $self->location;
my $uri = $self->build_uri($protocol, $host, $location);
die "Attempted downgrad from https to http on URL $uri" if $self->is_secure_fetch && $uri !~ /^https:/;
my $res = $self->connection->get($uri);
my ( $is_error, $content, undef, $base_url ) = $self->check_http_response( $res );
if ( $is_error ) {
carp $content;
return ();
}
$self->{base_url} = $base_url;
my @links = $self->find_links($content);
return @links;
}
( run in 0.629 second using v1.01-cache-2.11-cpan-65fba6d93b7 )