summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-08-09 10:24:42 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-08-28 22:10:20 -0400
commitda3c784c68d9d3d0ec12eaaa98deaaf51ddb4c36 (patch)
tree3bd685ec3f9ecd58630f283207f2ae518797e32e
parent0e76781df4be465caca9da59d467c926eb65a0da (diff)
downloadguix-da3c784c68d9d3d0ec12eaaa98deaaf51ddb4c36.tar.gz
gnu: lightdm: Apply patch to fix a problem with VNC integration.
* gnu/packages/patches/lightdm-vncserver-check.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/display-managers.scm (lightdm): Apply it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/display-managers.scm7
-rw-r--r--gnu/packages/patches/lightdm-vncserver-check.patch66
3 files changed, 71 insertions, 3 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 462aa7c731..6a55ecc8d8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1360,6 +1360,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/librime-fix-build-with-gcc10.patch	\
   %D%/packages/patches/libvirt-add-install-prefix.patch	\
   %D%/packages/patches/libziparchive-add-includes.patch		\
+  %D%/packages/patches/lightdm-vncserver-check.patch		\
   %D%/packages/patches/localed-xorg-keyboard.patch		\
   %D%/packages/patches/kdiagram-Fix-missing-link-libraries.patch \
   %D%/packages/patches/kiki-level-selection-crash.patch		\
diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm
index d6cf9445c6..022e0509aa 100644
--- a/gnu/packages/display-managers.scm
+++ b/gnu/packages/display-managers.scm
@@ -268,7 +268,8 @@ experience for your users, your family and yourself")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1wr60c946p8jz9kb8zi4cd8d4mkcy7infbvlfzwajiglc22nblxn"))))
+                "1wr60c946p8jz9kb8zi4cd8d4mkcy7infbvlfzwajiglc22nblxn"))
+              (patches (search-patches "lightdm-vncserver-check.patch"))))
     (build-system gnu-build-system)
     (arguments
      '(#:parallel-tests? #f             ; fails when run in parallel
@@ -303,8 +304,8 @@ experience for your users, your family and yourself")
              (unsetenv "LC_ALL"))))))
     (inputs
      (list audit
-           bash-minimal                           ;for cross-compilation
-           coreutils-minimal                      ;ditto
+           bash-minimal                 ;for cross-compilation
+           coreutils-minimal            ;ditto
            linux-pam
            shadow                       ;for sbin/nologin
            libgcrypt
diff --git a/gnu/packages/patches/lightdm-vncserver-check.patch b/gnu/packages/patches/lightdm-vncserver-check.patch
new file mode 100644
index 0000000000..0e31ff3d68
--- /dev/null
+++ b/gnu/packages/patches/lightdm-vncserver-check.patch
@@ -0,0 +1,66 @@
+Honor the Xvnc command specified in the config instead of using a hard-coded
+default.
+
+Submitted upstream at: https://github.com/canonical/lightdm/pull/265
+
+diff --git a/src/lightdm.c b/src/lightdm.c
+index 74f9ff2d..0ccfcd78 100644
+--- a/src/lightdm.c
++++ b/src/lightdm.c
+@@ -349,27 +349,42 @@ start_display_manager (void)
+     /* Start the VNC server */
+     if (config_get_boolean (config_get_instance (), "VNCServer", "enabled"))
+     {
+-        g_autofree gchar *path = g_find_program_in_path ("Xvnc");
+-        if (path)
++        /* Validate that a the VNC command is available. */
++        g_autofree gchar *command = config_get_string (config_get_instance (), "VNCServer", "command");
++        if (command)
+         {
+-            vnc_server = vnc_server_new ();
+-            if (config_has_key (config_get_instance (), "VNCServer", "port"))
++            g_auto(GStrv) tokens = g_strsplit (command, " ", 2);
++            if (!g_find_program_in_path (tokens[0]))
+             {
+-                gint port = config_get_integer (config_get_instance (), "VNCServer", "port");
+-                if (port > 0)
+-                    vnc_server_set_port (vnc_server, port);
++                g_warning ("Can't start VNC server; command '%s' not found", tokens[0]);
++                return;
+             }
+-            g_autofree gchar *listen_address = config_get_string (config_get_instance (), "VNCServer", "listen-address");
+-            vnc_server_set_listen_address (vnc_server, listen_address);
+-            g_signal_connect (vnc_server, VNC_SERVER_SIGNAL_NEW_CONNECTION, G_CALLBACK (vnc_connection_cb), NULL);
+-
+-            g_debug ("Starting VNC server on TCP/IP port %d", vnc_server_get_port (vnc_server));
+-            vnc_server_start (vnc_server);
+         }
+         else
+-            g_warning ("Can't start VNC server, Xvnc is not in the path");
++        {
++            /* Fallback to 'Xvnc'. */
++            if (!g_find_program_in_path ("Xvnc")) {
++                g_warning ("Can't start VNC server; 'Xvnc' command not found");
++                return;
++            }
++        }
++
++        vnc_server = vnc_server_new ();
++        if (config_has_key (config_get_instance (), "VNCServer", "port"))
++        {
++            gint port = config_get_integer (config_get_instance (), "VNCServer", "port");
++            if (port > 0)
++                vnc_server_set_port (vnc_server, port);
++        }
++        g_autofree gchar *listen_address = config_get_string (config_get_instance (), "VNCServer", "listen-address");
++        vnc_server_set_listen_address (vnc_server, listen_address);
++        g_signal_connect (vnc_server, VNC_SERVER_SIGNAL_NEW_CONNECTION, G_CALLBACK (vnc_connection_cb), NULL);
++
++        g_debug ("Starting VNC server on TCP/IP port %d", vnc_server_get_port (vnc_server));
++        vnc_server_start (vnc_server);
+     }
+ }
++
+ static void
+ service_ready_cb (DisplayManagerService *service)
+ {