Alien::Meson - Find or build meson build tool
Command line tool:
use Alien::Meson;
use Env qw( @PATH );
unshift @PATH, Alien::Meson->bin_dir;
system "@{[ Alien::Meson->exe ]}";
Use in alienfile:
share {
requires 'Alien::Meson';
requires 'Alien::Ninja';
# ...
my $build_dir = '_build';
build [
sub {
my $build = shift;
Alien::Build::CommandSequence->new([
Alien::Meson->exe, 'setup',
'--prefix=%{.install.prefix}',
$build_dir,
])->execute($build);
},
[ '%{ninja}', qw(-C), $build_dir, "test" ],
[ '%{ninja}', qw(-C), $build_dir, 'install' ],
];
}
This distribution provides meson so that it can be used by other Perl distributions that are on CPAN. It does this by first trying to detect an existing install of meson on your system. If found it will use that. If it cannot be found, the source code will be downloaded from the internet and it will be installed in a private share location for the use of other modules.
Alien::Meson->exe
Returns the command name for running meson.
use alienfile;
eval {
require Alien::Meson;
Alien::Meson->_apply_destdir_prefix_hack;
};
share { ... }
Applies a hack to fix how the DESTDIR
and prefix are joined to follow the
approach that Meson takes. See issue at PerlAlien/Alien-Build#407
for more information.
WARNING: This is a hack. It is not expected to work long-term and if a better solution is possible, it will be deprecated then removed.
%{meson}
WARNING: This interpolation is deprecated. This will be removed in a future
version as some share installs of Meson are not callable as a single executable
(they need to be prefixed with the Python interpreter). Instead use
Alien::Meson->exe
directly.
Returns 'meson', 'meson.py', or appropriate command for platform.
-
The Meson Build system home page.
-
Documentation on the Alien concept itself.
-
The base class for this Alien.
-
Alien::Build::Manual::AlienUser
Detailed manual for users of Alien classes.