Subject: [PATCH 1/2] gnu: libblockdev: Embed executable paths.

From: Sarah Morgensen <[email-masked]>
Date: Sat, 25 Sep 2021 14:28:01 -0700

Fixes <https://bugs.gnu.org/33896>.

* gnu/packages/disk.scm (libblockdev)[arguments]<#:phases>: Add
'patch-plugin-paths' phase.
---
 gnu/packages/disk.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index 7d6f3811dd..f3a7eb7617 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -21,6 +21,7 @@
 ;;; Copyright © 2021 Michael Rohleder <[email-masked]>
 ;;; Copyright © 2021 Mathieu Othacehe <[email-masked]>
 ;;; Copyright © 2021 Brice Waegeneire <[email-masked]>
+;;; Copyright © 2021 Sarah Morgensen <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -940,7 +941,13 @@ to create devices with respective mappings for the ATARAID sets discovered.")
            (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)))))))))
+                (("/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)))))))))
     (native-inputs
      `(("gobject-introspection" ,gobject-introspection)
        ("pkg-config" ,pkg-config)

base-commit: 69f37702dfcda776a190d5c40fad8518469ce3c4
-- 
2.33.0