From a92aec4fbb287c2ebb79f3d3406668086057ce20 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 11 Mar 2020 16:48:25 +0100 Subject: [PATCH] Stop searching for Xvnc Assume we are part of a complete and proper installation and encode the full expected path in to the vncserver script. --- unix/vncserver/CMakeLists.txt | 3 ++- unix/vncserver/{vncserver => vncserver.in} | 31 +--------------------- 2 files changed, 3 insertions(+), 31 deletions(-) rename unix/vncserver/{vncserver => vncserver.in} (95%) diff --git a/unix/vncserver/CMakeLists.txt b/unix/vncserver/CMakeLists.txt index e048aaf8..9f085e0d 100644 --- a/unix/vncserver/CMakeLists.txt +++ b/unix/vncserver/CMakeLists.txt @@ -1,6 +1,7 @@ configure_file(vncserver@.service.in vncserver@.service @ONLY) +configure_file(vncserver.in vncserver @ONLY) -install(PROGRAMS vncserver DESTINATION ${BIN_DIR}) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/vncserver DESTINATION ${BIN_DIR}) install(FILES vncserver.man DESTINATION ${MAN_DIR}/man1 RENAME vncserver.1) install(FILES vncserver-config-defaults vncserver-config-mandatory DESTINATION ${SYSCONF_DIR}/tigervnc) diff --git a/unix/vncserver/vncserver b/unix/vncserver/vncserver.in similarity index 95% rename from unix/vncserver/vncserver rename to unix/vncserver/vncserver.in index 4a1a58b2..0b1e9a9e 100755 --- a/unix/vncserver/vncserver +++ b/unix/vncserver/vncserver.in @@ -28,12 +28,6 @@ # # First make sure we're operating in a sane environment. -$exedir = ""; -$slashndx = rindex($0, "/"); -if($slashndx>=0) { - $exedir = substr($0, 0, $slashndx+1); -} - &SanityCheck(); # @@ -253,7 +247,7 @@ push(@cmd, $Xsession, $session{'Exec'}); push(@cmd, '--'); # We build up our Xvnc command with options -push(@cmd, $exedir."Xvnc", ":$displayNumber"); +push(@cmd, "@BIN_DIR@/Xvnc", ":$displayNumber"); foreach my $k (sort keys %config) { push(@cmd, "-$k"); @@ -481,29 +475,6 @@ sub SanityCheck die "$prog: Couldn't find suitable Xsession.\n"; } - if($exedir eq "") { - cmd2: - foreach $cmd ("Xvnc","vncpasswd") { - for (split(/:/,$ENV{PATH})) { - if (-x "$_/$cmd") { - next cmd2; - } - } - die "$prog: couldn't find \"$cmd\" on your PATH.\n"; - } - } - else { - cmd3: - foreach $cmd ($exedir."Xvnc",$exedir."vncpasswd") { - for (split(/:/,$ENV{PATH})) { - if (-x "$cmd") { - next cmd3; - } - } - die "$prog: couldn't find \"$cmd\".\n"; - } - } - if (!defined($ENV{HOME})) { die "$prog: The HOME environment variable is not set.\n"; } -- 2.39.5