Subject: [bug#78095] [PATCH 17/28] gnu: emacs-idris-mode: Partially enable tests.

From: Nicolas Graves <[email-masked]>
Date: Sun, 27 Apr 2025 16:52:51 +0200

* gnu/packages/emacs-xyz.scm (emacs-idris-mode):
  [arguments]<phases>: Add phase 'patch-test, and replace phase
  'check.
  [native-inputs]: Add idris.
---
 gnu/packages/emacs-xyz.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 43cd8e1330..c1069a7d6f 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -218,6 +218,7 @@ (define-module (gnu packages emacs-xyz)
   #:use-module (gnu packages graphviz)
   #:use-module (gnu packages haskell-apps)
   #:use-module (gnu packages ibus)
+  #:use-module (gnu packages idris)
   #:use-module (gnu packages java)
   #:use-module (gnu packages julia-xyz)
   #:use-module (gnu packages ncurses)
@@ -23862,6 +23863,28 @@ (define-public emacs-idris-mode
           (base32
            "1d1f7kx0fw632js7qd1sra5wbpwyamcqs5wpzhyynmr5ybb0vyl7"))))
       (build-system emacs-build-system)
+      (arguments
+       (list #:phases
+             #~(modify-phases %standard-phases
+                 (add-after 'unpack 'patch-tests
+                   (lambda _
+                     (substitute* "Makefile"
+                       (("^test(|2|3): getdeps build" all n)
+                        (string-append "test" n ":" )))))
+                 (replace 'check
+                   (lambda* (#:key tests? #:allow-other-keys)
+                     (if tests?
+                         (begin
+                           (setenv "HOME" (dirname (getcwd)))
+                           (invoke "make" "test")
+                           ;; XXX: History file not writable
+                           ;; (invoke "make" "test2")
+                           ;; XXX: Error reading from stdin
+                           ;; (invoke "make" "test3")
+                           )
+                         (format #t "test suite not run.~%")))))))
+      (native-inputs
+       (list idris))
       (propagated-inputs
        (list emacs-prop-menu))
       (home-page
-- 
2.49.0