summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOrestis Floros <orestisflo@gmail.com>2020-10-19 22:10:14 +0200
committerGitHub <noreply@github.com>2020-10-19 22:10:14 +0200
commiteaac9125a9dc9586752cccfc3cc551b0b9e3c2dd (patch)
tree36eac44be5b2ce5c98d8b50d7af66bf0b1c0d0e6
parent3b2f15e61309c605d97ac2950a90579ec6418b42 (diff)
downloadi3-eaac9125a9dc9586752cccfc3cc551b0b9e3c2dd.tar.gz
i3-eaac9125a9dc9586752cccfc3cc551b0b9e3c2dd.zip
meson: Mark complete-run.pl as executable (#4224)
Fixes problem described in https://github.com/i3/i3/issues/4086#issuecomment-711774506
-rw-r--r--meson.build17
1 files 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).