[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#52574: Cross-compiling glib failure
From: |
Ludovic Courtès |
Subject: |
bug#52574: Cross-compiling glib failure |
Date: |
Sun, 19 Dec 2021 23:12:51 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Hi,
Maxime Devos <maximedevos@telenet.be> skribis:
> Actually, glib's build system (meson-build-system) did not support
> cross-compilation at all before the merge. Cross-compilation support
> was added on that branch, but glib's package broke later, presumably in
> <https://git.savannah.gnu.org/cgit/guix.git/commit/?id=f22f6fc3b6cc6382df3246d192a40a3951b48c37>.
>
> The fix would be to replace to wrap the configure flags in a #~,
> instead of a ´,replace (assoc-ref %outputs "bin") by #$output:bin and
> adjust the configure flags of glib-with-documentation to use #~ and #$
> instead of ´ and ,.
>
> To avoid rebuilds, some
> (if (%current-target-system) #~#$output:bin #~(assoc-ref %outputs
> "bin"))
> may be needed.
In the case of ‘meson-build-system’, the logical fix IMO would be to
define ‘%build-inputs‘, ‘%outputs’, etc. when cross-compiling, with the
patch below.
This would be consistent with the fact that ‘meson-build-system’ defines
those variables for native builds already.
Thoughts?
Longer-term we can move away from ‘%outputs’, ‘%build-inputs’, & co.,
but that’s another story.
Ludo’.
diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm
index ba7441a3eb..ad604f8871 100644
--- a/guix/build-system/meson.scm
+++ b/guix/build-system/meson.scm
@@ -287,6 +287,19 @@ (define builder
#~(begin
(use-modules #$@(sexp->gexp modules))
+ (define %build-host-inputs
+ #+(input-tuples->gexp build-inputs))
+
+ (define %build-target-inputs
+ (append #$(input-tuples->gexp host-inputs)
+ #+(input-tuples->gexp target-inputs)))
+
+ (define %build-inputs
+ (append %build-host-inputs %build-target-inputs))
+
+ (define %outputs
+ #$(outputs->gexp outputs))
+
(define build-phases
#$(let ((phases (if (pair? phases) (sexp->gexp phases) phases)))
(if glib-or-gtk?