aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-10-07 11:30:41 +0200
committerLudovic Courtès <ludo@gnu.org>2015-10-07 11:30:41 +0200
commit14f8dae6b1e42cfd37678d64c137932b91656a41 (patch)
tree17c7f14f1d0917b3a85e19132f199e62885d2467
parent42e735dfc78ff89aff8a6e6e6dc60142f4ee2bf3 (diff)
downloadguix-14f8dae6b1e42cfd37678d64c137932b91656a41.tar.gz
guix-14f8dae6b1e42cfd37678d64c137932b91656a41.zip
gnu: python: Do not retain references to build tools.
* gnu/packages/python.scm (python-2)[arguments]: Add 'do-not-record-configure-flags' and 'do-not-record-configure-flags-in-makefile' phases.
-rw-r--r--gnu/packages/python.scm18
1 files changed, 18 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index fd1a2d3601..05c1f504ef 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -175,6 +175,24 @@
(("/bin/sh") (which "sh")))
#t))
(add-before
+ 'install 'do-not-record-configure-flags
+ (lambda _
+ ;; Remove configure flags from '_sysconfigdata.py' so we don't
+ ;; end up keeping references to the build tools.
+ (substitute* (find-files "." "sysconfigdata\\.py$")
+ (("'CONFIG_ARGS':.*")
+ "'CONFIG_ARGS': \"\",\n"))
+ #t))
+ (add-after
+ 'install 'do-not-record-configure-flags-in-makefile
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Likewise.
+ (let ((out (assoc-ref outputs "out")))
+ (substitute* (find-files out "^Makefile$")
+ (("^CONFIG_ARGS[[:blank:]]*=.*$")
+ "CONFIG_ARGS =\n"))
+ #t)))
+ (add-before
'check 'pre-check
(lambda _
;; 'Lib/test/test_site.py' needs a valid $HOME