[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/64: gnu: python: Fix cross compilation.
From: |
guix-commits |
Subject: |
02/64: gnu: python: Fix cross compilation. |
Date: |
Fri, 23 Aug 2019 04:10:14 -0400 (EDT) |
mothacehe pushed a commit to branch wip-cross-system
in repository guix.
commit f6015bcd9ee740ca0bec28ab817b55fabac63aba
Author: Mathieu Othacehe <address@hidden>
Date: Wed Mar 6 16:39:00 2019 +0100
gnu: python: Fix cross compilation.
* gnu/packages/python.scm (python-2.7)[arguments]: Add a configure flag to
disable a check failing when cross-compiling. This is covered here:
https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html,
[native-inputs]: Add self and which when cross-compiling,
(python-3.7)[arguments]: Refer to native python when cross-compiling.
---
gnu/packages/python.scm | 33 ++++++++++++++++++++++++---------
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 9fec182..09c1f7d 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -38,7 +38,7 @@
;;; Copyright © 2017 Frederick M. Muriithi <address@hidden>
;;; Copyright © 2017, 2018 Adriano Peluso <address@hidden>
;;; Copyright © 2017 Ben Sturmfels <address@hidden>
-;;; Copyright © 2017, 2018 Mathieu Othacehe <address@hidden>
+;;; Copyright © 2017, 2018, 2019 Mathieu Othacehe <address@hidden>
;;; Copyright © 2017 José Miguel Sánchez García <address@hidden>
;;; Copyright © 2017 Roel Janssen <address@hidden>
;;; Copyright © 2017, 2018 Kei Kebreau <address@hidden>
@@ -150,6 +150,13 @@
"INSTALL=install -c"
"MKDIR_P=mkdir -p"
+ ;; Disable runtime check failing if cross-compiling, see:
+ ;;
https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
+ ,@(if (%current-target-system)
+ '("ac_cv_buggy_getaddrinfo=no"
+ "ac_cv_file__dev_ptmx=no"
+ "ac_cv_file__dev_ptc=no")
+ '())
(string-append "LDFLAGS=-Wl,-rpath="
(assoc-ref %outputs "out") "/lib"))
;; With no -j argument tests use all available cpus, so provide one.
@@ -292,7 +299,12 @@
("tcl" ,tcl)
("tk" ,tk))) ; for tkinter
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ;; When cross-compiling, a native version of Python itself is needed.
+ ,@(if (%current-target-system)
+ `(("self" ,this-package)
+ ("which" ,which))
+ '())))
(native-search-paths
(list (search-path-specification
(variable "PYTHONPATH")
@@ -388,13 +400,16 @@ data types.")
(if (null? opt) "none" (car opt)))
(for-each (lambda (file)
(apply invoke
- `(,(string-append out "/bin/python3")
- ,@opt
- "-m" "compileall"
- "-f" ; force rebuild
- ;; Don't build lib2to3, because it's
Python 2 code.
- "-x" "lib2to3/.*"
- ,file)))
+ `(,,(if (%current-target-system)
+ "python3"
+ '(string-append out
+ "/bin/python3"))
+ ,@opt
+ "-m" "compileall"
+ "-f" ; force rebuild
+ ;; Don't build lib2to3, because it's
Python 2 code.
+ "-x" "lib2to3/.*"
+ ,file)))
(find-files out "\\.py$")))
(list '() '("-O") '("-OO")))
#t)))))))
- branch wip-cross-system created (now a5d9ed2), guix-commits, 2019/08/23
- 06/64: gnu: xorg: Fix cross-compilation of multiple packages., guix-commits, 2019/08/23
- 04/64: gnu: tk: Fix cross-compilation., guix-commits, 2019/08/23
- 01/64: gnu: perl: Fix cross-compilation., guix-commits, 2019/08/23
- 02/64: gnu: python: Fix cross compilation.,
guix-commits <=
- 07/64: gnu: libgpg-error: Fix cross compilation., guix-commits, 2019/08/23
- 17/64: gnu: texinfo-5: Fix cross-compilation., guix-commits, 2019/08/23
- 19/64: gnu: indent: Fix aarch64 cross-compilation., guix-commits, 2019/08/23
- 26/64: gnu: tcsh: Fix cross-compilation., guix-commits, 2019/08/23
- 20/64: gnu: libsamplerate: Fix aarch64 cross-compilation., guix-commits, 2019/08/23
- 25/64: gnu: libarchive: Fix cross-compilation., guix-commits, 2019/08/23
- 22/64: gnu: cyrus-sasl: Fix cross-compilation., guix-commits, 2019/08/23
- 29/64: gnu: alsa-utils: Fix cross-compilation., guix-commits, 2019/08/23
- 31/64: gnu: glibc-utf8-locales: Fix cross-compilation., guix-commits, 2019/08/23
- 41/64: gnu: procps: Fix cross-compilation., guix-commits, 2019/08/23