From 8fa9ff20a80882868a28a6415c068e5376485b17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Sun, 5 Oct 2014 22:18:09 +0200
Subject: [PATCH] gnu: dbus: Create $out/etc/dbus-1/{system,session}.d to
 placate 'dbus-launch'.

* gnu/packages/glib.scm (dbus)[arguments]: Add 'post-install' phase.
---
 gnu/packages/glib.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index a414a9d9de2..662f5117627 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -73,7 +73,17 @@ (define dbus
                                ;; config.
                                ;; "--sysconfdir=/etc"
 
-                               "--with-session-socket-dir=/tmp")))
+                               "--with-session-socket-dir=/tmp")
+       #:phases (alist-cons-after
+                 'install 'post-install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   ;; 'dbus-launch' bails out if the 'session.d' directory
+                   ;; below is missing, so create it along with its companion.
+                   (let ((out (assoc-ref outputs "out")))
+                     (mkdir (string-append out "/etc/dbus-1/session.d"))
+                     (mkdir (string-append out "/etc/dbus-1/system.d"))
+                     #t))
+                 %standard-phases)))
     (inputs
      `(("expat" ,expat)
        ("pkg-config" ,pkg-config)
-- 
GitLab