Subject: [PATCH 5/5] gnu: libblockdev: Set default configuration directory.

From: Brice Waegeneire <[email-masked]>
Date: Thu, 14 May 2020 00:25:42 +0200

Fix error from 'udisks': “Failed to get contents of the config
dir (/etc/libblockdev/conf.d/)Error opening directory
"/etc/libblockdev/conf.d/": No such file or directory.”

* gnu/packages/disk.scm (libblockdev)[arguments]: Add phase
'patch-configuration-directory'.
---
 gnu/packages/disk.scm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index 346a912cf4..a5f4d4f7a6 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -802,6 +802,14 @@ to create devices with respective mappings for the ATARAID sets discovered.")
                (base32
                 "15c7g2gbkahmy8c6677pvbvblan5h8jxcqqmn6nlvqwqynq2mkjm"))))
     (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-configuration-directory
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+              (substitute* "src/lib/blockdev.c"
+               (("/etc/libblockdev/conf.d/" path) (string-append out path)))))))))
     (native-inputs
      `(("gobject-introspection" ,gobject-introspection)
        ("pkg-config" ,pkg-config)
-- 
2.26.2