[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
16/20: glib: Use a correct python in scripts when cross-compiling.
From: |
guix-commits |
Subject: |
16/20: glib: Use a correct python in scripts when cross-compiling. |
Date: |
Mon, 12 Jul 2021 11:15:44 -0400 (EDT) |
mothacehe pushed a commit to branch wip-meson
in repository guix.
commit abeffdb0b1a5043fe320c13426bbc5f56c80e587
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sun Jul 11 13:47:19 2021 +0200
glib: Use a correct python in scripts when cross-compiling.
During the build, a native python should be used as these
scripts will be invoked during the build, but when installed,
they should be a python for the system we're compiling for.
* gnu/packages/glib.scm
(glib)[arguments]<#:phases>{patch-python-references}: Look up
"python" in 'native-inputs', not 'inputs'.
(glib)[inputs]{python,python-wrapper,bash-minimal}: New inputs.
Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
---
gnu/packages/glib.scm | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index f0be2dd..99f5c5d 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -16,6 +16,7 @@
;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2020 Arthur Margerit <ruhtra.mar@gmail.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -223,14 +224,19 @@ shared NFS home directories.")
#t))
;; Python references are not being patched in patch-phase of build,
;; despite using python-wrapper as input. So we patch them manually.
+ ;;
+ ;; These python scripts are both used during build and installed,
+ ;; so at first, use a python from 'native-inputs', not 'inputs'. When
+ ;; cross-compiling, the 'patch-shebangs' phase will replace
+ ;; the native python with a python from 'inputs'.
(add-after 'unpack 'patch-python-references
- (lambda* (#:key inputs #:allow-other-keys)
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
(substitute* '("gio/gdbus-2.0/codegen/gdbus-codegen.in"
"glib/gtester-report.in"
"gobject/glib-genmarshal.in"
"gobject/glib-mkenums.in")
(("@PYTHON@")
- (string-append (assoc-ref inputs "python")
+ (string-append (assoc-ref (or native-inputs inputs) "python")
"/bin/python"
,(version-major+minor
(package-version python)))))
@@ -293,6 +299,13 @@ shared NFS home directories.")
("xsltproc" ,libxslt)))
(inputs
`(("bash-completion" ,bash-completion)
+ ;; "python", "python-wrapper" and "bash-minimal"
+ ;; are for the 'patch-shebangs' phase, to make
+ ;; sure the installed scripts end up with a correct shebang
+ ;; when cross-compiling.
+ ("python" ,python)
+ ("python-wrapper" ,python-wrapper)
+ ("bash-minimal" ,bash-minimal)
("dbus" ,dbus)
("libelf" ,libelf)))
(propagated-inputs
- branch wip-meson created (now e201f47), guix-commits, 2021/07/12
- 04/20: net-base: Don't cross-compile., guix-commits, 2021/07/12
- 11/20: openssl: Make the #:phases argument a G-expression., guix-commits, 2021/07/12
- 02/20: utils: Define a target-x86-32? and target-x86-64? predicate., guix-commits, 2021/07/12
- 16/20: glib: Use a correct python in scripts when cross-compiling.,
guix-commits <=
- 20/20: meson: Support cross-compilation., guix-commits, 2021/07/12
- 06/20: libgpg-error: Remove trailing #f from phases., guix-commits, 2021/07/12
- 08/20: libgpg-error: Fix cross-compilation error., guix-commits, 2021/07/12
- 18/20: glib: Look up "tzdata" in 'native-inputs', not 'inputs'., guix-commits, 2021/07/12
- 10/20: openssl: Remove trailing #t from phases., guix-commits, 2021/07/12
- 17/20: glib: Verify the cross-compiled python is used in installed scripts., guix-commits, 2021/07/12
- 15/20: openssl: Extract logic for computing CONFIGURE_TARGET_ARCH., guix-commits, 2021/07/12
- 07/20: libgpg-error: Prevent silent miscompilation some systems., guix-commits, 2021/07/12
- 09/20: python: Fix reference to input when cross-compiling., guix-commits, 2021/07/12
- 13/20: openssl: Move documentation instead of copying and deleting it., guix-commits, 2021/07/12