mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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.
This commit is contained in:
parent
001504a70a
commit
57ec9861f4
1 changed files with 24 additions and 9 deletions
|
@ -38,7 +38,7 @@
|
||||||
;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
|
;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
|
||||||
;;; Copyright © 2017, 2018 Adriano Peluso <catonano@gmail.com>
|
;;; Copyright © 2017, 2018 Adriano Peluso <catonano@gmail.com>
|
||||||
;;; Copyright © 2017 Ben Sturmfels <ben@sturm.com.au>
|
;;; Copyright © 2017 Ben Sturmfels <ben@sturm.com.au>
|
||||||
;;; Copyright © 2017, 2018 Mathieu Othacehe <m.othacehe@gmail.com>
|
;;; Copyright © 2017, 2018, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||||
;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
|
;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
|
||||||
;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
|
;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
|
||||||
;;; Copyright © 2017, 2018 Kei Kebreau <kkebreau@posteo.net>
|
;;; Copyright © 2017, 2018 Kei Kebreau <kkebreau@posteo.net>
|
||||||
|
@ -150,6 +150,13 @@
|
||||||
"INSTALL=install -c"
|
"INSTALL=install -c"
|
||||||
"MKDIR_P=mkdir -p"
|
"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="
|
(string-append "LDFLAGS=-Wl,-rpath="
|
||||||
(assoc-ref %outputs "out") "/lib"))
|
(assoc-ref %outputs "out") "/lib"))
|
||||||
;; With no -j argument tests use all available cpus, so provide one.
|
;; With no -j argument tests use all available cpus, so provide one.
|
||||||
|
@ -292,7 +299,12 @@
|
||||||
("tcl" ,tcl)
|
("tcl" ,tcl)
|
||||||
("tk" ,tk))) ; for tkinter
|
("tk" ,tk))) ; for tkinter
|
||||||
(native-inputs
|
(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
|
(native-search-paths
|
||||||
(list (search-path-specification
|
(list (search-path-specification
|
||||||
(variable "PYTHONPATH")
|
(variable "PYTHONPATH")
|
||||||
|
@ -388,13 +400,16 @@ data types.")
|
||||||
(if (null? opt) "none" (car opt)))
|
(if (null? opt) "none" (car opt)))
|
||||||
(for-each (lambda (file)
|
(for-each (lambda (file)
|
||||||
(apply invoke
|
(apply invoke
|
||||||
`(,(string-append out "/bin/python3")
|
`(,,(if (%current-target-system)
|
||||||
,@opt
|
"python3"
|
||||||
"-m" "compileall"
|
'(string-append out
|
||||||
"-f" ; force rebuild
|
"/bin/python3"))
|
||||||
;; Don't build lib2to3, because it's Python 2 code.
|
,@opt
|
||||||
"-x" "lib2to3/.*"
|
"-m" "compileall"
|
||||||
,file)))
|
"-f" ; force rebuild
|
||||||
|
;; Don't build lib2to3, because it's Python 2 code.
|
||||||
|
"-x" "lib2to3/.*"
|
||||||
|
,file)))
|
||||||
(find-files out "\\.py$")))
|
(find-files out "\\.py$")))
|
||||||
(list '() '("-O") '("-OO")))
|
(list '() '("-O") '("-OO")))
|
||||||
#t)))))))
|
#t)))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue