guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: gnu: gdm: Fix some run-time issues.


From: guix-commits
Subject: 03/03: gnu: gdm: Fix some run-time issues.
Date: Mon, 7 Sep 2020 07:55:31 -0400 (EDT)

dannym pushed a commit to branch wip-desktop
in repository guix.

commit 04963d4ca16f28a23b0b387f2703a2b7a859a19d
Author: Raghav Gururajan <raghavgururajan@disroot.org>
AuthorDate: Mon Sep 7 07:04:15 2020 -0400

    gnu: gdm: Fix some run-time issues.
    
    * gnu/packages/gnome.scm (gdm) 
[arguments]<#:phases>['install-placeholder-desktop-entry]: New phase.
    ['link-autostart-files]: New phase.
    
    Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
---
 gnu/packages/gnome.scm | 43 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index a1b8b27..410cc92 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -9500,7 +9500,48 @@ libxml2.")
                               "g_strcmp0(base_name, \"fail.desktop\") == 0)"))
               (("g_error [(]\"GdmSession: no session desktop files installed, 
aborting\\.\\.\\.\"[)];")
                "{ self->fallback_session_name = g_strdup(\"fail\"); goto out; 
}"))
-             #t)))))
+             #t))
+         ;; GDM requires that there be at least one desktop entry
+         ;; file.  This phase installs a hidden one that simply
+         ;; fails.  This enables users to use GDM with a
+         ;; '~/.xsession' script with no other desktop entry files.
+         ;; See <https://bugs.gnu.org/35068>.
+         (add-after 'install 'install-placeholder-desktop-entry
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (sessions (string-append out "/share/gdm/BuiltInSessions"))
+                    (fail (string-append sessions "/fail.desktop")))
+               (mkdir-p sessions)
+               (with-output-to-file fail
+                 (lambda ()
+                   (for-each
+                    display
+                    '("[Desktop Entry]\n"
+                      "Encoding=UTF-8\n"
+                      "Type=Application\n"
+                      "Name=Fail\n"
+                      "Comment=This session fails immediately.\n"
+                      "NoDisplay=true\n"
+                      "Exec=false\n"))))
+               #t)))
+         ;; GDM needs GNOME Session to run these applications.  We link
+         ;; their autostart files in `share/gdm/greeter/autostart'
+         ;; because GDM explicitly tells GNOME Session to look there.
+         ;;
+         ;; XXX: GNOME Shell should be linked here too, but currently
+         ;; GNOME Shell depends on GDM.
+         (add-after 'install 'link-autostart-files
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (autostart (string-append out "/share/gdm/"
+                                              "greeter/autostart"))
+                    (settings (assoc-ref inputs "gnome-settings-daemon")))
+               (mkdir-p autostart)
+               (with-directory-excursion autostart
+                 (for-each (lambda (desktop)
+                             (symlink desktop (basename desktop)))
+                           (find-files (string-append settings "/etc/xdg"))))
+               #t))))))
     (native-inputs
      `(("check" ,check)
        ("dconf" ,dconf)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]