Subject: Re: bug#51127: Acknowledgement (deja-dup cannot start a backup)

From: Vivien Kraus <[email-masked]>
Date: Thu, 14 Oct 2021 18:56:10 +0200

Le jeudi 14 octobre 2021 à 18:43 +0200, Vivien Kraus a écrit :
> So, I figured out the Gio backends for duplicity need a few tweaks.
> 
> You can test it by creating a stupid backup (backup any dir in /tmp).
> Now it works :)

Sorry, I forgot to run guix lint, and it said that I needed bash-
minimal as an input for wrapped programs.

> What do you think?
> Vivien

From 5eb63be36f0173eb5b177e57dcf11616c01d8a07 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 14 Oct 2021 17:30:09 +0200
Subject: [PATCH 3/3] gnu: deja-dup: let deja-dup find duplicity

* gnome.scm (deja-dup): wrap deja-dup to set PATH
---
 gnu/packages/gnome.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 17fb2e0146..a0af7b3777 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -1773,7 +1773,14 @@ (define-public deja-dup
            (lambda _
              (substitute* "data/post-install.sh"
                (("gtk-update-icon-cache") "true"))
-             #t)))))
+             #t))
+         (add-after 'install 'wrap-program
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; Add duplicity to the search path
+             (wrap-program (string-append (assoc-ref outputs "out")
+                                          "/bin/deja-dup")
+               `("PATH" ":" prefix
+                 (,(format #f "~a/bin" (assoc-ref inputs "duplicity"))))))))))
     (inputs
      `(("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
        ("duplicity" ,duplicity)
@@ -1785,7 +1792,8 @@ (define-public deja-dup
        ("libgpg-error" ,libgpg-error)
        ("libsecret" ,libsecret)
        ("libsoup" ,libsoup)
-       ("packagekit" ,packagekit)))
+       ("packagekit" ,packagekit)
+       ("bash-minimal" ,bash-minimal)))
     (native-inputs
      `(("appstream-glib" ,appstream-glib)
        ("desktop-file-utils" ,desktop-file-utils)
-- 
2.33.0

From 6e8a3455fc6d1a65debcf0b9c7e83d8832ce9671 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 14 Oct 2021 18:18:56 +0200
Subject: [PATCH 2/3] gnu: duplicity: depend on dbus

* gnu/packages/backup.scm (duplicity): add dbus ad an input
---
 gnu/packages/backup.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 407f6b7212..d1a718eab3 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -119,6 +119,7 @@ (define-public duplicity
     (inputs
      `(("librsync" ,librsync)
        ("lftp" ,lftp)
+       ("dbus" ,dbus)                   ; dbus-launch (Gio backend)
        ("gnupg" ,gnupg)                 ; gpg executable needed
        ("util-linux" ,util-linux)))     ; for setsid
     (arguments
@@ -130,7 +131,11 @@ (define-public duplicity
              (substitute* "duplicity/gpginterface.py"
                (("self.call = u'gpg'")
                 (string-append "self.call = '" (assoc-ref inputs "gnupg") "/bin/gpg'")))
-
+             (substitute* "duplicity/backends/giobackend.py"
+               (("subprocess.Popen\\(\\[u'dbus-launch'\\]")
+                (string-append "subprocess.Popen([u'"
+                               (assoc-ref inputs "dbus")
+                               "/bin/dbus-launch']")))
              (substitute* '("testing/functional/__init__.py"
                             "testing/overrides/bin/lftp")
                (("/bin/sh") (which "sh")))
-- 
2.33.0

From 14576b7216b7810168dcda328048417bbb9fa9cd Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Thu, 14 Oct 2021 17:18:29 +0200
Subject: [PATCH 1/3] gnu: duplicity: depend on pygobject

* gnu/packages/backup.scm (duplicity): add missing input.
---
 gnu/packages/backup.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index a3f98c95f9..407f6b7212 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -114,7 +114,8 @@ (define-public duplicity
        ("mock" ,python-mock)))
     (propagated-inputs
      `(("lockfile" ,python-lockfile)
-       ("urllib3" ,python-urllib3)))
+       ("urllib3" ,python-urllib3)
+       ("pygobject" ,python-pygobject)))
     (inputs
      `(("librsync" ,librsync)
        ("lftp" ,lftp)
-- 
2.33.0