[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#49025] [[PATCH v2 core-updates] 29/37] glib: Use a correct python i
From: |
Maxime Devos |
Subject: |
[bug#49025] [[PATCH v2 core-updates] 29/37] glib: Use a correct python in scripts when cross-compiling. |
Date: |
Fri, 18 Jun 2021 18:09:28 +0200 |
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.
---
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 94276ae0ef..25c5ae494b 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.
;;;
@@ -222,14 +223,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)))))
@@ -282,6 +288,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" ,(canonical-package bash-minimal))
("dbus" ,dbus)
("libelf" ,libelf)))
(propagated-inputs
--
2.32.0
- [bug#49025] [[PATCH v2 core-updates] 33/37] tk: Do not use %build-inputs when cross-compiling., (continued)
- [bug#49025] [[PATCH v2 core-updates] 33/37] tk: Do not use %build-inputs when cross-compiling., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 31/37] glib: Look up "tzdata" in 'native-inputs', not 'inputs'., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 15/37] python: Fix reference to input when cross-compiling., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 26/37] bash: Fix cross-compilation build error., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 28/37] fontconfig: Fix build error when cross-compiling., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 11/37] libgpg-error: Fix cross-compilation error., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 37/37] meson: Support cross-compilation., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 20/37] openssl: Move all man pages to separate output, not only man3., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 35/37] opendht: Correct 'nettle' variable name in inputs., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 36/37] cross-base: Fix cross-compiler for i686-linux-gnu., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 29/37] glib: Use a correct python in scripts when cross-compiling.,
Maxime Devos <=
- [bug#49025] [[PATCH v2 core-updates] 27/37] fontconfig: Make the #:configure-flags argument a G-expression., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 14/37] wrap-python3: Fix cross-compilation., Maxime Devos, 2021/06/18
- [bug#49025] [[PATCH v2 core-updates] 01/37] utils: Define target-linux? predicate., Maxime Devos, 2021/06/18
- [bug#49025] [PATCH v3 core-updates 01/37] utils: Define target-linux? predicate., Maxime Devos, 2021/06/18
- [bug#49025] [PATCH v3 core-updates 04/37] net-base: Make #:builder argument a G-expression., Maxime Devos, 2021/06/18
- [bug#49025] [PATCH v3 core-updates 05/37] net-base: Fix cross-compilation, eliminating %build-inputs & friends, Maxime Devos, 2021/06/18
- [bug#49025] [PATCH v3 core-updates 02/37] utils: Define a target-x86-32? and target-x86-64? predicate., Maxime Devos, 2021/06/18
- [bug#49025] [PATCH v3 core-updates 07/37] tzdata: Don't bother with cross-compiling., Maxime Devos, 2021/06/18
- [bug#49025] [PATCH v3 core-updates 08/37] libgpg-error: Remove trailing #f from phases., Maxime Devos, 2021/06/18
- [bug#49025] [PATCH v3 core-updates 06/37] net-base: Don't cross-compile., Maxime Devos, 2021/06/18