diff mbox series

[bug#49025,v4,core-updates,14/36] wrap-python3: Fix cross-compilation.

Message ID 20210619150458.12057-15-maximedevos@telenet.be
State Accepted
Headers show
Series Support cross-compilation with meson | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

M June 19, 2021, 3:04 p.m. UTC
When cross-compiling, "bash" is missing from %build-inputs,
leading to a build error. Use this-package-input instead of
%build-inputs to resolve this. While we're at it, eliminate
all uses of %outputs and %build-inputs.

* gnu/packages/python.scm
  (wrap-python3)[arguments]<#:builder>: Eliminate %outputs
  and %build-inputs.
---
 gnu/packages/python.scm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index fe8b93b1ba..8688104463 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -60,6 +60,7 @@ 
 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -638,9 +639,9 @@  for more information.")))
        #:builder
        ,#~(begin
             (use-modules (guix build utils))
-            (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
-                  (python (string-append (assoc-ref %build-inputs "python") "/bin/")))
-                 (mkdir-p bin)
+            (let ((bin (string-append #$output "/bin"))
+                  (python #$(file-append (this-package-input "python") "/bin/")))
+              (mkdir-p bin)
               (for-each
                 (lambda (old new)
                   (symlink (string-append python old)
@@ -649,8 +650,7 @@  for more information.")))
                 `("python"  ,"pydoc"  ,"idle"  ,"pip"))
               ;; python-config outputs search paths based upon its location,
               ;; use a bash wrapper to avoid changing its outputs.
-              (let ((bash (string-append (assoc-ref %build-inputs "bash")
-                                         "/bin/bash"))
+              (let ((bash #$(file-append (this-package-input "bash") "/bin/bash"))
                     (old  (string-append python "python3-config"))
                     (new  (string-append bin "/python-config")))
                 (with-output-to-file new