Alien-Build
view release on metacpan or search on metacpan
lib/Alien/Build.pm view on Meta::CPAN
a method. For example, this will add a probe system requirement:
$build->meta->around_hook(
probe => sub {
my $orig = shift;
my $build = shift;
my $type = $orig->($build, @_);
return $type unless $type eq 'system';
# also require a configuration file
if(-f '/etc/foo.conf')
{
return 'system';
}
else
{
return 'share';
}
},
);
=head2 after_hook
$build->meta->after_hook($hook_name, sub {
my(@args) = @_;
...
});
Execute the given code reference after the hook. The original
arguments are passed into the code reference.
=head2 before_hook
$build->meta->before_hook($hook_name, sub {
my(@args) = @_;
...
});
Execute the given code reference before the hook. The original
arguments are passed into the code reference.
=head2 apply_plugin
Alien::Build->meta->apply_plugin($name);
Alien::Build->meta->apply_plugin($name, @args);
Apply the given plugin with the given arguments.
=head1 ENVIRONMENT
L<Alien::Build> responds to these environment variables:
=over 4
=item ALIEN_BUILD_LOG
The default log class used. See L<Alien::Build::Log> and L<Alien::Build::Log::Default>.
=item ALIEN_BUILD_PKG_CONFIG
Override the logic in L<Alien::Build::Plugin::PkgConfig::Negotiate> which
chooses the best C<pkg-config> plugin.
=item ALIEN_BUILD_POSTLOAD
semicolon separated list of plugins to automatically load after parsing
your L<alienfile>.
=item ALIEN_BUILD_PRELOAD
semicolon separated list of plugins to automatically load before parsing
your L<alienfile>.
=item ALIEN_BUILD_RC
Perl source file which can override some global defaults for L<Alien::Build>,
by, for example, setting preload and postload plugins.
=item ALIEN_DOWNLOAD_RULE
This value determines the rules by which types of downloads are allowed. The legal
values listed under L</download_rule>, plus C<default> which will be the default for
the current version of L<Alien::Build>. For this version that default is C<warn>.
=item ALIEN_INSTALL_NETWORK
If set to true (the default), then network fetch will be allowed. If set to
false, then network fetch will not be allowed.
What constitutes a local vs. network fetch is determined based on the C<start_url>
and C<local_source> meta properties. An L<alienfile> or plugin C<could> override
this detection (possibly inappropriately), so this variable is not a substitute
for properly auditing of Perl modules for environments that require that.
=item ALIEN_INSTALL_TYPE
If set to C<share> or C<system>, it will override the system detection logic.
If set to C<default>, it will use the default setting for the L<alienfile>.
The behavior of other values is undefined.
Although the recommended way for a consumer to use an L<Alien::Base> based L<Alien>
is to declare it as a static configure and build-time dependency, some consumers
may prefer to fallback on using an L<Alien> only when the consumer itself cannot
detect the necessary package. In some cases the consumer may want the user to opt-in
to using an L<Alien> before requiring it.
To keep the interface consistent among Aliens, the consumer of the fallback opt-in
L<Alien> may fallback on the L<Alien> if the environment variable C<ALIEN_INSTALL_TYPE>
is set to any value. The rationale is that by setting this environment variable the
user is aware that L<Alien> modules may be installed and have indicated consent.
The actual implementation of this, by its nature would have to be in the consuming
CPAN module.
=item DESTDIR
This environment variable will be manipulated during a destdir install.
=item PKG_CONFIG
This environment variable can be used to override the program name for C<pkg-config>
when using the command line plugin: L<Alien::Build::Plugin::PkgConfig::CommandLine>.
( run in 0.318 second using v1.01-cache-2.11-cpan-70e19b8f4f1 )