From d81b5cc2a5193a344fc6f9cbf72d406d5597d85b Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 13 Nov 2018 23:17:02 -0500 Subject: scripts/meson: ensure wrapper scripts are executable --- scripts/meson.build | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/meson.build b/scripts/meson.build index aece7a22..344333be 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -52,21 +52,18 @@ foreach script : wrapped_scripts depend_files : library_files, build_by_default : true) + cdata = configuration_data() + cdata.set_quoted('BASH', BASH.path()) + cdata.set_quoted('BUILDDIR', meson.current_build_dir()) + cdata.set_quoted('REAL_PROGPATH', internal_script.full_path()) + # Create a wrapper script that bootstraps the real script within the build - # directory. - custom_target( - 'wrap_@0@'.format(script_shortname), + # directory. Use configure_file instead of a custom_target to ensure that + # permissions on the input script wrapper are preserved. + configure_file( input : join_paths(meson.source_root(), 'build-aux', 'script-wrapper.sh.in'), output : script_shortname, - build_by_default : true, - command : [ - SED, - '-e', 's,@BASH@,"@0@",'.format(BASH.path()), - '-e', 's,@BUILDDIR@,"@0@",'.format(meson.current_build_dir()), - '-e', 's,@REAL_PROGPATH@,"@0@",'.format(internal_script.full_path()), - '@INPUT@', - ], - capture : true) + configuration : cdata) # Install the real script meson.add_install_script(MESON_INSTALL_SCRIPT, -- cgit v1.2.3-54-g00ecf