Alien-Build
view release on metacpan or search on metacpan
lib/Alien/Build.pm view on Meta::CPAN
=head2 fetch
my $res = $build->fetch;
my $res = $build->fetch($url, %options);
Fetch a resource using the fetch hook. Returns the same hash structure
described below in the
L<fetch hook|Alien::Build::Manual::PluginAuthor/"fetch hook"> documentation.
[version 2.39]
As of L<Alien::Build> 2.39, these options are supported:
=over 4
=item http_headers
my $res = $build->fetch($url, http_headers => [ $key1 => $value1, $key2 => $value 2, ... ]);
Set the HTTP request headers on all outgoing HTTP requests. Note that not all
protocols or fetch plugins support setting request headers, but the ones that
do not I<should> issue a warning if you try to set request headers and they
are not supported.
=back
=head2 check_digest
[experimental]
my $bool = $build->check_digest($path);
Checks any cryptographic signatures for the given file. The
file is specified by C<$path> which may be one of:
=over 4
=item string
Containing the path to the file to be checked.
=item L<Path::Tiny>
Containing the path to the file to be checked.
=item C<HASH>
A Hash reference containing information about a file. See
the L<fetch hook|Alien::Build::Manual::PluginAuthor/"fetch hook"> for details
on the format.
=back
Returns true if the cryptographic signature matches, false if cryptographic
signatures are disabled. Will throw an exception if the signature does not
match, or if no plugin provides the correct algorithm for checking the
signature.
=head2 decode
my $decoded_res = $build->decode($res);
Decode the HTML or file listing returned by C<fetch>. Returns the same
hash structure described below in the
L<decode hook|Alien::Build::Manual::PluginAuthor/"decode hook"> documentation.
=head2 prefer
my $sorted_res = $build->prefer($res);
Filter and sort candidates. The preferred candidate will be returned first in the list.
The worst candidate will be returned last. Returns the same hash structure described
below in the
L<prefer hook|Alien::Build::Manual::PluginAuthor/"prefer hook"> documentation.
=head2 extract
my $dir = $build->extract;
my $dir = $build->extract($archive);
Extracts the given archive into a fresh directory. This is normally called internally
to L<Alien::Build>, and for normal usage is not needed from a plugin or L<alienfile>.
=head2 build
$build->build;
Run the build step. It is expected that C<probe> and C<download>
have already been performed. What it actually does depends on the
type of install:
=over 4
=item share
The source is extracted, and built as determined by the L<alienfile>
recipe. If there is a C<gather_share> that will be executed last.
=item system
The
L<gather_system hook|Alien::Build::Manual::PluginAuthor/"gather_system hook">
will be executed.
=back
=head2 test
$build->test;
Run the test phase
=head2 clean_install
$build->clean_install
Clean files from the final install location. The default implementation removes all
files recursively except for the C<_alien> directory. This is helpful when you have
an old install with files that may break the new build.
For a non-share install this doesn't do anything.
( run in 0.958 second using v1.01-cache-2.11-cpan-411bb0df24b )