Subject: [bug#50091] [PATCH 05/21] gnu: guile: Fix building on riscv64-linux.

From: Efraim Flashner <[email-masked]>
Date: Tue, 17 Aug 2021 13:19:03 +0300

* gnu/packages/guile.scm (guile-3.0)[arguments]: On riscv64-linux add
a phase to skip a failing test.
---
 gnu/packages/guile.scm | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index fffc30f913..f9a7125f83 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -65,7 +65,8 @@
   #:use-module (guix deprecation)
   #:use-module (guix utils)
   #:use-module (ice-9 match)
-  #:use-module ((srfi srfi-1) #:prefix srfi-1:))
+  #:use-module ((srfi srfi-1) #:prefix srfi-1:)
+  #:use-module (srfi srfi-26))
 
 ;;; Commentary:
 ;;;
@@ -346,14 +347,17 @@ without requiring the source code to be rewritten.")
                        ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45214
                        (substitute* "bootstrap/Makefile.in"
                          (("^GUILE_OPTIMIZATIONS.*")
-                          "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n"))))
-                   (add-after 'unpack 'skip-failing-fdes-test
-                     (lambda _
-                       ;; ERROR: ((system-error "seek" "~A" ("Bad file descriptor") (9)))
-                       (substitute* "test-suite/tests/ports.test"
-                         (("fdes not closed\"" all) (string-append all "(exit 77)")))
-                       #t)))
-                 '())))))
+                          "GUILE_OPTIMIZATIONS = -O1 -Oresolve-primitives -Ocps\n")))))
+                 '())
+           ,@(if (srfi-1:any (cute string-prefix? <> (%current-system))
+                             '("powerpc-" "riscv64-"))
+               `((add-after 'unpack 'skip-failing-fdes-test
+                   (lambda _
+                     ;; ERROR: ((system-error "seek" "~A" ("Bad file descriptor") (9)))
+                     (substitute* "test-suite/tests/ports.test"
+                       (("fdes not closed\"" all) (string-append all "(exit 77)")))
+                     #t)))
+               '())))))
 
     (native-search-paths
      (list (search-path-specification
-- 
2.32.0