summaryrefslogtreecommitdiff
path: root/gnu/packages/python.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/python.scm')
-rw-r--r--gnu/packages/python.scm60
1 files changed, 35 insertions, 25 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 077814719d..3e3074d5d8 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -150,6 +150,7 @@
"python-2.7-adjust-tests.patch"
"python-cross-compile.patch"
"python-2.7-CVE-2021-3177.patch"
+ "python-2.7-expat-compat.patch"
"python-2.7-no-static-lib.patch"))
(modules '((guix build utils)))
(snippet
@@ -419,11 +420,11 @@ data types.")
;; Current 2.x version.
(define-public python-2 python-2.7)
-(define-public python-3.9
+(define-public python-3.10
(package
(inherit python-2)
(name "python")
- (version "3.9.9")
+ (version "3.10.7")
(source (origin
(method url-fetch)
(uri (string-append "https://www.python.org/ftp/python/"
@@ -433,11 +434,10 @@ data types.")
"python-3-deterministic-build-info.patch"
"python-3-fix-tests.patch"
"python-3-hurd-configure.patch"
- "python-3-search-paths.patch"
- "python-3-no-static-lib.patch"))
+ "python-3-search-paths.patch"))
(sha256
(base32
- "09vd7g71i11iz5ydqghwc8kaxr0vgji94hhwwnj77h3kll28r0h6"))
+ "0j6wvh2ad5jjq5n7sjmj1k66mh6lipabavchc3rb4vsinwaq9vbf"))
(modules '((guix build utils)))
(snippet
'(begin
@@ -451,6 +451,8 @@ data types.")
(find-files "Lib/distutils/command" "\\.exe$"))))))
(arguments
(substitute-keyword-arguments (package-arguments python-2)
+ ((#:configure-flags flags)
+ `(append ,flags '("--without-static-libpython")))
((#:make-flags _)
`(list (string-append
(format #f "TESTOPTS=-j~d" (parallel-job-count))
@@ -575,7 +577,7 @@ data types.")
(files (list "share/zoneinfo")))))))
;; Current 3.x version.
-(define-public python-3 python-3.9)
+(define-public python-3 python-3.10)
;; Current major version.
(define-public python python-3)
@@ -633,30 +635,38 @@ for more information.")))
(inputs `(("bash" ,bash)))
(propagated-inputs `(("python" ,python)))
(arguments
- `(#:modules ((guix build utils))
- #:builder
- (begin
- (use-modules (guix build utils))
- (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
- (python (string-append (assoc-ref %build-inputs "python") "/bin/")))
- (mkdir-p bin)
- (for-each
+ (list #:modules '((guix build utils))
+ #:builder
+ #~(begin
+ (use-modules (guix build utils))
+
+ ;; TODO: Remove 'assoc-ref' uses on next rebuild cycle.
+ (let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
+ (python (string-append
+ ;; XXX: '%build-inputs' contains the native
+ ;; Python when cross-compiling.
+ #$(if (%current-target-system)
+ (this-package-input "python")
+ #~(assoc-ref %build-inputs "python"))
+ "/bin/")))
+ (mkdir-p bin)
+ (for-each
(lambda (old new)
(symlink (string-append python old)
(string-append bin "/" new)))
`("python3" ,"pydoc3" ,"pip3")
`("python" ,"pydoc" ,"pip"))
- ;; python-config outputs search paths based upon its location,
- ;; use a bash wrapper to avoid changing its outputs.
- (let ((bash (string-append (assoc-ref %build-inputs "bash")
- "/bin/bash"))
- (old (string-append python "python3-config"))
- (new (string-append bin "/python-config")))
- (with-output-to-file new
- (lambda ()
- (format #t "#!~a~%" bash)
- (format #t "exec \"~a\" \"$@\"~%" old)
- (chmod new #o755))))))))
+ ;; python-config outputs search paths based upon its location,
+ ;; use a bash wrapper to avoid changing its outputs.
+ (let ((bash (string-append (assoc-ref %build-inputs "bash")
+ "/bin/bash"))
+ (old (string-append python "python3-config"))
+ (new (string-append bin "/python-config")))
+ (with-output-to-file new
+ (lambda ()
+ (format #t "#!~a~%" bash)
+ (format #t "exec \"~a\" \"$@\"~%" old)
+ (chmod new #o755))))))))
(synopsis "Wrapper for the Python 3 commands")
(description
"This package provides wrappers for the commands of Python@tie{}3.x such