GNU bug report logs - #75051
[PATCH 00/14] Add loongarch64 platform support.

Previous Next

Package: guix-patches;

Reported by: Zheng Junjie <873216071 <at> qq.com>

Date: Mon, 23 Dec 2024 17:04:01 UTC

Severity: normal

Tags: patch

Done: Z572 <z572 <at> z572.online>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
To: 75051 <at> debbugs.gnu.org
Cc: Zheng Junjie <873216071 <at> qq.com>
Subject: [bug#75051] [PATCH v2 08/15] gnu: readline: Fix build to loongarch64.
Date: Sat, 25 Jan 2025 00:39:06 +0800
From: Zheng Junjie <873216071 <at> qq.com>

* gnu/packages/readline.scm (readline)[arguments]: When target is loongarch64,
Add update-config-scripts phase.
[native-inputs]: When target is loongarch64, Add config.

Change-Id: Ie369d53c7f2493a7a65fe592a3671719dee264c0
---
 gnu/packages/readline.scm | 59 +++++++++++++++++++++++++--------------
 1 file changed, 38 insertions(+), 21 deletions(-)

diff --git a/gnu/packages/readline.scm b/gnu/packages/readline.scm
index 8200a24f1a1..42d8c6ed636 100644
--- a/gnu/packages/readline.scm
+++ b/gnu/packages/readline.scm
@@ -82,29 +82,46 @@ (define-public readline
     (build-system gnu-build-system)
     (propagated-inputs (list ncurses))
     (arguments
-     (list #:configure-flags
-           #~(list (string-append
-                    "LDFLAGS=-Wl,-rpath -Wl,"
-                    (dirname (search-input-file %build-inputs
-                                                "lib/libncurses.so")))
+     (append
+      (if (target-loongarch64?)
+          (list #:phases
+                #~(modify-phases %standard-phases
+                    (add-after 'unpack 'update-config-scripts
+                      (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                        ;; Replace outdated config.guess and config.sub.
+                        (for-each (lambda (file)
+                                    (install-file
+                                     (search-input-file
+                                      (or native-inputs inputs)
+                                      (string-append "/bin/" file)) "./support"))
+                                  '("config.guess" "config.sub"))))))
+          '())
+      (list #:configure-flags
+            #~(list (string-append
+                     "LDFLAGS=-Wl,-rpath -Wl,"
+                     (dirname (search-input-file %build-inputs
+                                                 "lib/libncurses.so")))
 
-                   ;; This test does an 'AC_TRY_RUN', which aborts when
-                   ;; cross-compiling, so provide the correct answer.
-                   #$@(if (%current-target-system)
-                          '("bash_cv_wcwidth_broken=no")
-                          '())
-                   ;; MinGW: ncurses provides the termcap api.
-                   #$@(if (target-mingw?)
-                          '("bash_cv_termcap_lib=ncurses")
-                          '()))
+                    ;; This test does an 'AC_TRY_RUN', which aborts when
+                    ;; cross-compiling, so provide the correct answer.
+                    #$@(if (%current-target-system)
+                           '("bash_cv_wcwidth_broken=no")
+                           '())
+                    ;; MinGW: ncurses provides the termcap api.
+                    #$@(if (target-mingw?)
+                           '("bash_cv_termcap_lib=ncurses")
+                           '()))
 
-           #:make-flags
-           (if (target-mingw?)
-               ;; MinGW: termcap in ncurses
-               ;; some SIG_* #defined in _POSIX
-               #~'("TERMCAP_LIB=-lncurses"
-                   "CPPFLAGS=-D_POSIX -D'chown(f,o,g)=0'")
-               #~'())))
+            #:make-flags
+            (if (target-mingw?)
+                ;; MinGW: termcap in ncurses
+                ;; some SIG_* #defined in _POSIX
+                #~'("TERMCAP_LIB=-lncurses"
+                    "CPPFLAGS=-D_POSIX -D'chown(f,o,g)=0'")
+                #~'()))))
+    (native-inputs (if (target-loongarch64?)
+                       (list config)
+                       '()))
     (synopsis "Edit command lines while typing, with history support")
     (description
      "The GNU readline library allows users to edit command lines as they
-- 
2.47.1





This bug report was last modified 81 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.