GNU bug report logs - #62432
[PATCH] gnu: libicns: fix riscv64 cross-build.

Previous Next

Package: guix-patches;

Reported by: Z572 <873216071 <at> qq.com>

Date: Sat, 25 Mar 2023 04:52:02 UTC

Severity: normal

Tags: patch

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62432 in the body.
You can then email your comments to 62432 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#62432; Package guix-patches. (Sat, 25 Mar 2023 04:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Z572 <873216071 <at> qq.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 25 Mar 2023 04:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Z572 <873216071 <at> qq.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: libicns: fix riscv64 cross-build.
Date: Sat, 25 Mar 2023 12:50:59 +0800
* gnu/packages/image.scm (libicns): fix riscv64 cross-build.
[arguments]: when target-riscv64, add phase to update-config-scripts
[native-inputs]: when target-riscv64, add config.
---
 gnu/packages/image.scm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 0da990e63a..81cdcd778e 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -549,6 +549,22 @@ (define-public libicns
                (base32
                 "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"))))
     (build-system gnu-build-system)
+    (arguments (if (target-riscv64?)
+                   (list #:phases
+                         #~(modify-phases %standard-phases
+                             (add-after 'unpack 'update-config-scripts
+                               (lambda* (#:key native-inputs inputs #:allow-other-keys)
+                                 (for-each (lambda (file)
+                                             (install-file
+                                              (search-input-file
+                                               (or native-inputs inputs)
+                                               (string-append "/bin/" file)) "."))
+                                           '("config.guess" "config.sub"))))) )
+                   '()))
+    (native-inputs
+     (if (target-riscv64?)
+         (list config)
+         '()))
     (inputs
      (list libpng jasper))
     (home-page "https://icns.sourceforge.io/")
-- 
2.39.2





Information forwarded to guix-patches <at> gnu.org:
bug#62432; Package guix-patches. (Mon, 03 Apr 2023 11:04:01 GMT) Full text and rfc822 format available.

Message #8 received at 62432 <at> debbugs.gnu.org (full text, mbox):

From: 宋文武 <iyzsong <at> envs.net>
To: Z572 <873216071 <at> qq.com>
Cc: 62432 <at> debbugs.gnu.org
Subject: Re: bug#62432: [PATCH] gnu: libicns: fix riscv64 cross-build.
Date: Mon, 03 Apr 2023 19:04:18 +0800
Z572 <873216071 <at> qq.com> writes:

> * gnu/packages/image.scm (libicns): fix riscv64 cross-build.

Hello, this message is already in the commit message title, So I think
there is no need to repeat it here.  Also look in the guix commit log,
I think it should be 'gnu: libicns: Fix cross-compilation for riscv64'.


> +    (arguments (if (target-riscv64?)
> +                   (list #:phases
> +                         #~(modify-phases %standard-phases
> +                             (add-after 'unpack 'update-config-scripts
> +                               (lambda* (#:key native-inputs inputs #:allow-other-keys)
> +                                 (for-each (lambda (file)
> +                                             (install-file
> +                                              (search-input-file
> +                                               (or native-inputs inputs)
> +                                               (string-append "/bin/" file)) "."))
> +                                           '("config.guess" "config.sub"))))) )
> +                   '()))
> +    (native-inputs
> +     (if (target-riscv64?)
> +         (list config)
> +         '()))

This updates 'config.guess' and 'config.sub' in a package to fix
cross-compilation for riscv64 seems like a common practice (eg: also in
your patches #62433, #62544).  How about make a procedure for it to
save some typing?  It could be:

```
(define (autotools-config-updated-package p)
  "Return package P with @command{config.guess} and
@command{config.sub} updated by the @code{config} package"
  (package (inherit p)
    ...))
```

Which could go into (guix transformations).




Reply sent to Efraim Flashner <efraim <at> flashner.co.il>:
You have taken responsibility. (Sun, 04 Jun 2023 12:30:04 GMT) Full text and rfc822 format available.

Notification sent to Z572 <873216071 <at> qq.com>:
bug acknowledged by developer. (Sun, 04 Jun 2023 12:30:04 GMT) Full text and rfc822 format available.

Message #13 received at 62432-done <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: 宋文武 <iyzsong <at> envs.net>
Cc: 62432-done <at> debbugs.gnu.org, Z572 <873216071 <at> qq.com>
Subject: Re: [bug#62432] [PATCH] gnu: libicns: fix riscv64 cross-build.
Date: Sun, 4 Jun 2023 15:29:45 +0300
[Message part 1 (text/plain, inline)]
On Mon, Apr 03, 2023 at 07:04:18PM +0800, 宋文武 via Guix-patches via wrote:
> Z572 <873216071 <at> qq.com> writes:
> 
> > * gnu/packages/image.scm (libicns): fix riscv64 cross-build.
> 
> Hello, this message is already in the commit message title, So I think
> there is no need to repeat it here.  Also look in the guix commit log,
> I think it should be 'gnu: libicns: Fix cross-compilation for riscv64'.
> 
> 
> > +    (arguments (if (target-riscv64?)
> > +                   (list #:phases
> > +                         #~(modify-phases %standard-phases
> > +                             (add-after 'unpack 'update-config-scripts
> > +                               (lambda* (#:key native-inputs inputs #:allow-other-keys)
> > +                                 (for-each (lambda (file)
> > +                                             (install-file
> > +                                              (search-input-file
> > +                                               (or native-inputs inputs)
> > +                                               (string-append "/bin/" file)) "."))
> > +                                           '("config.guess" "config.sub"))))) )
> > +                   '()))
> > +    (native-inputs
> > +     (if (target-riscv64?)
> > +         (list config)
> > +         '()))
> 
> This updates 'config.guess' and 'config.sub' in a package to fix
> cross-compilation for riscv64 seems like a common practice (eg: also in
> your patches #62433, #62544).  How about make a procedure for it to
> save some typing?  It could be:
> 
> ```
> (define (autotools-config-updated-package p)
>   "Return package P with @command{config.guess} and
> @command{config.sub} updated by the @code{config} package"
>   (package (inherit p)
>     ...))
> ```
> 
> Which could go into (guix transformations).

I would certainly like something like this. I suppose it could be made
more general by using find-file to find all occurrences of config.guess
and config.sub and replacing those.

In the meantime I've pushed this patch after replacing (target-riscv64?)
with (and (target-riscv64?) (%current-target-system)).


-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 03 Jul 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 297 days ago.

Previous Next


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