[bug#34470,2/8] gnu: gnome-session: Use absolute paths in .desktop files.

Message ID 20190213192221.26599-2-samplet@ngyro.com
State Accepted
Commit 1d7bff4b4bdd60dfb3fb8150418e1a82c0ff2679
Headers show
Series GDM without GNOME Desktop | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied

Commit Message

Timothy Sample Feb. 13, 2019, 7:22 p.m. UTC
This makes the gnome-session .desktop files usable even if gnome-session
is not available from the PATH variable.

* gnu/packages/gnome.scm (gnome-session)[arguments]: Add a phase that
adds the absolute path of gnome-session in its .desktop files.
---
 gnu/packages/gnome.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index b2c7aa60cc..59e1011a8f 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -4575,6 +4575,14 @@  such as gzip tarballs.")
                    (out  (assoc-ref outputs "out")))
                (wrap-program (string-append out "/bin/gnome-session")
                  `("PATH" ":" prefix (,(string-append glib "/bin"))))
+               #t)))
+         (add-after 'install 'add-absolute-paths-to-desktop-files
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (substitute* (map (lambda (x)
+                                   (string-append out "/share/xsessions/" x))
+                                 '("gnome.desktop" "gnome-xorg.desktop"))
+                 (("gnome-session") (string-append out "/bin/gnome-session")))
                #t))))
 
        #:configure-flags