Subject: [bug#75960] [PATCH] gnu: pantalaimon: Update to 257ef6a2e5e5668cd43347037c09ba036f91d997.

From: Ian Eure <[email-masked]>
Date: Thu, 30 Jan 2025 20:30:59 -0800

This package has been broken for a while, in a way that’s very annoying to
debug: the test suite hangs forever and the build times out.  It’s been asked
after in IRC, but no progress has been made.  I spent a solid two hours
fumbling around with it, and wasn’t able to get anywhere.  This package isn’t
using the same test setup as upstream, and can’t, because upstream is using
tox, which requires the network to do anything.

I can get the test suite to run by hand, but it doesn’t succeed.  I figure if
it’s not going to work by hand with network access, it’s very unlikely to work
in an isolated build environment.  A buildable package without tests seems
better to me than an unbuildable package with them; and this has been asked
after in IRC, so, this disables them.  It also removes the native-inputs they
needed, and the custom 'check phase.

Also, there’s been no release for three years; update to the current HEAD.
With this update, the appdirs hack isn’t needed, so that’s removed.  HEAD
also, for some reason, forbids matrix-nio 0.25.2 (the latest release), even
though this was changed in a routine dependency bump[1] which landed weeks
after 0.25.2 was released.  Allow that version.

* gnu/packages/matrix.scm (pantalaimon): Update to 257ef6a2e5e5668cd43347037c09ba036f91d997.

[1]: https://github.com/matrix-org/pantalaimon/pull/178

Change-Id: Idd2e940b5a36c72e116ad5e27a50c17eec6423e0
---
 gnu/packages/matrix.scm | 31 +++++++++++++------------------
 1 file changed, 13 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/matrix.scm b/gnu/packages/matrix.scm
index 8d1aca4b2e..032e2b44b0 100644
--- a/gnu/packages/matrix.scm
+++ b/gnu/packages/matrix.scm
@@ -228,7 +228,7 @@ (define-public python-matrix-nio
 (define-public pantalaimon
   (package
     (name "pantalaimon")
-    (version "0.10.5")
+    (version "257ef6a2e5e5668cd43347037c09ba036f91d997")
     (source
      (origin
        (method git-fetch)
@@ -238,36 +238,30 @@ (define-public pantalaimon
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "16ask8v00654q307c55q5gnm8hrj40gibpab5zl52v4i0bgl9j68"))))
+         "1i18mjlc143d2xwlha09i5ny06vipmy8fii05427zq5vjz8rysgx"))))
     (build-system python-build-system)
     (arguments
      (list
+      ;; Upstream uses tox for tests, which requires the network.  Disable
+      ;; them until someone can figure out how to make them work right.
+      #:tests? #f
       #:phases
       #~(modify-phases %standard-phases
-          (add-after 'unpack 'downgrade-appdirs-requirement
+          (add-after 'unpack 'relax-matrix-nio
             (lambda _
               (substitute* "setup.py"
-                ;; FIXME: Remove this once appdirs is updated.
-                ;; Upgrading python-appdirs requires rebuilting 3000+ packages,
-                ;; when 1.4.4 is a simple maintenance fix from 1.4.3.
-                (("appdirs >= 1.4.4") "appdirs >= 1.4.3"))))
+                ;; Relax matrix-nio dep, pantalaimon forbids the latest
+                ;; version for some reason.
+                (("matrix-nio\\[e2e\\] >= 0.24, < 0.25.2")
+                 "matrix-nio[e2e] >= 0.24, <= 0.25.2"))))
           (add-after 'install 'install-doc
             (lambda _
               (with-directory-excursion "docs/man"
                 (let ((man (string-append #$output "/share/man")))
                   (install-file "panctl.1" (string-append man "/man1"))
                   (install-file "pantalaimon.5" (string-append man "/man5"))
-                  (install-file "pantalaimon.8" (string-append man "/man8"))))))
-          (replace 'check
-            (lambda* (#:key tests? inputs outputs #:allow-other-keys)
-              (when tests?
-                (add-installed-pythonpath inputs outputs)
-                (invoke "pytest" "-vv" "tests")))))))
-    (native-inputs
-     (list python-aioresponses
-           python-faker
-           python-pytest
-           python-pytest-aiohttp))
+                  (install-file "pantalaimon.8" (string-append man "/man8")))))))))
+
     (propagated-inputs
      (list python-aiohttp
            python-appdirs
@@ -281,6 +275,7 @@ (define-public pantalaimon
            python-matrix-nio
            python-notify2
            python-peewee
+           python-platformdirs
            python-prompt-toolkit
            python-pydbus
            python-pygobject))
-- 
2.48.1