Subject: [WIP v2 3/4] Vorta: patch Borg invocation

From: Leo Famulari <[email-masked]>
Date: Sun, 19 Dec 2021 13:56:25 -0500

---
 gnu/packages/backup.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 5ce6e10bab..e2a37d182b 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -1207,6 +1207,13 @@ (define-public vorta
                   ((guix build qt-build-system) #:prefix qt:))
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'patch-borg-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((borg (string-append (assoc-ref inputs "borg")
+                                        "/bin/borg")))
+               (substitute* "src/vorta/borg/borg_job.py"
+                 (("which\\('borg'\\)")
+                  (string-append "which('" borg "')"))))))
          ;; XXX This phase tries to write to $HOME
          (add-before 'sanity-check 'set-HOME
            (lambda _
@@ -1220,7 +1227,8 @@ (define-public vorta
             python-pytest-runner
             python-setuptools-git))
     (inputs
-      (list python-appdirs
+      (list borg
+            python-appdirs
             python-dateutil
             python-keyring
             python-paramiko
-- 
2.34.0