gnu: python: Remove unnecessary files.
* gnu/packages/python.scm (python2)[arguments]: Remove files built during the test phase. (python3)[arguments]: Also remove windows binaries shipped with the sources.
This commit is contained in:
parent
eda6a95d9d
commit
20d52562e5
|
@ -11,6 +11,7 @@
|
||||||
;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
|
;;; Copyright © 2020 Guy Fleury Iteriteka <gfleury@disroot.org>
|
||||||
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||||
;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
|
;;; Copyright © 2021 Chris Marusich <cmmarusich@gmail.com>
|
||||||
|
;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -3091,7 +3092,12 @@ memoized as a function of '%current-system'."
|
||||||
(delete-file-recursively "Modules/expat")
|
(delete-file-recursively "Modules/expat")
|
||||||
(substitute* "Modules/Setup.dist"
|
(substitute* "Modules/Setup.dist"
|
||||||
;; Link Expat instead of embedding the bundled one.
|
;; Link Expat instead of embedding the bundled one.
|
||||||
(("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n")))))))
|
(("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n"))
|
||||||
|
;; Delete windows binaries
|
||||||
|
(for-each delete-file
|
||||||
|
(find-files "Lib/distutils/command" ".*.exe$"))
|
||||||
|
(for-each delete-file
|
||||||
|
(find-files "Lib/ensurepip" ".*.whl$")))))))
|
||||||
(inputs
|
(inputs
|
||||||
`(,@(%boot0-inputs)
|
`(,@(%boot0-inputs)
|
||||||
("expat" ,expat-sans-tests))) ;remove OpenSSL, zlib, etc.
|
("expat" ,expat-sans-tests))) ;remove OpenSSL, zlib, etc.
|
||||||
|
@ -3122,6 +3128,7 @@ memoized as a function of '%current-system'."
|
||||||
('add-after unpack apply-alignment-patch _))
|
('add-after unpack apply-alignment-patch _))
|
||||||
`(modify-phases ,original-phases ,@changes))
|
`(modify-phases ,original-phases ,@changes))
|
||||||
(_ phases)))
|
(_ phases)))
|
||||||
|
(delete 'remove-windows-binaries)
|
||||||
(add-before 'configure 'disable-modules
|
(add-before 'configure 'disable-modules
|
||||||
(lambda _
|
(lambda _
|
||||||
(substitute* "setup.py"
|
(substitute* "setup.py"
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
|
;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
|
||||||
;;; Copyright © 2016, 2017 Alex Vong <alexvong1995@gmail.com>
|
;;; Copyright © 2016, 2017 Alex Vong <alexvong1995@gmail.com>
|
||||||
;;; Copyright © 2016, 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
|
;;; Copyright © 2016, 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
|
||||||
;;; Copyright © 2016, 2017, 2018 Julien Lepiller <julien@lepiller.eu>
|
|
||||||
;;; Copyright © 2016–2018, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
|
;;; Copyright © 2016–2018, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||||
|
;;; Copyright © 2016, 2017, 2018, 2021 Julien Lepiller <julien@lepiller.eu>
|
||||||
;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
|
;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
|
||||||
;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
|
;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
|
||||||
;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
|
;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
|
||||||
|
@ -295,7 +295,16 @@
|
||||||
(not
|
(not
|
||||||
(string-prefix? "test_support."
|
(string-prefix? "test_support."
|
||||||
file))))))
|
file))))))
|
||||||
(call-with-output-file "__init__.py" (const #t)))))))))
|
(call-with-output-file "__init__.py" (const #t))))
|
||||||
|
(let ((libdir (string-append out "/lib/" pythonX.Y)))
|
||||||
|
(for-each
|
||||||
|
(lambda (directory)
|
||||||
|
(let ((dir (string-append libdir "/" directory)))
|
||||||
|
(when (file-exists? dir)
|
||||||
|
(delete-file-recursively dir))))
|
||||||
|
'("email/test" "ctypes/test" "unittest/test" "tkinter/test"
|
||||||
|
"sqlite3/test" "bsddb/test" "lib-tk/test" "lib2to3/tests"
|
||||||
|
"json/tests" "distutils/tests"))))))))
|
||||||
(add-after 'remove-tests 'rebuild-bytecode
|
(add-after 'remove-tests 'rebuild-bytecode
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(let ((out (assoc-ref outputs "out")))
|
(let ((out (assoc-ref outputs "out")))
|
||||||
|
@ -416,6 +425,9 @@ data types.")
|
||||||
(substitute* "Modules/Setup"
|
(substitute* "Modules/Setup"
|
||||||
;; Link Expat instead of embedding the bundled one.
|
;; Link Expat instead of embedding the bundled one.
|
||||||
(("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n"))
|
(("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n"))
|
||||||
|
;; Delete windows binaries
|
||||||
|
(for-each delete-file
|
||||||
|
(find-files "Lib/distutils/command" "\\.exe$"))
|
||||||
#t))))
|
#t))))
|
||||||
(arguments
|
(arguments
|
||||||
(substitute-keyword-arguments (package-arguments python-2)
|
(substitute-keyword-arguments (package-arguments python-2)
|
||||||
|
@ -461,6 +473,23 @@ data types.")
|
||||||
,@(if (hurd-system?)
|
,@(if (hurd-system?)
|
||||||
`((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 'remove-windows-binaries
|
||||||
|
(lambda _
|
||||||
|
;; Delete .exe from embedded .whl (zip) files
|
||||||
|
(for-each
|
||||||
|
(lambda (whl)
|
||||||
|
(let ((dir "whl-content"))
|
||||||
|
(mkdir-p dir)
|
||||||
|
(with-directory-excursion dir
|
||||||
|
(let ((whl (string-append "../" whl)))
|
||||||
|
(invoke "unzip" whl)
|
||||||
|
(for-each delete-file
|
||||||
|
(find-files "." "\\.exe$"))
|
||||||
|
(delete-file whl)
|
||||||
|
(apply invoke "zip" "-X" whl
|
||||||
|
(find-files "." ".*" #:directories? #t))))
|
||||||
|
(delete-file-recursively dir)))
|
||||||
|
(find-files "Lib/ensurepip" "\\.whl$"))))
|
||||||
(add-before 'check 'set-TZDIR
|
(add-before 'check 'set-TZDIR
|
||||||
(lambda* (#:key inputs native-inputs #:allow-other-keys)
|
(lambda* (#:key inputs native-inputs #:allow-other-keys)
|
||||||
;; test_email requires the Olson time zone database.
|
;; test_email requires the Olson time zone database.
|
||||||
|
@ -495,6 +524,8 @@ data types.")
|
||||||
,(customize-site version))))))
|
,(customize-site version))))))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("tzdata" ,tzdata-for-tests)
|
`(("tzdata" ,tzdata-for-tests)
|
||||||
|
("unzip" ,unzip)
|
||||||
|
("zip" ,(@ (gnu packages compression) zip))
|
||||||
,@(if (%current-target-system)
|
,@(if (%current-target-system)
|
||||||
`(("python3" ,this-package))
|
`(("python3" ,this-package))
|
||||||
'())
|
'())
|
||||||
|
|
Loading…
Reference in New Issue