Subject: [PATCH v2 13/65] gnu: astroid: Remove custom phases.

From: Greg Hogan <[email-masked]>
Date: Tue, 22 Oct 2024 18:09:03 +0000

* gnu/packages/mail.scm (astroid):
[origin]: Remove bugfix resolved upstream.
[arguments]<#:parallel-tests?>: Disable.
<#:test-exclude>: Move exclusions from 'skip-markdown-test phase to here
and delete 'skip-markdown-test phase.
<#:generator>: Add.
<#:phases>: Remove custom 'build, 'check, and 'install.
[native-inputs]: Remove ninja.
---
 gnu/packages/mail.scm | 38 +++++++++-----------------------------
 1 file changed, 9 insertions(+), 29 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index ead8740627..a0257f9c90 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -953,49 +953,30 @@ (define-public astroid
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "17m99llggkg7xg72k8xaf7iipax7sgfhqa2a1qnlylndwa42f57b"))
-       (modules '((guix build utils)))
-       (snippet
-        '(begin
-           ;; https://github.com/astroidmail/astroid/pull/685
-           (substitute* "tests/test_composed_message.cc"
-             (("\\\\n\\.\\.\\.") "\\n...\\n"))))))
+        (base32 "17m99llggkg7xg72k8xaf7iipax7sgfhqa2a1qnlylndwa42f57b"))))
     (build-system cmake-build-system)
     (arguments
-     `(#:modules ((guix build cmake-build-system)
+     `(#:parallel-tests? #f
+       ;; This test relies on the plugins and the test suite
+       ;; cannot find the Astroid module.
+       ;;  gi.require_version ('Astroid', '0.2')
+       ;; ValueError: Namespace Astroid not available
+       #:test-exclude "markdown"
+       #:modules ((guix build cmake-build-system)
                   ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
                   (guix build utils)
                   (ice-9 match))
        #:imported-modules ((guix build glib-or-gtk-build-system)
                            ,@%cmake-build-system-modules)
-       #:configure-flags (list "-GNinja")
+       #:generator "Ninja"
        #:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'skip-markdown-test
-           ;; This test relies on the plugins and the test suite
-           ;; cannot find the Astroid module.
-           ;;  gi.require_version ('Astroid', '0.2')
-           ;; ValueError: Namespace Astroid not available
-           (lambda _
-             (substitute* "tests/CMakeLists.txt"
-               ((".*markdown.*") ""))))
-         (replace 'build
-           (lambda _
-             (invoke "ninja" "-j" (number->string (parallel-job-count)))))
          (add-before 'check 'start-xserver
            (lambda* (#:key inputs #:allow-other-keys)
              (let ((xorg-server (assoc-ref inputs "xorg-server")))
                (setenv "HOME" (getcwd))
                (system (format #f "~a/bin/Xvfb :1 &" xorg-server))
                (setenv "DISPLAY" ":1"))))
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
-               (invoke "ctest" "."))))
-         (replace 'install
-           (lambda _
-             (invoke "ninja" "install")))
          (add-after 'install 'wrap-with-GI_TYPELIB_PATH
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out"))
@@ -1018,7 +999,6 @@ (define-public astroid
      (list glib-networking
            gsettings-desktop-schemas
            gnupg
-           ninja
            pkg-config
            ronn
            w3m
-- 
2.46.1