[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/04: gnu: gdm: Don't offer GNOME when it's not in the system profile.
From: |
guix-commits |
Subject: |
02/04: gnu: gdm: Don't offer GNOME when it's not in the system profile. |
Date: |
Sat, 11 Apr 2020 18:20:31 -0400 (EDT) |
civodul pushed a commit to branch version-1.1.0
in repository guix.
commit f4ec5e1a9823a66c27fe2bc033db7b58b29edfef
Author: Ludovic Courtès <address@hidden>
AuthorDate: Sat Apr 11 23:58:49 2020 +0200
gnu: gdm: Don't offer GNOME when it's not in the system profile.
Fixes <https://bugs.gnu.org/37831>.
Reported by Pierre Neidhardt <address@hidden>.
* gnu/packages/patches/gdm-default-session.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/gnome.scm (gdm)[source]: Use it.
---
gnu/local.mk | 1 +
gnu/packages/gnome.scm | 3 +-
gnu/packages/patches/gdm-default-session.patch | 91 ++++++++++++++++++++++++++
3 files changed, 94 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 73f9d5d..0117a43 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -932,6 +932,7 @@ dist_patch_DATA =
\
%D%/packages/patches/gd-CVE-2019-6978.patch \
%D%/packages/patches/gd-fix-tests-on-i686.patch \
%D%/packages/patches/gd-freetype-test-failure.patch \
+ %D%/packages/patches/gdm-default-session.patch \
%D%/packages/patches/geoclue-config.patch \
%D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \
%D%/packages/patches/ghc-diff-swap-cover-args.patch \
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 088de7d..63dd8dc 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -6776,7 +6776,8 @@ libxml2.")
name "-" version ".tar.xz"))
(sha256
(base32
- "12ypdz9i24hwbl1d1wnnxb8zlvfa4f49n9ac5cl9d6h8qp4b0gb4"))))
+ "12ypdz9i24hwbl1d1wnnxb8zlvfa4f49n9ac5cl9d6h8qp4b0gb4"))
+ (patches (search-patches "gdm-default-session.patch"))))
(build-system glib-or-gtk-build-system)
(arguments
'(#:configure-flags
diff --git a/gnu/packages/patches/gdm-default-session.patch
b/gnu/packages/patches/gdm-default-session.patch
new file mode 100644
index 0000000..4839a04
--- /dev/null
+++ b/gnu/packages/patches/gdm-default-session.patch
@@ -0,0 +1,91 @@
+This patch ensures '.desktop' files are picked up in the system profile
+and not in the directories listed in $XDG_DATA_DIRS. The latter includes
+'gnome-session.desktop', which should be used if it's in
+/run/current-system/profile, and only then.
+
+Fixes <https://bugs.gnu.org/37831>.
+
+diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
+index 6a116a8..02c1458 100644
+--- a/daemon/gdm-session.c
++++ b/daemon/gdm-session.c
+@@ -348,24 +348,18 @@ get_system_session_dirs (GdmSession *self)
+ GArray *search_array = NULL;
+ char **search_dirs;
+ int i;
+- const gchar * const *system_data_dirs = g_get_system_data_dirs ();
+
+ static const char *x_search_dirs[] = {
+ "/etc/X11/sessions/",
+ DMCONFDIR "/Sessions/",
+ DATADIR "/gdm/BuiltInSessions/",
+- DATADIR "/xsessions/",
++ "/run/current-system/profile/share/xsessions/"
+ };
+
+ static const char *wayland_search_dir = DATADIR "/wayland-sessions/";
+
+ search_array = g_array_new (TRUE, TRUE, sizeof (char *));
+
+- for (i = 0; system_data_dirs[i]; i++) {
+- gchar *dir = g_build_filename (system_data_dirs[i],
"xsessions", NULL);
+- g_array_append_val (search_array, dir);
+- }
+-
+ g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS
(x_search_dirs));
+
+ #ifdef ENABLE_WAYLAND_SUPPORT
+@@ -373,16 +367,7 @@ get_system_session_dirs (GdmSession *self)
+ #ifdef ENABLE_USER_DISPLAY_SERVER
+ g_array_prepend_val (search_array, wayland_search_dir);
+
+- for (i = 0; system_data_dirs[i]; i++) {
+- gchar *dir = g_build_filename (system_data_dirs[i],
"wayland-sessions", NULL);
+- g_array_insert_val (search_array, i, dir);
+- }
+ #else
+- for (i = 0; system_data_dirs[i]; i++) {
+- gchar *dir = g_build_filename (system_data_dirs[i],
"wayland-sessions", NULL);
+- g_array_append_val (search_array, dir);
+- }
+-
+ g_array_append_val (search_array, wayland_search_dir);
+ #endif
+ }
+diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
+index afbc5c0..bb5e3e6 100644
+--- a/libgdm/gdm-sessions.c
++++ b/libgdm/gdm-sessions.c
+@@ -238,19 +238,11 @@ collect_sessions (void)
+ "/etc/X11/sessions/",
+ DMCONFDIR "/Sessions/",
+ DATADIR "/gdm/BuiltInSessions/",
+- DATADIR "/xsessions/",
+- NULL
++ "/run/current-system/profile/share/xsessions/"
+ };
+
+ xorg_search_array = g_array_new (TRUE, TRUE, sizeof (char *));
+
+- const gchar * const *system_data_dirs = g_get_system_data_dirs ();
+-
+- for (i = 0; system_data_dirs[i]; i++) {
+- session_dir = g_build_filename (system_data_dirs[i],
"xsessions", NULL);
+- g_array_append_val (xorg_search_array, session_dir);
+- }
+-
+ g_array_append_vals (xorg_search_array, xorg_search_dirs,
G_N_ELEMENTS (xorg_search_dirs));
+
+ #ifdef ENABLE_WAYLAND_SUPPORT
+@@ -261,11 +253,6 @@ collect_sessions (void)
+
+ wayland_search_array = g_array_new (TRUE, TRUE, sizeof (char *));
+
+- for (i = 0; system_data_dirs[i]; i++) {
+- session_dir = g_build_filename (system_data_dirs[i],
"wayland-sessions", NULL);
+- g_array_append_val (wayland_search_array, session_dir);
+- }
+-
+ g_array_append_vals (wayland_search_array, wayland_search_dirs,
G_N_ELEMENTS (wayland_search_dirs));
+ #endif
+