From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 57168@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#57168] [PATCH 09/14] gnu: lightdm: Apply patch to fix a problem with VNC integration.
Date: Sat, 13 Aug 2022 02:54:28 -0400 [thread overview]
Message-ID: <20220813065433.27319-9-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20220813065433.27319-1-maxim.cournoyer@gmail.com>
* 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.
---
gnu/local.mk | 1 +
gnu/packages/display-managers.scm | 7 +-
.../patches/lightdm-vncserver-check.patch | 66 +++++++++++++++++++
3 files changed, 71 insertions(+), 3 deletions(-)
create mode 100644 gnu/packages/patches/lightdm-vncserver-check.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index c2a33fa7d1..b1b0f7ac36 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1355,6 +1355,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 @@ (define-public lightdm
(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 @@ (define-public lightdm
(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)
+ {
--
2.36.1
next prev parent reply other threads:[~2022-08-13 6:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-13 6:50 [bug#57168] [PATCH 00/14] Add a LightDM service Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 01/14] services: configuration: Add a 'maybe-value-set?' procedure Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 02/14] gnu: accountsservice: Update to 22.08.8, enable doc and test suite Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 03/14] gnu: accountsservice: Provide a means to locate extensions Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 04/14] gnu: lightdm-gtk-greeter: Add GDK_PIXBUF_MODULE_FILE to wrapper Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 05/14] gnu: lightdm-gtk-greeter: Use the glib-or-gtk-wrap phase as-is Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 06/14] gnu: lightdm-gtk-greeter: Enable libklavier support Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 07/14] gnu: lightdm-gtk-greeter: Adjust default config file path Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 08/14] gnu: lightdm-gtk-greeter: Adjust --enable-at-spi-command value Maxim Cournoyer
2022-08-13 6:54 ` Maxim Cournoyer [this message]
2022-08-13 6:54 ` [bug#57168] [PATCH 10/14] gnu: lightdm: Apply patch to allow using VNC options Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 11/14] gnu: lightdm: Apply patch to fix color depth issue with VNC Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 12/14] marionette: Improve the error message of 'wait-for-screen-text' Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 13/14] build: marionette: Add support for Tesseract OCR Maxim Cournoyer
2022-08-13 6:54 ` [bug#57168] [PATCH 14/14] services: Add lightdm-service-type Maxim Cournoyer
2022-08-26 16:54 ` Maxime Devos
2022-08-29 2:33 ` bug#57168: [PATCH 00/14] Add a LightDM service Maxim Cournoyer
2022-08-30 19:44 ` [bug#57168] " Maxime Devos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220813065433.27319-9-maxim.cournoyer@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=57168@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).