guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: gnu: commencement: Fix Python build on non-x86 platforms.


From: guix-commits
Subject: 03/03: gnu: commencement: Fix Python build on non-x86 platforms.
Date: Sun, 7 Jul 2019 10:35:43 -0400 (EDT)

mbakke pushed a commit to branch core-updates
in repository guix.

commit 4f5fe46388eb70055b6935df053f74b7ccdaf55f
Author: Marius Bakke <address@hidden>
Date:   Sun Jul 7 16:32:53 2019 +0200

    gnu: commencement: Fix Python build on non-x86 platforms.
    
    * gnu/packages/commencement.scm (python-boot0)[version, source]: Downgrade 
to 3.5.7.
    [arguments]: Remove <#:make-flags>.  Add <#:phases>.
    [native-inputs]: Remove artifical dependency on PKG-CONFIG.
---
 gnu/packages/commencement.scm | 30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index d282964..d06aa0a 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1864,16 +1864,40 @@ the bootstrap environment."
 (define python-boot0
   (let ((python (package
                   (inherit python-minimal)
+                  ;; We cannot use Python 3.7 and later here, because they 
require
+                  ;; pthreads, which is missing on non-x86 platforms at this 
stage.
+                  ;; Python 3.6 technically supports being built without 
threading
+                  ;; support, but requires additional patches.
+                  (version "3.5.7")
+                  (source (origin
+                            (inherit (package-source python))
+                            (uri (string-append 
"https://www.python.org/ftp/python/";
+                                                version "/Python-" version 
".tar.xz"))
+                            (patches '())
+                            (sha256
+                             (base32
+                              
"1p67pnp2ca5przx2s45r8m55dcn6f5hsm0l4s1zp7mglkf4r4n18"))))
                   (inputs
                    `(("expat" ,expat-sans-tests))) ;remove OpenSSL, zlib, etc.
+                  (native-inputs '())              ;and pkg-config
                   (arguments
                    (substitute-keyword-arguments (package-arguments
                                                   python-minimal)
                      ;; Disable features that cannot be built at this stage.
                      ((#:configure-flags _ ''())
-                      `(list "--without-ensurepip"))
-                     ((#:make-flags _ ''())
-                      `(list "MODDISABLED_NAMES=_ctypes ossaudiodev"))
+                      `(list "--without-ensurepip"
+                             "--without-threads"))
+                     ((#:phases phases)
+                      `(modify-phases ,phases
+                         (add-before 'configure 'disable-modules
+                           (lambda _
+                             (substitute* "setup.py"
+                               ;; Disable ctypes, since it requires libffi.
+                               (("extensions\\.append\\(ctypes\\)") "")
+                               ;; Prevent the 'ossaudiodev' extension from 
being
+                               ;; built, since it requires Linux headers.
+                               (("'linux', ") ""))
+                             #t))))
                      ((#:tests? _ #f) #f))))))
     (package-with-bootstrap-guile
      (package-with-explicit-inputs python %boot0-inputs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]