;;; Copyright © 2016 Daniel Pimentel <d4n1@d4n1.org>
;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2016, 2017 Troy Sankey <sankeytms@gmail.com>
-;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
+;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
;;; Copyright © 2016 David Craven <david@craven.ch>
-;;; Copyright © 2016, 2017, 2018, 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2016, 2017 Stefan Reichör <stefan@xsteve.at>
;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
;;; Copyright © 2016, 2017 Alex Vong <alexvong1995@gmail.com>
;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
#:use-module (gnu packages bash)
#:use-module (gnu packages compression)
#:use-module (gnu packages dbm)
+ #:use-module (gnu packages hurd)
#:use-module (gnu packages libffi)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages readline)
#:use-module (guix download)
#:use-module (guix utils)
#:use-module (guix build-system gnu)
- #:use-module (guix build-system trivial))
+ #:use-module (guix build-system trivial)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-26))
(define-public python-2.7
(package
"Lib/test/test_subprocess.py"))
(("/bin/sh") (which "sh")))
#t))
+ ,@(if (hurd-system?)
+ `((add-before 'build 'patch-regen-for-hurd
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((libc (assoc-ref inputs "libc")))
+ (substitute* "Lib/plat-generic/regen"
+ (("/usr/include/") (string-append libc "/include/")))
+ #t))))
+ '())
(add-before 'configure 'do-not-record-configure-flags
(lambda* (#:key configure-flags #:allow-other-keys)
;; Remove configure flags from the installed '_sysconfigdata.py'
(define-public python-3.8
(package (inherit python-2)
(name "python")
- (version "3.8.1")
+ (version "3.8.2")
(source (origin
(method url-fetch)
(uri (string-append "https://www.python.org/ftp/python/"
"python-3-search-paths.patch"))
(sha256
(base32
- "1s4lwn5vzsajlc88m6hkghsvnjw4d00l2dsgng0m2w6vyqbl32bm"))
+ "1ps5v323cp5czfshqjmbsqw7nvrdpcbk06f62jbzaqik4gfffii6"))
(modules '((guix build utils)))
(snippet
'(begin
" test_socket")))
((#:phases phases)
`(modify-phases ,phases
+ ,@(if (hurd-system?)
+ `((delete 'patch-regen-for-hurd)) ;regen was removed after 3.5.9
+ '())
(add-before 'check 'set-TZDIR
(lambda* (#:key inputs native-inputs #:allow-other-keys)
;; test_email requires the Olson time zone database.
,file)))
(find-files out "\\.py$")))
(list '() '("-O") '("-OO")))
- #t)))))))
+ #t)))
+ ;; XXX: Apply patch on ARM platforms only to avoid a full rebuild.
+ ;; Remove this phase in the next rebuild cycle.
+ ,@(let ((system (or (%current-target-system)
+ (%current-system))))
+ (if (any (cute string-prefix? <> system)
+ '("arm" "aarch64"))
+ '((add-after 'unpack 'apply-alignment-patch
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
+ (invoke "patch" "-p1" "--force" "--input"
+ (assoc-ref (or native-inputs inputs)
+ "arm-alignment.patch")))))
+ '()))))))
(native-inputs
`(("tzdata" ,tzdata-for-tests)
+
+ ;; Disable unaligned accesses in the sha3 module on ARM as
+ ;; it causes a test failure when building 32-bit Python on a
+ ;; 64-bit kernel. See <https://bugs.python.org/issue36515>.
+ ;; TODO: make this a regular patch in the next rebuild cycle.
+ ,@(let ((system (or (%current-target-system)
+ (%current-system))))
+ (if (any (cute string-prefix? <> system)
+ '("arm" "aarch64"))
+ `(("arm-alignment.patch" ,(search-patch "python-3-arm-alignment.patch")))
+ '()))
+
,@(if (%current-target-system)
`(("python3" ,this-package))
'())