Subject: [PATCH] gnu: deluge: Backport fix for deluge-console.
From: Tomas Volf <[email-masked]>
To: [email-masked]
Cc: Tomas Volf <[email-masked]>
Date: Sun, 30 Mar 2025 23:22:13 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Without this fix, the command is not usable from scripting, since it always
fails to report the result with:

    <Deferred at 0x7f29b3879780 current result: None>

Upstream already has a fix, and it will be present in 2.1.2, so let us
backport it for now.

* gnu/packages/bittorrent.scm (deluge)[arguments]<#:phases>: Add
'fix-deluge-console.

Change-Id: Ifdbcb541aeefbc727890cec2356d346c7fa1dd5d
---
I am not sure whether we usually backport fixes, but I needed this to get
deluge-console working for me, so I might as well send it.  Feel free to close
if it goes against some policy.

 gnu/packages/bittorrent.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gnu/packages/bittorrent.scm b/gnu/packages/bittorrent.scm
index e946660ab7..05bea4c533 100644
--- a/gnu/packages/bittorrent.scm
+++ b/gnu/packages/bittorrent.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2023 Clément Lassieur <[email-masked]>
 ;;; Copyright © 2024 Noisytoot <[email-masked]>
 ;;; Copyright © 2024 Zheng Junjie <[email-masked]>
+;;; Copyright © 2025 Tomas Volf <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -628,6 +629,12 @@ (define-public deluge
      `(#:tests? #f
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'fix-deluge-console
+           (lambda _
+             ;; Backport patch for: https://dev.deluge-torrent.org/ticket/3582
+             (substitute* "deluge/ui/console/__init__.py"
+               (("    return Console\\(\\).start\\(\\)")
+                "    Console().start()"))))
          (add-after 'install 'wrap
            (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
              (let ((out               (assoc-ref outputs "out"))
--
2.48.1