Subject: bug#68082: closed (Re: [bug#68082] [PATCH] gnu: libmng: Fix cross-compiling to riscv64-linux.)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 29 Dec 2023 17:09:02 +0000

Your bug report

#68082: [PATCH] gnu: libmng: Fix cross-compiling to riscv64-linux.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
68082: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68082
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#68082] [PATCH] gnu: libmng: Fix cross-compiling to riscv64-linux.
From: Mathieu Othacehe <[email-masked]>
To: Zheng Junjie <[email-masked]>
Cc: [email-masked]
Date: Fri, 29 Dec 2023 18:08:29 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

> * gnu/packages/image.scm (libmng)
> [native-inputs]: When cross compiling to riscv64-linux-gnu, add config.
> [arguments]: When target riscv64-linux-gnu, add update-config-scripts phase.

Applied, thanks,

Mathieu

Subject: [PATCH] gnu: libmng: Fix cross-compiling to riscv64-linux.
From: Zheng Junjie <[email-masked]>
To: [email-masked]
Date: Thu, 28 Dec 2023 21:57:58 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/image.scm (libmng)
[native-inputs]: When cross compiling to riscv64-linux-gnu, add config.
[arguments]: When target riscv64-linux-gnu, add update-config-scripts phase.

Change-Id: I906a2b7b7691ae53592cfa35ba64fc7e7d735664
---
 gnu/packages/image.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index ebabd1c973..79f1a293ec 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -1483,6 +1483,26 @@ (define-public libmng
                (base32
                 "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija"))))
     (build-system gnu-build-system)
+    (arguments
+     (if (and (target-riscv64?)
+              (%current-target-system))
+         (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)) "."))
+                                 '("config.guess" "config.sub"))))))
+         '()))
+    (native-inputs
+     (if (and (target-riscv64?)
+              (%current-target-system))
+         (list config)
+         '()))
     (propagated-inputs
      ;; These are all in the 'Libs.private' field of libmng.pc.
      (list lcms libjpeg-turbo zlib))

base-commit: bc509aba838780502b83f7fc3d2aee72903656f2
-- 
2.41.0