From eaac9125a9dc9586752cccfc3cc551b0b9e3c2dd Mon Sep 17 00:00:00 2001 From: Orestis Floros Date: Mon, 19 Oct 2020 22:10:14 +0200 Subject: [PATCH] meson: Mark complete-run.pl as executable (#4224) Fixes problem described in https://github.com/i3/i3/issues/4086#issuecomment-711774506 --- meson.build | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index f5294936..0c3f14c9 100644 --- a/meson.build +++ b/meson.build @@ -598,18 +598,22 @@ install_headers( # because configure_file strips the backslash in e.g. \@display, # resulting in @display, breaking our Perl code: # https://github.com/mesonbuild/meson/issues/7165 -sed = find_program('sed') +bash = find_program('bash') replace_dirs = [ - sed, - '-e', - 's,@abs_top_builddir@,'+meson.current_build_dir()+',g;s,@abs_top_srcdir@,'+meson.current_source_dir()+',g', - '@INPUT@', + bash, '-c', # Use bash to capture output and mark as executable + 'sed -e \'s,@abs_top_builddir@,' + + meson.current_build_dir() + + ',g;s,@abs_top_srcdir@,' + + meson.current_source_dir()+',g\'' + # Only mark files ending in .pl as executables + + ' "$0" > "$1" && { [[ "${1##*.}" == pl ]] && chmod +x "$1" || true; }', + '@INPUT0@', # $0 + '@OUTPUT0@', # $1 ] complete_run = custom_target( 'complete-run', input: ['testcases/complete-run.pl.in'], output: ['complete-run.pl'], - capture: true, command: replace_dirs, # build this target when running e.g. ninja or ninja test. # This is required for older meson versions (< 0.46.0). @@ -619,7 +623,6 @@ i3test_pm = custom_target( 'i3test-pm', input: ['testcases/lib/i3test.pm.in'], output: ['i3test.pm'], - capture: true, command: replace_dirs, # build this target when running e.g. ninja or ninja test. # This is required for older meson versions (< 0.46.0).