diff mbox series

[bug#71327,v2,5/7] gnu: libblockdev: Use gexps.

Message ID 20241007201652.15133-6-ngraves@ngraves.fr
State New
Headers show
Series gnu: udisks: Update to 3.1.1. [security fixes] | expand

Commit Message

Nicolas Graves Oct. 7, 2024, 8:12 p.m. UTC
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>

* gnu/packages/disk.scm (libblockdev)
[phases]: Use gexps.
{patch-plugin-paths}: Use search-input-file.

Change-Id: I61f9b3dfdd4dc249fb0f59abb99826a8e759bb42
---
 gnu/packages/disk.scm | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index 1278eb2aca..e9b21763e1 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -1191,19 +1191,26 @@  (define-public libblockdev
                 "1ny2glwmb5dcdv2x0giinbyma9fhk59z8117k1kr15pm7yjk7jx5"))))
     (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")))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'patch-configuration-directory
+            (lambda _
               (substitute* "src/lib/blockdev.c"
-                (("/etc/libblockdev/conf.d/" path) (string-append out path))))))
-         (add-after 'unpack 'patch-plugin-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* (find-files "src/plugins" "\\.c$")
-               (("(gchar \\*arg.+\\{\")([^\"]+)" all start program)
-                ;; XXX: Use 'search-input-file' when available.
-                (string-append start (or (which program) program)))))))))
+                (("/etc/libblockdev/conf.d/" path)
+                 (string-append #$output path)))))
+          (add-after 'unpack 'patch-plugin-paths
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* (find-files "src/plugins" "\\.c$")
+                (("(gchar \\*arg.+\\{\")([^\"]+)" all start program)
+                 (string-append
+                  start (or (false-if-exception
+                             (search-input-file inputs
+                                                (string-append "bin/" program)))
+                            (false-if-exception
+                             (search-input-file inputs
+                                                (string-append "sbin/" program)))
+                            program)))))))))
     (native-inputs
      (list gobject-introspection
            pkg-config