From be2b2fe254b72d439246a6f01aa5a84972fa1e00 Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Sat, 28 Oct 2023 23:01:44 -0400 Subject: [PATCH 1/2] Deprecate interpolation of `%{meson}` --- Changes | 1 + lib/Alien/Meson.pm | 6 ++++++ t/alien_meson.t | 6 ++++-- 3 files changed, 11 insertions(+), 2 deletions(-) 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..81e45c5 100644 --- a/lib/Alien/Meson.pm +++ b/lib/Alien/Meson.pm @@ -74,6 +74,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 +87,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 From bb52cf07f53eb9bbfdf497eef3ae0f1487d0fd70 Mon Sep 17 00:00:00 2001 From: Zakariyya Mughal Date: Sun, 29 Oct 2023 14:44:50 -0400 Subject: [PATCH 2/2] Add example of use with alienfile --- lib/Alien/Meson.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/Alien/Meson.pm b/lib/Alien/Meson.pm index 81e45c5..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