GNU bug report logs - #67108
[PATCH] gnu: librsvg-2.40: Fix cross-compiling.

Previous Next

Package: guix-patches;

Reported by: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>

Date: Sat, 11 Nov 2023 15:33: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 67108 in the body.
You can then email your comments to 67108 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 liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, rg <at> raghavgururajan.name, guix-patches <at> gnu.org:
bug#67108; Package guix-patches. (Sat, 11 Nov 2023 15:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zheng Junjie <zhengjunjie <at> iscas.ac.cn>:
New bug report received and forwarded. Copy sent to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, rg <at> raghavgururajan.name, guix-patches <at> gnu.org. (Sat, 11 Nov 2023 15:33:02 GMT) Full text and rfc822 format available.

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

From: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: librsvg-2.40: Fix cross-compiling.
Date: Sat, 11 Nov 2023 23:30:24 +0800
* gnu/packages/gnome.scm (librsvg-2.40): Fix cross-compiling.
[arguments]<#:configure-flags>: when cross-compiling, disable
gobject-introspection.
[native-inputs]: when cross-compiling, add gdk-pixbuf.

(librsvg-for-system): Use the C version when cross-compiling.

Change-Id: Icb95763422269eed2e067a1d06166c3ed4bdeedc
---
 gnu/packages/gnome.scm | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index ac3035e07d..c5006993c8 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -77,6 +77,7 @@
 ;;; Copyright © 2023 Juliana Sims <juli <at> incana.org>
 ;;; Copyright © 2023 Dominik Delgado Steuter <d <at> delgado.nrw>
 ;;; Copyright © 2023 Zhu Zihao <all_but_last <at> 163.com>
