diff mbox series

[bug#48759] : Replace '%build-inputs' with 'inputs' in some places and fix 'smalltalk' cross-compilation somewhat

Message ID 9c37923b90058f446dcc330c4d65f88754b6307b.camel@telenet.be
State Accepted
Headers show
Series [bug#48759] : Replace '%build-inputs' with 'inputs' in some places and fix 'smalltalk' cross-compilation somewhat | expand

Commit Message

M May 31, 2021, 12:30 p.m. UTC
Hi guix,

Overview:
  (%build-inputs --> inputs, native-inputs)
  #1: gnu: ci: Use 'inputs' in build phases instead of '%build-inputs'.
  #2: gnu: smalltalk: Use 'inputs' in phases instead of '%build-inputs'.
  #3: gnu: neovim: Use 'inputs' in phases instead of '%build-inputs'.
  #4: gnu: qemacs: Use 'native-inputs' instead of '%build-inputs'.
  #5: gnu: ding: Use 'inputs' in build phases instead of '%build-inputs'.

  (more smalltalk fixes)
  #6: gnu: smalltalk: Move 'zip' from 'inputs' to 'native-inputs'.
  #7: gnu: smalltalk: Find glibc even when cross-compiling.

See patch descriptions for details.

This would cause 5 rebuilds:
  ./pre-inst-env guix refresh --list-dependents ding qemacs neovim smalltalk cuirass
  No dependents other than themselves: cuirass@1.0.0-17.31fd4d4 smalltalk@3.2.91 neovim@0.4.4 qemacs@0.3.3 ding@1.8.1

Building succeeds:

  ./pre-inst-env guix build ding qemacs neovim smalltalk cuirass

Cross-compilation: somewhat improved

  # ding: ok, refers to binaries of correct architecture
  # qemacs: cannot cross-compile, because its dependency libxv
  #  tries to run a test program (even when cross-compiling)
  #  (during configuration, "checking whether malloc(0) returns NULL...")
  # neovim: cannot cross-compile, because its dependency "libtermkey" is not cross-compilable
  # cuirass: the meson build system does not support cross-compilaion
  # smalltalk: still some failures, even after patches (#6 and #7)
  #
  #  ./gst --no-user-files --kernel-dir "./kernel" --image gst.im -iQ /dev/null
  #  ./gst: line 117: /tmp/guix-build-smalltalk-3.2.91.drv-0/smalltalk-3.2.91/.libs/gst: cannot execute binary file: Exec format error
  #  ./gst: line 117: /tmp/guix-build-smalltalk-3.2.91.drv-0/smalltalk-3.2.91/.libs/gst: Success
  ./pre-inst-env guix build ding --target=aarch64-linux-gnu

Greetings,
Maxime.

Comments

Mathieu Othacehe June 4, 2021, 11:46 a.m. UTC | #1
Hello Maxime,

Pushed as 8190f5bb97be4696b7ab6a88ff8397d5a28299e8 to
f50a88c1fa2e07a668ee87402a5462267d1baf12.

Thanks,

Mathieu
diff mbox series

Patch

From dcd7d16b8b89defcedefb4b8a71977d376d04273 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 14:07:50 +0200
Subject: [PATCH 7/7] gnu: smalltalk: Find glibc even when cross-compiling.

Curiously, glibc is named "cross-libc" instead of "libc"
when cross-compiling. I don't know why. Anyway, here
is a fix. Smalltalk still fails to cross-compile though.

* gnu/packages/smalltalk.scm
  (smalltalk)[arguments]{phases}<#:fix-libc>: Also search for
  "cross-libc" instead of only "libc" in 'inputs'.
---
 gnu/packages/smalltalk.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/smalltalk.scm b/gnu/packages/smalltalk.scm
index af4b7642ff..20ecc19881 100644
--- a/gnu/packages/smalltalk.scm
+++ b/gnu/packages/smalltalk.scm
@@ -4,6 +4,7 @@ 
 ;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -103,7 +104,11 @@ 
              #t))
          (add-before 'configure 'fix-libc
            (lambda* (#:key inputs #:allow-other-keys)
-             (let ((libc (assoc-ref inputs "libc")))
+             (let ((libc (or (assoc-ref inputs "libc")
+                             ;; When cross-compiling, the input
+                             ;; is named "cross-libc" instead of
+                             ;; simply "libc". I don't know why.
+                             (assoc-ref inputs "cross-libc"))))
                (substitute* "libc.la.in"
                  (("@LIBC_SO_NAME@") "libc.so")
                  (("@LIBC_SO_DIR@")  (string-append libc "/lib"))))
-- 
2.31.1