guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 14321bbbe38f1e3e26fae4d019468c5896e7bd18
Author: Maxim Cournoyer <[email protected]>
AuthorDate: Sat Sep 19 13:36:22 2026 +0900

    services/elogind: Fix build for ungrafted elogind.
    
    This is a follow-up to commit
    8c97e09b36691db5a4c165da4a33bdee87ea92f6 ("services: elogind: Re-introduce
    login1.service wrapper.").  Tested with:
    
      GUIX_BUILD_OPTIONS= make check-system TESTS=elogind
      GUIX_BUILD_OPTIONS=--no-grafts make check-system TESTS=elogind
    
    * gnu/services/desktop.scm (elogind-dbus-service) [!service-directory]: 
Avoid
    copying/patching nonexistent files.
    
    Reported-by: Dariqq <[email protected]>
---
 gnu/services/desktop.scm | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 5e74e451831..67abffe6708 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2015 Andy Wingo <[email protected]>
 ;;; Copyright © 2015 Mark H Weaver <[email protected]>
 ;;; Copyright © 2016 Sou Bunnbu <[email protected]>
-;;; Copyright © 2017, 2020, 2022, 2023, 2025 Maxim Cournoyer 
<[email protected]>
+;;; Copyright © 2017, 2020, 2022, 2023, 2025-2026 Maxim Cournoyer 
<[email protected]>
 ;;; Copyright © 2017 Nikita <[email protected]>
 ;;; Copyright © 2017, 2019 Hartmut Goebel <[email protected]>
 ;;; Copyright © 2018, 2020, 2022, 2025 Efraim Flashner <[email protected]>
@@ -1733,9 +1733,16 @@ started~%")
           (define service-directory
             "/share/dbus-1/system-services")
 
+          (define elogind-service-directory
+            (string-append #$elogind service-directory))
+
           (mkdir-p (dirname (string-append #$output service-directory)))
-          (copy-recursively (string-append #$elogind service-directory)
-                            (string-append #$output service-directory))
+
+          ;; TODO: Remove (when (file-exists? elogind-service-directory)
+          ;; conditionals after elogind is ungrafted.
+          (when (file-exists? elogind-service-directory)
+            (copy-recursively elogind-service-directory
+                              (string-append #$output service-directory)))
           (symlink (string-append #$elogind "/etc") ;for etc/dbus-1
                    (string-append #$output "/etc"))
           ;; Also expose the D-Bus policy configurations (.conf) files, now
@@ -1745,11 +1752,12 @@ started~%")
 
           ;; Replace the "Exec=" line of the 'org.freedesktop.login1.service'
           ;; file with one that refers to WRAPPER instead of elogind.
-          (match (find-files #$output "\\.service$")
-            ((file)
-             (substitute* file
-               (("Exec[[:blank:]]*=.*" _)
-                (string-append "Exec=" #$wrapper "\n"))))))))
+          (when (file-exists? elogind-service-directory)
+            (match (find-files #$output "\\.service$")
+              ((file)
+               (substitute* file
+                 (("Exec[[:blank:]]*=.*" _)
+                  (string-append "Exec=" #$wrapper "\n")))))))))
 
   (list (computed-file "elogind-dbus-service-wrapper" build)))
 

Reply via email to