bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52574: Cross-compiling glib failure


From: Maxim Cournoyer
Subject: bug#52574: Cross-compiling glib failure
Date: Fri, 17 Dec 2021 23:34:47 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Maxime Devos <maximedevos@telenet.be> writes:

> L p R n d n schreef op vr 17-12-2021 om 12:51 [+0000]:
>> 
>> Hello guix,
>> 
>> Trying to cross-compile glib to aarch64with:
>> 
>> guix build --target=aarch64-linux-gnu glib
>> 
>> I get this error:
>> 
>> `Unbound variable: %outputs
>> 
>> I suppose the glib’s definition needs to be adapted to Guix’s new
>> style
>> which was merged a few days ago?
>> 
>
> 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.

Thanks for the hints.  I'm trying the following fix on my (local for
now) version-1.4.0 branch:

--8<---------------cut here---------------start------------->8---
modified   gnu/packages/glib.scm
@@ -212,12 +212,11 @@ (define glib
                    `(,(this-package-native-input "python")
                      ,(this-package-native-input "python-wrapper")))
               '()))
-       #:configure-flags (list "--default-library=both"
-                               "-Dman=false"
-                               "-Dselinux=disabled"
-                               (string-append "--bindir="
-                                              (assoc-ref %outputs "bin")
-                                              "/bin"))
+       #:configure-flags #~(list "--default-library=both"
+                                 "-Dman=false"
+                                 "-Dselinux=disabled"
+                                 (string-append "--bindir="
+                                                #$output:bin "/bin"))
        #:phases
        (modify-phases %standard-phases
          ;; Needed to pass the test phase on slower ARM and i686 machines.
@@ -365,8 +364,8 @@ (define-public glib-with-documentation
     (arguments
      (substitute-keyword-arguments (package-arguments glib)
        ((#:configure-flags flags ''())
-        `(cons "-Dgtk_doc=true"
-               (delete "-Dman=false" ,flags)))
+        #~(cons "-Dgtk_doc=true"
+                (delete "-Dman=false" #$flags)))
        ((#:phases phases)
         `(modify-phases ,phases
            (add-after 'unpack 'patch-docbook-xml
--8<---------------cut here---------------end--------------->8---

Thanks,

Maxim





reply via email to

[Prev in Thread] Current Thread [Next in Thread]