unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#48759] [PATCH]: Replace '%build-inputs' with 'inputs' in some places and fix 'smalltalk' cross-compilation somewhat
@ 2021-05-31 12:30 Maxime Devos
  2021-06-04 11:46 ` bug#48759: " Mathieu Othacehe
  0 siblings, 1 reply; 2+ messages in thread
From: Maxime Devos @ 2021-05-31 12:30 UTC (permalink / raw)
  To: 48759


[-- Attachment #1.1: Type: text/plain, Size: 1891 bytes --]

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.

[-- Attachment #1.2: 0001-gnu-ci-Use-inputs-in-build-phases-instead-of-build-i.patch --]
[-- Type: text/x-patch, Size: 1106 bytes --]

From 303aa5a27188bdb2df534b4ca3f063125684a752 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 25 May 2021 15:20:34 +0200
Subject: [PATCH 1/7] gnu: ci: Use 'inputs' in build phases instead of
 '%build-inputs'.

In build phases, the former is preferred.

* gnu/packages/ci.scm
  (cuirass)[arguments]<#:phases>{wrap-program}: Use 'inputs'
  argument instead of '%build-inputs'.
---
 gnu/packages/ci.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/ci.scm b/gnu/packages/ci.scm
index c850d37b47..c85c3e5927 100644
--- a/gnu/packages/ci.scm
+++ b/gnu/packages/ci.scm
@@ -141,7 +141,7 @@
                       (guix   (assoc-ref inputs "guix"))
                       (deps   (list avahi gcrypt json zmq squee git bytes
                                     fibers zlib matd tls mail guix))
-                      (guile  (assoc-ref %build-inputs "guile"))
+                      (guile  (assoc-ref inputs "guile"))
                       (effective
                        (read-line
                         (open-pipe* OPEN_READ
-- 
2.31.1


[-- Attachment #1.3: 0002-gnu-smalltalk-Use-inputs-in-phases-instead-of-build-.patch --]
[-- Type: text/x-patch, Size: 1175 bytes --]

From 336811809316cfa365a6a0f29f63eac5c737f187 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 25 May 2021 15:22:24 +0200
Subject: [PATCH 2/7] gnu: smalltalk: Use 'inputs' in phases instead of
 '%build-inputs'.

In build phases, the former is preferred.

* gnu/packages/smalltalk.scm
  (smalltalk)[arguments]<#:phases>{fix-libc}: Use 'inputs'
  argument instead of '%build-inputs'.
---
 gnu/packages/smalltalk.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/smalltalk.scm b/gnu/packages/smalltalk.scm
index ea1798ac13..a572570b13 100644
--- a/gnu/packages/smalltalk.scm
+++ b/gnu/packages/smalltalk.scm
@@ -102,8 +102,8 @@
                        (find-files "doc" "\\.info"))
              #t))
          (add-before 'configure 'fix-libc
-           (lambda _
-             (let ((libc (assoc-ref %build-inputs "libc")))
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((libc (assoc-ref inputs "libc")))
                (substitute* "libc.la.in"
                  (("@LIBC_SO_NAME@") "libc.so")
                  (("@LIBC_SO_DIR@")  (string-append libc "/lib"))))
-- 
2.31.1


[-- Attachment #1.4: 0003-gnu-neovim-Use-inputs-in-phases-instead-of-build-inp.patch --]
[-- Type: text/x-patch, Size: 1191 bytes --]

From adb0d0483fbf0f51d038042afc7801069d25c6a3 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 25 May 2021 15:41:15 +0200
Subject: [PATCH 3/7] gnu: neovim: Use 'inputs' in phases instead of
 '%build-inputs'.

In build phases, the former is preferred.

* gnu/packages/vim.scm
  (neovim)[arguments]<#:phases>{set-lua-path}: Use 'inputs'
  argument instead of '%build-inputs'.
---
 gnu/packages/vim.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 47ac984fc7..24c51b84c3 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -657,7 +657,7 @@ are detected, the user is notified.")))
                      (lambda (prefix)
                        (let ((path (string-append prefix "/share/lua/" lua-version)))
                          (string-append path "/?.lua;" path "/?/?.lua"))))
-                    (lua-inputs (map (cute assoc-ref %build-inputs <>)
+                    (lua-inputs (map (cute assoc-ref inputs <>)
                                      '("lua"
                                        "lua-luv"
                                        "lua-lpeg"
-- 
2.31.1


[-- Attachment #1.5: 0004-gnu-qemacs-Use-native-inputs-instead-of-build-inputs.patch --]
[-- Type: text/x-patch, Size: 1863 bytes --]

From 5d7c38e0604d9df70b9dabab99f9ba8c3fd1ee39 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 25 May 2021 15:49:05 +0200
Subject: [PATCH 4/7] gnu: qemacs: Use 'native-inputs' instead of
 '%build-inputs'.

In build phases, the former (or 'inputs', as appropriate) is preferred.

* gnu/packages/text-editors.scm
  (qemacs)[arguments]<#:phases>{install-extra-documentation}: Use
  'native-inputs' argument instead of '%build-inputs'.
---
 gnu/packages/text-editors.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 47b6e93f29..f7e589e414 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -524,13 +524,14 @@ OpenBSD team.")
                #t)))
          (add-after 'install 'install-extra-documentation
            ;; Install sample configuration file, Info, and HTML manual.
-           (lambda* (#:key outputs #:allow-other-keys)
+           (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
              (let* ((share (string-append (assoc-ref outputs "out") "/share"))
                     (doc (string-append share "/doc/" ,name "-" ,version))
                     (html (string-append share "/html"))
                     (info (string-append share "/info"))
-                    (makeinfo (string-append (assoc-ref %build-inputs "texinfo")
-                                             "/bin/makeinfo")))
+                    (makeinfo (string-append
+                               (assoc-ref (or native-inputs inputs) "texinfo")
+                               "/bin/makeinfo")))
                ;; First fix Texinfo documentation, create appropriate
                ;; directories, then generate Info and HTML files there.
                (substitute* "qe-doc.texi"
-- 
2.31.1


[-- Attachment #1.6: 0005-gnu-ding-Use-inputs-in-build-phases-instead-of-build.patch --]
[-- Type: text/x-patch, Size: 1363 bytes --]

From 6162b2c51b3e2f084c3a536fd4f4cabbdca89d59 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Tue, 25 May 2021 15:58:33 +0200
Subject: [PATCH 5/7] gnu: ding: Use 'inputs' in build phases instead of
 '%build-inputs'.

In build phases, the former is preferred.

* gnu/packages/dictionaries.scm
  (ding)[arguments]<#:phases>{install}: Use 'inputs' argument instead
  of '%build-inputs'.
---
 gnu/packages/dictionaries.scm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index c4c377580c..db99f9d32f 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -175,11 +175,10 @@ work, such as sentence length and other readability measures.")
          (delete 'build)
          (delete 'check)
          (replace 'install
-           (lambda _
+           (lambda* (#:key inputs #:allow-other-keys)
              (let ((bindir (string-append
                             (assoc-ref %outputs "out") "/bin"))
-                   (wish (string-append
-                          (assoc-ref %build-inputs "tk")
+                   (wish (string-append (assoc-ref inputs "tk")
                           "/bin/wish8.6"))
                    (sharedir (string-append
                               (assoc-ref %outputs "out")
-- 
2.31.1


[-- Attachment #1.7: 0006-gnu-smalltalk-Move-zip-from-inputs-to-native-inputs.patch --]
[-- Type: text/x-patch, Size: 1577 bytes --]

From 008c8e429d6707139d2f67360e01348e2fa16b9d Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 31 May 2021 13:54:17 +0200
Subject: [PATCH 6/7] gnu: smalltalk: Move 'zip' from 'inputs' to
 'native-inputs'.

The 'zip' package is not in the references of 'smalltalk'.
As such, it probably should be a native input, not a regular
input. This can be confirmed by trying to cross-compile
the 'smalltalk' package, without this commit. The configure
script will ask to install InfoZIP.

* gnu/packages/smalltalk.scm
  (smalltalk)[inputs]{zip}: Move to ...
  (smalltalk)[native-inputs]{zip} ... here.
---
 gnu/packages/smalltalk.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/smalltalk.scm b/gnu/packages/smalltalk.scm
index a572570b13..af4b7642ff 100644
--- a/gnu/packages/smalltalk.scm
+++ b/gnu/packages/smalltalk.scm
@@ -64,7 +64,8 @@
        ;; XXX: To be removed with the next release of Smalltalk.
        ("autoconf" ,autoconf)
        ("automake" ,automake)
-       ("libtool" ,libtool)))
+       ("libtool" ,libtool)
+       ("zip" ,zip)))
     ;; TODO: These optional dependencies raise the closure size to ~1 GiB
     ;; from the current ~100 MiB, although some of them might be very
     ;; useful for end users:
@@ -81,8 +82,7 @@
        ("libffi" ,libffi)
        ("libltdl" ,libltdl)
        ("libsigsegv" ,libsigsegv)
-       ("lightning" ,lightning)
-       ("zip" ,zip)))
+       ("lightning" ,lightning)))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-- 
2.31.1


[-- Attachment #1.8: 0007-gnu-smalltalk-Find-glibc-even-when-cross-compiling.patch --]
[-- Type: text/x-patch, Size: 1787 bytes --]

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


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#48759: [PATCH]: Replace '%build-inputs' with 'inputs' in some places and fix 'smalltalk' cross-compilation somewhat
  2021-05-31 12:30 [bug#48759] [PATCH]: Replace '%build-inputs' with 'inputs' in some places and fix 'smalltalk' cross-compilation somewhat Maxime Devos
@ 2021-06-04 11:46 ` Mathieu Othacehe
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Othacehe @ 2021-06-04 11:46 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 48759-done


Hello Maxime,

Pushed as 8190f5bb97be4696b7ab6a88ff8397d5a28299e8 to
f50a88c1fa2e07a668ee87402a5462267d1baf12.

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-04 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-31 12:30 [bug#48759] [PATCH]: Replace '%build-inputs' with 'inputs' in some places and fix 'smalltalk' cross-compilation somewhat Maxime Devos
2021-06-04 11:46 ` bug#48759: " Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).