+;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3663,7 +3664,10 @@ (define-public librsvg-2.40
                 "1fljkag2gr7c4k5mn798lgf9903xslz8h51bgvl89nnay42qjqpp"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:configure-flags (list "--disable-static")
+     `(#:configure-flags (list "--disable-static"
+                               ,@(if (%current-target-system)
+                                     '("--enable-introspection=no")
+                                     '()))
        #:phases
        (modify-phases %standard-phases
          (add-before 'configure 'pre-configure
@@ -3674,7 +3678,7 @@ (define-public librsvg-2.40
                (("gdk_pixbuf_moduledir = .*$")
                 (string-append "gdk_pixbuf_moduledir = "
                                "$(prefix)/lib/gdk-pixbuf-2.0/2.10.0/"
-                                "loaders\n"))
+                               "loaders\n"))
                ;; Drop the 'loaders.cache' file, it's in gdk-pixbuf+svg.
                (("gdk_pixbuf_cache_file = .*$")
                 "gdk_pixbuf_cache_file = $(TMPDIR)/loaders.cache\n"))
@@ -3702,9 +3706,12 @@ (define-public librsvg-2.40
                            "bugs/340047.svg"
                            "bugs/749415.svg"))))))))
     (native-inputs
-     (list pkg-config
-           `(,glib "bin") ; glib-mkenums, etc.
-           gobject-introspection)) ; g-ir-compiler, etc.
+     (append (if (%current-target-system)
+                 (list gdk-pixbuf)
+                 '())
+             (list pkg-config
+                   `(,glib "bin") ; glib-mkenums, etc.
+                   gobject-introspection))) ; g-ir-compiler, etc.
     (inputs
      (list pango libcroco libxml2))
     (propagated-inputs
@@ -3714,14 +3721,16 @@ (define-public librsvg-2.40
     (properties '((hidden? . #t)))))
 
 (define* (librsvg-for-system #:optional
-                             (system (or (%current-target-system)
-                                         (%current-system))))
+                             (system (%current-system)))
   ;; Since librsvg 2.50 depends on Rust, and Rust is only correctly supported
   ;; on x86_64, aarch64 and riscv64 so far, use the ancient C version on other
   ;; platforms (FIXME).
-  (if (supported-package? librsvg)
-      librsvg
-      librsvg-2.40))
+  ;; and for now cargo-build-system is no support cross-compiling, so when
+  ;; cross-compiling we just use C version.
+  (if (or (%current-target-system)
+          (not (supported-package? librsvg system)))
+      librsvg-2.40
+      librsvg))
 
 (export librsvg-for-system)
 

base-commit: af6105afc67a15a491a0a4fd18a28c9f801a0b94
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#67108; Package guix-patches. (Sat, 11 Nov 2023 16:12:02 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>, 67108 <at> debbugs.gnu.org
Cc: Raghav Gururajan <rg <at> raghavgururajan.name>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [bug#67108] [PATCH] gnu: librsvg-2.40: Fix cross-compiling.
Date: Sat, 11 Nov 2023 17:10:07 +0100
Am Samstag, dem 11.11.2023 um 23:30 +0800 schrieb Zheng Junjie:
> * gnu/packages/gnome.scm (librsvg-2.40): Fix cross-compiling.
> [arguments]<#:configure-flags>: when cross-compiling, disable
> gobject-introspection.
When.
> [native-inputs]: when cross-compiling, add gdk-pixbuf.
When.

> (librsvg-for-system): Use the C version when cross-compiling.
You don't need a newline here afaik.

> Change-Id: Icb95763422269eed2e067a1d06166c3ed4bdeedc
> ---
>  gnu/packages/gnome.scm | 29 +++++++++++++++++++----------
>  1 file changed, 19 insertions(+), 10 deletions(-)
> 
> diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
> index ac3035e07d..c5006993c8 100644
> --- a/gnu/packages/gnome.scm
> +++ b/gnu/packages/gnome.scm
> @@ -77,6 +77,7 @@
>  ;;; Copyright © 2023 Juliana Sims <juli <at> incana.org>
>  ;;; Copyright © 2023 Dominik Delgado Steuter <d <at> delgado.nrw>
>  ;;; Copyright © 2023 Zhu Zihao <all_but_last <at> 163.com>
> +;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -3663,7 +3664,10 @@ (define-public librsvg-2.40
>                 
> "1fljkag2gr7c4k5mn798lgf9903xslz8h51bgvl89nnay42qjqpp"))))
>      (build-system gnu-build-system)
>      (arguments
> -     `(#:configure-flags (list "--disable-static")
> +     `(#:configure-flags (list "--disable-static"
> +                               ,@(if (%current-target-system)
> +                                     '("--enable-introspection=no")
> +                                     '()))
Can we do --disable-introspection?
>         #:phases
>         (modify-phases %standard-phases
>           (add-before 'configure 'pre-configure
> @@ -3674,7 +3678,7 @@ (define-public librsvg-2.40
>                 (("gdk_pixbuf_moduledir = .*$")
>                  (string-append "gdk_pixbuf_moduledir = "
>                                 "$(prefix)/lib/gdk-pixbuf-
> 2.0/2.10.0/"
> -                                "loaders\n"))
> +                               "loaders\n"))
>                 ;; Drop the 'loaders.cache' file, it's in gdk-
> pixbuf+svg.
>                 (("gdk_pixbuf_cache_file = .*$")
>                  "gdk_pixbuf_cache_file =
> $(TMPDIR)/loaders.cache\n"))
> @@ -3702,9 +3706,12 @@ (define-public librsvg-2.40
>                             "bugs/340047.svg"
>                             "bugs/749415.svg"))))))))
>      (native-inputs
> -     (list pkg-config
> -           `(,glib "bin") ; glib-mkenums, etc.
> -           gobject-introspection)) ; g-ir-compiler, etc.
> +     (append (if (%current-target-system)
> +                 (list gdk-pixbuf)
> +                 '())
> +             (list pkg-config
> +                   `(,glib "bin") ; glib-mkenums, etc.
> +                   gobject-introspection))) ; g-ir-compiler, etc.
Instead of doing append, you can quasiquote the list and use ,@ to
splice in gdk-pixbuf.
>      (inputs
>       (list pango libcroco libxml2))
>      (propagated-inputs
> @@ -3714,14 +3721,16 @@ (define-public librsvg-2.40
>      (properties '((hidden? . #t)))))
>  
>  (define* (librsvg-for-system #:optional
> -                             (system (or (%current-target-system)
> -                                         (%current-system))))
> +                             (system (%current-system)))
Why this change?
>    ;; Since librsvg 2.50 depends on Rust, and Rust is only correctly
> supported
>    ;; on x86_64, aarch64 and riscv64 so far, use the ancient C
> version on other
>    ;; platforms (FIXME).
> -  (if (supported-package? librsvg)
> -      librsvg
> -      librsvg-2.40))
> +  ;; and for now cargo-build-system is no support cross-compiling,
> so when
> +  ;; cross-compiling we just use C version.
> +  (if (or (%current-target-system)
> +          (not (supported-package? librsvg system)))
> +      librsvg-2.40
> +      librsvg))
This hunk LGTM.

Cheers

Information forwarded to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, rg <at> raghavgururajan.name, guix-patches <at> gnu.org:
bug#67108; Package guix-patches. (Sun, 12 Nov 2023 08:22:02 GMT) Full text and rfc822 format available.

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

From: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
To: 67108 <at> debbugs.gnu.org
Subject: [PATCH v2] gnu: librsvg-2.40: Fix cross-compiling.
Date: Sun, 12 Nov 2023 16:19:36 +0800
* gnu/packages/gnome.scm (librsvg-2.40): Fix cross-compiling.
[arguments]<#:configure-flags>: When cross-compiling, disable
gobject-introspection.
[native-inputs]: When cross-compiling, add gdk-pixbuf.
(librsvg-for-system): Use the C version when cross-compiling.

Change-Id: Icb95763422269eed2e067a1d06166c3ed4bdeedc
---
 gnu/packages/gnome.scm | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index ac3035e07d..b832ff1099 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -77,6 +77,7 @@
 ;;; Copyright © 2023 Juliana Sims <juli <at> incana.org>
 ;;; Copyright © 2023 Dominik Delgado Steuter <d <at> delgado.nrw>
 ;;; Copyright © 2023 Zhu Zihao <all_but_last <at> 163.com>
+;;; Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3663,7 +3664,10 @@ (define-public librsvg-2.40
                 "1fljkag2gr7c4k5mn798lgf9903xslz8h51bgvl89nnay42qjqpp"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:configure-flags (list "--disable-static")
+     `(#:configure-flags (list "--disable-static"
+                               ,@(if (%current-target-system)
+                                     '("--disable-introspection")
+                                     '()))
        #:phases
        (modify-phases %standard-phases
          (add-before 'configure 'pre-configure
@@ -3702,9 +3706,12 @@ (define-public librsvg-2.40
                            "bugs/340047.svg"
                            "bugs/749415.svg"))))))))
     (native-inputs
-     (list pkg-config
-           `(,glib "bin") ; glib-mkenums, etc.
-           gobject-introspection)) ; g-ir-compiler, etc.
+     `(,pkg-config
+       ,@(if (%current-target-system)
+             (list gdk-pixbuf)
+             '())
+       (,glib "bin") ; glib-mkenums, etc.
+       ,gobject-introspection)) ; g-ir-compiler, etc.
     (inputs
      (list pango libcroco libxml2))
     (propagated-inputs
@@ -3719,9 +3726,12 @@ (define* (librsvg-for-system #:optional
   ;; Since librsvg 2.50 depends on Rust, and Rust is only correctly supported
   ;; on x86_64, aarch64 and riscv64 so far, use the ancient C version on other
   ;; platforms (FIXME).
-  (if (supported-package? librsvg)
-      librsvg
-      librsvg-2.40))
+  ;; and for now cargo-build-system is no support cross-compiling, so when
+  ;; cross-compiling we just use C version.
+  (if (or (%current-target-system)
+          (not (supported-package? librsvg system)))
+      librsvg-2.40
+      librsvg))
 
 (export librsvg-for-system)
 

base-commit: af6105afc67a15a491a0a4fd18a28c9f801a0b94
-- 
2.41.0





Reply sent to Efraim Flashner <efraim <at> flashner.co.il>:
You have taken responsibility. (Thu, 21 Dec 2023 09:29:08 GMT) Full text and rfc822 format available.

Notification sent to Zheng Junjie <zhengjunjie <at> iscas.ac.cn>:
bug acknowledged by developer. (Thu, 21 Dec 2023 09:29:09 GMT) Full text and rfc822 format available.

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

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Zheng Junjie <zhengjunjie <at> iscas.ac.cn>
Cc: Raghav Gururajan <rg <at> raghavgururajan.name>, 67108-done <at> debbugs.gnu.org,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [bug#67108] [PATCH] gnu: librsvg-2.40: Fix cross-compiling.
Date: Thu, 21 Dec 2023 11:28:49 +0200
[Message part 1 (text/plain, inline)]
On Sat, Nov 11, 2023 at 11:30:24PM +0800, Zheng Junjie wrote:
> * gnu/packages/gnome.scm (librsvg-2.40): Fix cross-compiling.
> [arguments]<#:configure-flags>: when cross-compiling, disable
> gobject-introspection.
> [native-inputs]: when cross-compiling, add gdk-pixbuf.
> 
> (librsvg-for-system): Use the C version when cross-compiling.

With the rust-team branch merged there's now support for cross-compiling
librsvg so this patch shouldn't be needed anymore.

-- 
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. (Thu, 18 Jan 2024 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 112 days ago.

Previous Next


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