mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: python: Use G-Expressions.
* gnu/packages/python.scm (python-2.7)[arguments]: Use G-Expressions. (python-3.10): Likewise, update accordingly. (python-3.12): Likewise, update accordingly. (python-debug): Likewise, update accordingly. Change-Id: Iacb6f94fc6fb8ab70932321bc516a230c1c1003b
This commit is contained in:
parent
398d64f829
commit
83e3aa22a8
1 changed files with 684 additions and 674 deletions
|
@ -56,7 +56,7 @@
|
||||||
;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
|
;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
|
||||||
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
|
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
|
||||||
;;; Copyright © 2019, 2024 Tanguy Le Carrour <tanguy@bioneland.org>
|
;;; Copyright © 2019, 2024 Tanguy Le Carrour <tanguy@bioneland.org>
|
||||||
;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
|
;;; Copyright © 2020, 2023, 2025 Janneke Nieuwenhuizen <janneke@gnu.org>
|
||||||
;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
|
;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
|
||||||
;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
|
;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
|
||||||
;;; Copyright © 2022 jgart <jgart@dismail.de>
|
;;; Copyright © 2022 jgart <jgart@dismail.de>
|
||||||
|
@ -180,9 +180,10 @@
|
||||||
"idle")) ;programming environment; weighs 5MB
|
"idle")) ;programming environment; weighs 5MB
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:test-target "test"
|
(list
|
||||||
|
#:test-target "test"
|
||||||
#:configure-flags
|
#:configure-flags
|
||||||
(list "--enable-shared" ;allow embedding
|
#~(list "--enable-shared" ;allow embedding
|
||||||
"--with-system-expat" ;for XML support
|
"--with-system-expat" ;for XML support
|
||||||
"--with-system-ffi" ;build ctypes
|
"--with-system-ffi" ;build ctypes
|
||||||
"--with-ensurepip=install" ;install pip and setuptools
|
"--with-ensurepip=install" ;install pip and setuptools
|
||||||
|
@ -201,11 +202,11 @@
|
||||||
|
|
||||||
;; Disable runtime check failing if cross-compiling, see:
|
;; Disable runtime check failing if cross-compiling, see:
|
||||||
;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
|
;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
|
||||||
,@(if (%current-target-system)
|
#$@(if (%current-target-system)
|
||||||
'("ac_cv_buggy_getaddrinfo=no"
|
#~("ac_cv_buggy_getaddrinfo=no"
|
||||||
"ac_cv_file__dev_ptmx=no"
|
"ac_cv_file__dev_ptmx=no"
|
||||||
"ac_cv_file__dev_ptc=no")
|
"ac_cv_file__dev_ptc=no")
|
||||||
'())
|
#~())
|
||||||
;; -fno-semantic-interposition reinstates some optimizations by gcc
|
;; -fno-semantic-interposition reinstates some optimizations by gcc
|
||||||
;; leading to around 15% speedup. This is the default starting from
|
;; leading to around 15% speedup. This is the default starting from
|
||||||
;; python 3.10.
|
;; python 3.10.
|
||||||
|
@ -228,7 +229,7 @@
|
||||||
""))))
|
""))))
|
||||||
;; With no -j argument tests use all available cpus, so provide one.
|
;; With no -j argument tests use all available cpus, so provide one.
|
||||||
#:make-flags
|
#:make-flags
|
||||||
(list (string-append
|
#~(list (string-append
|
||||||
(format #f "TESTOPTS=-j~d" (parallel-job-count))
|
(format #f "TESTOPTS=-j~d" (parallel-job-count))
|
||||||
;; Exclude the following tests as they fail
|
;; Exclude the following tests as they fail
|
||||||
;; non-deterministically with "error: [Errno 104] Connection
|
;; non-deterministically with "error: [Errno 104] Connection
|
||||||
|
@ -237,19 +238,21 @@
|
||||||
;; https://github.com/python/cpython/commit/529525fb5a8fd9b96ab4021311a598c77588b918.
|
;; https://github.com/python/cpython/commit/529525fb5a8fd9b96ab4021311a598c77588b918.
|
||||||
" --exclude test_urllib2_localnet test_httplib"))
|
" --exclude test_urllib2_localnet test_httplib"))
|
||||||
|
|
||||||
#:modules ((ice-9 ftw) (ice-9 match)
|
#:modules '((ice-9 ftw)
|
||||||
(guix build utils) (guix build gnu-build-system))
|
(ice-9 match)
|
||||||
|
(guix build utils)
|
||||||
|
(guix build gnu-build-system))
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(add-before
|
(add-before
|
||||||
'configure 'patch-lib-shells
|
'configure 'patch-lib-shells
|
||||||
(lambda _
|
(lambda _
|
||||||
;; This variable is used in setup.py to enable cross compilation
|
;; This variable is used in setup.py to enable cross compilation
|
||||||
;; specific switches. As it is not set properly by configure
|
;; specific switches. As it is not set properly by configure
|
||||||
;; script, set it manually.
|
;; script, set it manually.
|
||||||
,@(if (%current-target-system)
|
#$@(if (%current-target-system)
|
||||||
'((setenv "_PYTHON_HOST_PLATFORM" ""))
|
#~((setenv "_PYTHON_HOST_PLATFORM" ""))
|
||||||
'())
|
#~())
|
||||||
;; Filter for existing files, since some may not exist in all
|
;; Filter for existing files, since some may not exist in all
|
||||||
;; versions of python that are built with this recipe.
|
;; versions of python that are built with this recipe.
|
||||||
(substitute* (filter file-exists?
|
(substitute* (filter file-exists?
|
||||||
|
@ -259,13 +262,13 @@
|
||||||
"Lib/test/support/__init__.py"
|
"Lib/test/support/__init__.py"
|
||||||
"Lib/test/test_subprocess.py"))
|
"Lib/test/test_subprocess.py"))
|
||||||
(("/bin/sh") (which "sh")))))
|
(("/bin/sh") (which "sh")))))
|
||||||
,@(if (system-hurd?)
|
#$@(if (system-hurd?)
|
||||||
`((add-before 'build 'patch-regen-for-hurd
|
#~((add-before 'build 'patch-regen-for-hurd
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
(let ((libc (assoc-ref inputs "libc")))
|
(let ((libc (assoc-ref inputs "libc")))
|
||||||
(substitute* "Lib/plat-generic/regen"
|
(substitute* "Lib/plat-generic/regen"
|
||||||
(("/usr/include/") (string-append libc "/include/")))))))
|
(("/usr/include/") (string-append libc "/include/")))))))
|
||||||
'())
|
#~())
|
||||||
(add-before 'configure 'do-not-record-configure-flags
|
(add-before 'configure 'do-not-record-configure-flags
|
||||||
(lambda* (#:key configure-flags #:allow-other-keys)
|
(lambda* (#:key configure-flags #:allow-other-keys)
|
||||||
;; Remove configure flags from the installed '_sysconfigdata.py'
|
;; Remove configure flags from the installed '_sysconfigdata.py'
|
||||||
|
@ -391,9 +394,9 @@
|
||||||
(format #t "Compiling with optimization level: ~a\n"
|
(format #t "Compiling with optimization level: ~a\n"
|
||||||
(if (null? opt) "none" (car opt)))
|
(if (null? opt) "none" (car opt)))
|
||||||
(apply invoke
|
(apply invoke
|
||||||
`(,,(if (%current-target-system)
|
`(,#$(if (%current-target-system)
|
||||||
"python2"
|
"python2"
|
||||||
'(string-append out "/bin/python"))
|
#~(string-append out "/bin/python"))
|
||||||
,@opt
|
,@opt
|
||||||
"-m" "compileall"
|
"-m" "compileall"
|
||||||
"-f" ; force rebuild
|
"-f" ; force rebuild
|
||||||
|
@ -407,7 +410,7 @@
|
||||||
(list '() '("-OO"))))
|
(list '() '("-OO"))))
|
||||||
(map cdr outputs)))))
|
(map cdr outputs)))))
|
||||||
(add-after 'install 'install-sitecustomize.py
|
(add-after 'install 'install-sitecustomize.py
|
||||||
,(customize-site version)))))
|
#$(customize-site version)))))
|
||||||
(inputs
|
(inputs
|
||||||
(list bzip2
|
(list bzip2
|
||||||
expat
|
expat
|
||||||
|
@ -481,14 +484,16 @@ data types.")
|
||||||
(arguments
|
(arguments
|
||||||
(substitute-keyword-arguments (package-arguments python-2)
|
(substitute-keyword-arguments (package-arguments python-2)
|
||||||
((#:configure-flags flags)
|
((#:configure-flags flags)
|
||||||
`(append ,flags '("--without-static-libpython")))
|
#~(append #$flags
|
||||||
|
;; XXX Use quote to avoid world rebuild at this time
|
||||||
|
'("--without-static-libpython")))
|
||||||
((#:make-flags _)
|
((#:make-flags _)
|
||||||
`(list (string-append
|
#~(list (string-append
|
||||||
(format #f "TESTOPTS=-j~d" (parallel-job-count))
|
(format #f "TESTOPTS=-j~d" (parallel-job-count))
|
||||||
;; test_mmap fails on low-memory systems
|
;; test_mmap fails on low-memory systems
|
||||||
" --exclude test_mmap test_socket"
|
" --exclude test_mmap test_socket"
|
||||||
,@(if (system-hurd?)
|
#$@(if (system-hurd?)
|
||||||
'(" test_posix" ;multiple errors
|
#~(" test_posix" ;multiple errors
|
||||||
" test_time"
|
" test_time"
|
||||||
" test_pty"
|
" test_pty"
|
||||||
" test_shutil"
|
" test_shutil"
|
||||||
|
@ -535,16 +540,16 @@ data types.")
|
||||||
" test_pdb "
|
" test_pdb "
|
||||||
" test_regrtest"
|
" test_regrtest"
|
||||||
" test_sqlite")
|
" test_sqlite")
|
||||||
'()))))
|
#~()))))
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
`(modify-phases ,phases
|
#~(modify-phases #$phases
|
||||||
,@(if (system-hurd?)
|
#$@(if (system-hurd?)
|
||||||
`((delete 'patch-regen-for-hurd) ;regen was removed after 3.5.9
|
#~((delete 'patch-regen-for-hurd) ;regen was removed after 3.5.9
|
||||||
(add-after 'unpack 'disable-multi-processing
|
(add-after 'unpack 'disable-multi-processing
|
||||||
(lambda _
|
(lambda _
|
||||||
(substitute* "Makefile.pre.in"
|
(substitute* "Makefile.pre.in"
|
||||||
(("-j0") "-j1")))))
|
(("-j0") "-j1")))))
|
||||||
'())
|
#~())
|
||||||
(add-after 'unpack 'remove-vendored-wheel-content
|
(add-after 'unpack 'remove-vendored-wheel-content
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Delete .exe from embedded .whl (zip) files
|
;; Delete .exe from embedded .whl (zip) files
|
||||||
|
@ -626,9 +631,9 @@ def contents() -> str:
|
||||||
(find-files output "\\.pyc$"))
|
(find-files output "\\.pyc$"))
|
||||||
|
|
||||||
(apply invoke
|
(apply invoke
|
||||||
`(,,(if (%current-target-system)
|
`(,#$(if (%current-target-system)
|
||||||
"python3"
|
"python3"
|
||||||
'(string-append out
|
#~(string-append out
|
||||||
"/bin/python3"))
|
"/bin/python3"))
|
||||||
"-m" "compileall"
|
"-m" "compileall"
|
||||||
"-o" "0" "-o" "1" "-o" "2"
|
"-o" "0" "-o" "1" "-o" "2"
|
||||||
|
@ -640,7 +645,7 @@ def contents() -> str:
|
||||||
,output)))
|
,output)))
|
||||||
(map cdr outputs)))))
|
(map cdr outputs)))))
|
||||||
(replace 'install-sitecustomize.py
|
(replace 'install-sitecustomize.py
|
||||||
,(customize-site version))))))
|
#$(customize-site version))))))
|
||||||
(inputs
|
(inputs
|
||||||
(modify-inputs (package-inputs python-2.7)
|
(modify-inputs (package-inputs python-2.7)
|
||||||
(replace "openssl" openssl)))
|
(replace "openssl" openssl)))
|
||||||
|
@ -1096,8 +1101,10 @@ def contents() -> str:
|
||||||
"idle")) ;programming environment; weighs 5MB
|
"idle")) ;programming environment; weighs 5MB
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:test-target "test"
|
(list
|
||||||
#:configure-flags (list "--enable-shared" ;allow embedding
|
#:test-target "test"
|
||||||
|
#:configure-flags
|
||||||
|
#~(list "--enable-shared" ;allow embedding
|
||||||
"--with-system-expat" ;for XML support
|
"--with-system-expat" ;for XML support
|
||||||
"--with-system-ffi" ;build ctypes
|
"--with-system-ffi" ;build ctypes
|
||||||
"--with-ensurepip=install" ;install pip and setuptools
|
"--with-ensurepip=install" ;install pip and setuptools
|
||||||
|
@ -1118,11 +1125,11 @@ def contents() -> str:
|
||||||
|
|
||||||
;; Disable runtime check failing if cross-compiling, see:
|
;; Disable runtime check failing if cross-compiling, see:
|
||||||
;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
|
;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
|
||||||
,@(if (%current-target-system)
|
#$@(if (%current-target-system)
|
||||||
'("ac_cv_buggy_getaddrinfo=no"
|
#~("ac_cv_buggy_getaddrinfo=no"
|
||||||
"ac_cv_file__dev_ptmx=no"
|
"ac_cv_file__dev_ptmx=no"
|
||||||
"ac_cv_file__dev_ptc=no")
|
"ac_cv_file__dev_ptc=no")
|
||||||
'())
|
#~())
|
||||||
;; -fno-semantic-interposition reinstates some
|
;; -fno-semantic-interposition reinstates some
|
||||||
;; optimizations by gcc leading to around 15% speedup.
|
;; optimizations by gcc leading to around 15% speedup.
|
||||||
;; This is the default starting from python 3.10.
|
;; This is the default starting from python 3.10.
|
||||||
|
@ -1132,7 +1139,8 @@ def contents() -> str:
|
||||||
"/lib"
|
"/lib"
|
||||||
" -fno-semantic-interposition"))
|
" -fno-semantic-interposition"))
|
||||||
;; With no -j argument tests use all available cpus, so provide one.
|
;; With no -j argument tests use all available cpus, so provide one.
|
||||||
#:make-flags (list (string-append (format #f "TESTOPTS=-j~d"
|
#:make-flags
|
||||||
|
#~(list (string-append (format #f "TESTOPTS=-j~d"
|
||||||
(parallel-job-count))
|
(parallel-job-count))
|
||||||
;; those tests fail on low-memory systems
|
;; those tests fail on low-memory systems
|
||||||
" --exclude"
|
" --exclude"
|
||||||
|
@ -1141,8 +1149,8 @@ def contents() -> str:
|
||||||
" test_threading"
|
" test_threading"
|
||||||
" test_asyncio"
|
" test_asyncio"
|
||||||
" test_shutdown"
|
" test_shutdown"
|
||||||
,@(if (system-hurd?)
|
#$@(if (system-hurd?)
|
||||||
'(" test_posix" ;multiple errors
|
#~(" test_posix" ;multiple errors
|
||||||
" test_time"
|
" test_time"
|
||||||
" test_pty"
|
" test_pty"
|
||||||
" test_shutil"
|
" test_shutil"
|
||||||
|
@ -1187,30 +1195,31 @@ def contents() -> str:
|
||||||
" test_pdb "
|
" test_pdb "
|
||||||
" test_regrtest"
|
" test_regrtest"
|
||||||
" test_sqlite")
|
" test_sqlite")
|
||||||
'())))
|
#~())))
|
||||||
|
|
||||||
#:modules ((ice-9 ftw)
|
#:modules '((ice-9 ftw)
|
||||||
(ice-9 match)
|
(ice-9 match)
|
||||||
(guix build utils)
|
(guix build utils)
|
||||||
(guix build gnu-build-system))
|
(guix build gnu-build-system))
|
||||||
|
|
||||||
#:phases (modify-phases %standard-phases
|
#:phases
|
||||||
,@(if (system-hurd?)
|
#~(modify-phases %standard-phases
|
||||||
`((add-after 'unpack
|
#$@(if (system-hurd?)
|
||||||
|
#~((add-after 'unpack
|
||||||
'disable-multi-processing
|
'disable-multi-processing
|
||||||
(lambda _
|
(lambda _
|
||||||
(substitute* "Makefile.pre.in"
|
(substitute* "Makefile.pre.in"
|
||||||
(("-j0")
|
(("-j0")
|
||||||
"-j1")))))
|
"-j1")))))
|
||||||
'())
|
#~())
|
||||||
(add-before 'configure 'patch-lib-shells
|
(add-before 'configure 'patch-lib-shells
|
||||||
(lambda _
|
(lambda _
|
||||||
;; This variable is used in setup.py to enable cross compilation
|
;; This variable is used in setup.py to enable cross compilation
|
||||||
;; specific switches. As it is not set properly by configure
|
;; specific switches. As it is not set properly by configure
|
||||||
;; script, set it manually.
|
;; script, set it manually.
|
||||||
,@(if (%current-target-system)
|
#$@(if (%current-target-system)
|
||||||
'((setenv "_PYTHON_HOST_PLATFORM" ""))
|
#~((setenv "_PYTHON_HOST_PLATFORM" ""))
|
||||||
'())
|
#~())
|
||||||
;; Filter for existing files, since some may not exist in all
|
;; Filter for existing files, since some may not exist in all
|
||||||
;; versions of python that are built with this recipe.
|
;; versions of python that are built with this recipe.
|
||||||
(substitute* (filter file-exists?
|
(substitute* (filter file-exists?
|
||||||
|
@ -1385,9 +1394,10 @@ def contents() -> str:
|
||||||
(find-files output "\\.pyc$"))
|
(find-files output "\\.pyc$"))
|
||||||
|
|
||||||
(apply invoke
|
(apply invoke
|
||||||
`(,,(if (%current-target-system)
|
`(,#$(if (%current-target-system)
|
||||||
"python3"
|
"python3"
|
||||||
'(string-append out
|
#~(string-append
|
||||||
|
out
|
||||||
"/bin/python3")) "-m"
|
"/bin/python3")) "-m"
|
||||||
"compileall"
|
"compileall"
|
||||||
"-o"
|
"-o"
|
||||||
|
@ -1412,7 +1422,7 @@ def contents() -> str:
|
||||||
inputs) "tzdata")
|
inputs) "tzdata")
|
||||||
"/share/zoneinfo"))))
|
"/share/zoneinfo"))))
|
||||||
(add-after 'install 'install-sitecustomize.py
|
(add-after 'install 'install-sitecustomize.py
|
||||||
,(customize-site version)))))
|
#$(customize-site version)))))
|
||||||
(inputs (list bzip2
|
(inputs (list bzip2
|
||||||
expat
|
expat
|
||||||
gdbm
|
gdbm
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue