From 82d2156ba7b4e592a2ceb5da767b690862852caa Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Thu, 25 Mar 2021 22:51:39 +0200 Subject: [PATCH] xfree86: Fix meson overwriting suid wrapper with the wrapped executable Meson gets confused when there are two targets of the same name within the same directory, so we use a different intermediate name. This is a problem with the Xorg SUID wrapper which has the same filename as the real Xorg executable and is configured in the same meson.build file. This commit works around this by using a different filename in build stage and renaming only when installing. Signed-off-by: Povilas Kanapickas --- hw/xfree86/meson.build | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/meson.build b/hw/xfree86/meson.build index c2b5088ba..18ff27c83 100644 --- a/hw/xfree86/meson.build +++ b/hw/xfree86/meson.build @@ -148,11 +148,20 @@ if get_option('suid_wrapper') install_dir: get_option('libexecdir'), # install_mode: ['r-sr-xr-x', 0, 0], ) - configure_file( + + # meson gets confused when there are two targets of the same name + # within the same directory, so we use a different intermediate name. + xorg_sh = configure_file( input: 'Xorg.sh.in', - output: 'Xorg', + output: 'Xorg.sh', configuration: conf_data, + ) + + install_data( + xorg_sh, + install_mode: 'rwxr-xr-x', install_dir: join_paths(get_option('prefix'), get_option('bindir')), + rename: ['Xorg'] ) endif