Alien-Build
view release on metacpan or search on metacpan
lib/Alien/Build.pm view on Meta::CPAN
Directory with patches, if available. This will be C<undef> if there
are no patches. When initially installing an alien this will usually
be a sibling of the C<alienfile>, a directory called C<patch>. Once
installed this will be in the share directory called C<_alien/patch>.
The former is useful for rebuilding an alienized package using
L<af>.
=item prefix
The install time prefix. Under a C<destdir> install this is the
same as the runtime or final install location. Under a non-C<destdir>
install this is the C<stage> directory (usually the appropriate
share directory under C<blib>).
=item root
The build root directory. This will be an absolute path. It is the
absolute form of C<./_alien> by default.
=item stage
The stage directory where files will be copied. This is usually the
root of the blib share directory.
=item system_probe_class
After the probe step this property may contain the plugin class that
performed the system probe. It shouldn't be filled in directly by
the plugin (instead if should use the hook property C<probe_class>,
see below). This is optional, and not all probe plugins will provide
this information.
=item system_probe_instance_id
After the probe step this property may contain the plugin instance id that
performed the system probe. It shouldn't be filled in directly by
the plugin (instead if should use the hook property C<probe_instance_id>,
see below). This is optional, and not all probe plugins will provide
this information.
=back
=head2 plugin_instance_prop
my $href = $build->plugin_instance_prop($plugin);
This returns the private plugin instance properties for a given plugin.
This method should usually only be called internally by plugins themselves
to keep track of internal state. Because the content can be used arbitrarily
by the owning plugin because it is private to the plugin, and thus is not
part of the L<Alien::Build> spec.
=head2 runtime_prop
my $href = $build->runtime_prop;
Runtime properties are used during the install and runtime phases
(either under C<share> or C<system> install). This should include
anything that you will need to know to use the library or tool
during runtime, and shouldn't include anything that is no longer
relevant once the install process is complete.
=over 4
=item alien_build_version
The version of L<Alien::Build> used to install the library or tool.
=item alt
Alternate configurations. If the alienized package has multiple
libraries this could be used to store the different compiler or
linker flags for each library. Typically this will be set by a
plugin in the gather stage (for either share or system installs).
=item cflags
The compiler flags. This is typically set by a plugin in the
gather stage (for either share or system installs).
=item cflags_static
The static compiler flags. This is typically set by a plugin in the
gather stage (for either share or system installs).
=item command
The command name for tools where the name my differ from platform to
platform. For example, the GNU version of make is usually C<make> in
Linux and C<gmake> on FreeBSD. This is typically set by a plugin in the
gather stage (for either share or system installs).
=item ffi_name
The name DLL or shared object "name" to use when searching for dynamic
libraries at runtime. This is passed into L<FFI::CheckLib>, so if
your library is something like C<libarchive.so> or C<archive.dll> you
would set this to C<archive>. This may be a string or an array of
strings. This is typically set by a plugin in the gather stage
(for either share or system installs).
=item ffi_checklib
This property contains two sub properties:
=over 4
=item ffi_checklib.share
$build->runtime_prop->{ffi_checklib}->{share} = [ ... ];
Array of additional L<FFI::CheckLib> flags to pass in to C<find_lib>
for a C<share> install.
=item ffi_checklib.system
Array of additional L<FFI::CheckLib> flags to pass in to C<find_lib>
for a C<system> install.
Among other things, useful for specifying the C<try_linker_script>
flag:
lib/Alien/Build.pm view on Meta::CPAN
=item perl_module_version
The version of the Perl module used to install the alien (if available).
For example if L<Alien::curl> is installing C<libcurl> this would be the
version of L<Alien::curl> used during the install step.
=item prefix
The final install root. This is usually they share directory.
=item version
The version of the library or tool. This is typically set by a plugin in the
gather stage (for either share or system installs).
=back
=head2 hook_prop
my $href = $build->hook_prop;
Hook properties are for the currently running (if any) hook. They are
used only during the execution of each hook and are discarded after.
If no hook is currently running then C<hook_prop> will return C<undef>.
=over 4
=item name
The name of the currently running hook.
=item version (probe)
Probe and PkgConfig plugins I<may> set this property indicating the
version of the alienized package. Not all plugins and configurations
may be able to provide this.
=item probe_class (probe)
Probe and PkgConfig plugins I<may> set this property indicating the
plugin class that made the probe. If the probe results in a system
install this will be propagated to C<system_probe_class> for later
use.
=item probe_instance_id (probe)
Probe and PkgConfig plugins I<may> set this property indicating the
plugin instance id that made the probe. If the probe results in a
system install this will be propagated to C<system_probe_instance_id>
for later use.
=back
=head1 METHODS
=head2 checkpoint
$build->checkpoint;
Save any install or runtime properties so that they can be reloaded on
a subsequent run in a separate process. This is useful if your build
needs to be done in multiple stages from a C<Makefile>, such as with
L<ExtUtils::MakeMaker>. Once checkpointed you can use the C<resume>
constructor (documented above) to resume the probe/build/install]
process.
=head2 root
my $dir = $build->root;
This is just a shortcut for:
my $root = $build->install_prop->{root};
Except that it will be created if it does not already exist.
=head2 install_type
my $type = $build->install_type;
This will return the install type. (See the like named install property
above for details). This method will call C<probe> if it has not already
been called.
=head2 is_system_install
my $boolean = $build->is_system_install;
Returns true if the alien is a system install type.
=head2 is_share_install
my $boolean = $build->is_share_install;
Returns true if the alien is a share install type.
=head2 download_rule
my $rule = $build->download_rule;
This returns install rule as a string. This is determined by the environment
and should be one of:
=over 4
=item C<warn>
Warn only if fetching via non secure source (secure sources include C<https>,
and bundled files, may include other encrypted protocols in the future).
=item C<digest>
Require that any downloaded source package have a cryptographic signature in
the L<alienfile> and that signature matches what was downloaded.
=item C<encrypt>
Require that any downloaded source package is fetched via secure source.
=item C<digest_or_encrypt>
Require that any downloaded source package is B<either> fetched via a secure source
B<or> has a cryptographic signature in the L<alienfile> and that signature matches
what was downloaded.
( run in 0.669 second using v1.01-cache-2.11-cpan-3d66aa2751a )