diff --git a/Changes b/Changes index 78acaf4..5e7a835 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for {{$dist->name}} {{$NEXT}} + - Deprecate interpolation of `%{meson}`. 0.04 2023-10-28 21:26:14-04:00 America/New_York - Fix missing $VERSION. diff --git a/lib/Alien/Meson.pm b/lib/Alien/Meson.pm index 217f143..ef1afed 100644 --- a/lib/Alien/Meson.pm +++ b/lib/Alien/Meson.pm @@ -21,6 +21,27 @@ Command line tool: unshift @PATH, Alien::Meson->bin_dir; system "@{[ Alien::Meson->exe ]}"; +Use in L: + + 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' ], + ]; + } + =head1 DESCRIPTION This distribution provides meson so that it can be used by other @@ -74,6 +95,11 @@ sub bin_dir { %{meson} +B: 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 +C<< Alien::Meson->exe >> directly. + Returns 'meson', 'meson.py', or appropriate command for platform. @@ -82,6 +108,7 @@ platform. sub alien_helper { return +{ meson => sub { + warn "Interpolation of %{meson} is deprecated. See POD for Alien::Meson."; join " ", Alien::Meson->exe; }, }; diff --git a/t/alien_meson.t b/t/alien_meson.t index 1990557..d404728 100644 --- a/t/alien_meson.t +++ b/t/alien_meson.t @@ -12,8 +12,10 @@ diag "Alien::Meson->runtime_prop ", Dumper( [ Alien::Meson->runtime_prop ] ); diag "Alien::Meson->exe: ", Dumper( [ Alien::Meson->exe ] ); -helper_ok 'meson'; -interpolate_template_is '%{meson}', join " ", Alien::Meson->exe; +like warning { + helper_ok 'meson'; + interpolate_template_is '%{meson}', join " ", Alien::Meson->exe; +}, qr/deprecated/, 'helper is deprecated'; run_ok([ Alien::Meson->exe, qw(--version) ]) ->success