diff options
| author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-08-09 10:24:42 -0400 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2022-08-28 22:10:20 -0400 |
| commit | da3c784c68d9d3d0ec12eaaa98deaaf51ddb4c36 (patch) | |
| tree | 3bd685ec3f9ecd58630f283207f2ae518797e32e | |
| parent | 0e76781df4be465caca9da59d467c926eb65a0da (diff) | |
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.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/display-managers.scm | 7 | ||||
| -rw-r--r-- | gnu/packages/patches/lightdm-vncserver-check.patch | 66 |
3 files changed, 71 insertions, 3 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 462aa7c7318..6a55ecc8d87 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -1360,6 +1360,7 @@ dist_patch_DATA = \ | |||
| 1360 | %D%/packages/patches/librime-fix-build-with-gcc10.patch \ | 1360 | %D%/packages/patches/librime-fix-build-with-gcc10.patch \ |
| 1361 | %D%/packages/patches/libvirt-add-install-prefix.patch \ | 1361 | %D%/packages/patches/libvirt-add-install-prefix.patch \ |
| 1362 | %D%/packages/patches/libziparchive-add-includes.patch \ | 1362 | %D%/packages/patches/libziparchive-add-includes.patch \ |
| 1363 | %D%/packages/patches/lightdm-vncserver-check.patch \ | ||
| 1363 | %D%/packages/patches/localed-xorg-keyboard.patch \ | 1364 | %D%/packages/patches/localed-xorg-keyboard.patch \ |
| 1364 | %D%/packages/patches/kdiagram-Fix-missing-link-libraries.patch \ | 1365 | %D%/packages/patches/kdiagram-Fix-missing-link-libraries.patch \ |
| 1365 | %D%/packages/patches/kiki-level-selection-crash.patch \ | 1366 | %D%/packages/patches/kiki-level-selection-crash.patch \ |
diff --git a/gnu/packages/display-managers.scm b/gnu/packages/display-managers.scm index d6cf9445c6b..022e0509aa2 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") | |||
| 268 | (file-name (git-file-name name version)) | 268 | (file-name (git-file-name name version)) |
| 269 | (sha256 | 269 | (sha256 |
| 270 | (base32 | 270 | (base32 |
| 271 | "1wr60c946p8jz9kb8zi4cd8d4mkcy7infbvlfzwajiglc22nblxn")))) | 271 | "1wr60c946p8jz9kb8zi4cd8d4mkcy7infbvlfzwajiglc22nblxn")) |
| 272 | (patches (search-patches "lightdm-vncserver-check.patch")))) | ||
| 272 | (build-system gnu-build-system) | 273 | (build-system gnu-build-system) |
| 273 | (arguments | 274 | (arguments |
| 274 | '(#:parallel-tests? #f ; fails when run in parallel | 275 | '(#:parallel-tests? #f ; fails when run in parallel |
| @@ -303,8 +304,8 @@ experience for your users, your family and yourself") | |||
| 303 | (unsetenv "LC_ALL")))))) | 304 | (unsetenv "LC_ALL")))))) |
| 304 | (inputs | 305 | (inputs |
| 305 | (list audit | 306 | (list audit |
| 306 | bash-minimal ;for cross-compilation | 307 | bash-minimal ;for cross-compilation |
| 307 | coreutils-minimal ;ditto | 308 | coreutils-minimal ;ditto |
| 308 | linux-pam | 309 | linux-pam |
| 309 | shadow ;for sbin/nologin | 310 | shadow ;for sbin/nologin |
| 310 | libgcrypt | 311 | libgcrypt |
diff --git a/gnu/packages/patches/lightdm-vncserver-check.patch b/gnu/packages/patches/lightdm-vncserver-check.patch new file mode 100644 index 00000000000..0e31ff3d68a --- /dev/null +++ b/gnu/packages/patches/lightdm-vncserver-check.patch | |||
| @@ -0,0 +1,66 @@ | |||
| 1 | Honor the Xvnc command specified in the config instead of using a hard-coded | ||
| 2 | default. | ||
| 3 | |||
| 4 | Submitted upstream at: https://github.com/canonical/lightdm/pull/265 | ||
| 5 | |||
| 6 | diff --git a/src/lightdm.c b/src/lightdm.c | ||
| 7 | index 74f9ff2d..0ccfcd78 100644 | ||
| 8 | --- a/src/lightdm.c | ||
| 9 | +++ b/src/lightdm.c | ||
| 10 | @@ -349,27 +349,42 @@ start_display_manager (void) | ||
| 11 | /* Start the VNC server */ | ||
| 12 | if (config_get_boolean (config_get_instance (), "VNCServer", "enabled")) | ||
| 13 | { | ||
| 14 | - g_autofree gchar *path = g_find_program_in_path ("Xvnc"); | ||
| 15 | - if (path) | ||
| 16 | + /* Validate that a the VNC command is available. */ | ||
| 17 | + g_autofree gchar *command = config_get_string (config_get_instance (), "VNCServer", "command"); | ||
| 18 | + if (command) | ||
| 19 | { | ||
| 20 | - vnc_server = vnc_server_new (); | ||
| 21 | - if (config_has_key (config_get_instance (), "VNCServer", "port")) | ||
| 22 | + g_auto(GStrv) tokens = g_strsplit (command, " ", 2); | ||
| 23 | + if (!g_find_program_in_path (tokens[0])) | ||
| 24 | { | ||
| 25 | - gint port = config_get_integer (config_get_instance (), "VNCServer", "port"); | ||
| 26 | - if (port > 0) | ||
| 27 | - vnc_server_set_port (vnc_server, port); | ||
| 28 | + g_warning ("Can't start VNC server; command '%s' not found", tokens[0]); | ||
| 29 | + return; | ||
| 30 | } | ||
| 31 | - g_autofree gchar *listen_address = config_get_string (config_get_instance (), "VNCServer", "listen-address"); | ||
| 32 | - vnc_server_set_listen_address (vnc_server, listen_address); | ||
| 33 | - g_signal_connect (vnc_server, VNC_SERVER_SIGNAL_NEW_CONNECTION, G_CALLBACK (vnc_connection_cb), NULL); | ||
| 34 | - | ||
| 35 | - g_debug ("Starting VNC server on TCP/IP port %d", vnc_server_get_port (vnc_server)); | ||
| 36 | - vnc_server_start (vnc_server); | ||
| 37 | } | ||
| 38 | else | ||
| 39 | - g_warning ("Can't start VNC server, Xvnc is not in the path"); | ||
| 40 | + { | ||
| 41 | + /* Fallback to 'Xvnc'. */ | ||
| 42 | + if (!g_find_program_in_path ("Xvnc")) { | ||
| 43 | + g_warning ("Can't start VNC server; 'Xvnc' command not found"); | ||
| 44 | + return; | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + vnc_server = vnc_server_new (); | ||
| 49 | + if (config_has_key (config_get_instance (), "VNCServer", "port")) | ||
| 50 | + { | ||
| 51 | + gint port = config_get_integer (config_get_instance (), "VNCServer", "port"); | ||
| 52 | + if (port > 0) | ||
| 53 | + vnc_server_set_port (vnc_server, port); | ||
| 54 | + } | ||
| 55 | + g_autofree gchar *listen_address = config_get_string (config_get_instance (), "VNCServer", "listen-address"); | ||
| 56 | + vnc_server_set_listen_address (vnc_server, listen_address); | ||
| 57 | + g_signal_connect (vnc_server, VNC_SERVER_SIGNAL_NEW_CONNECTION, G_CALLBACK (vnc_connection_cb), NULL); | ||
| 58 | + | ||
| 59 | + g_debug ("Starting VNC server on TCP/IP port %d", vnc_server_get_port (vnc_server)); | ||
| 60 | + vnc_server_start (vnc_server); | ||
| 61 | } | ||
| 62 | } | ||
| 63 | + | ||
| 64 | static void | ||
| 65 | service_ready_cb (DisplayManagerService *service) | ||
| 66 | { | ||
