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.scm29
1 files changed, 12 insertions, 17 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0ec790223e9..0b763af9243 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -533,23 +533,18 @@ data types.")
533 ;; Disable hash randomization to ensure the generated .pycs 533 ;; Disable hash randomization to ensure the generated .pycs
534 ;; are reproducible. 534 ;; are reproducible.
535 (setenv "PYTHONHASHSEED" "0") 535 (setenv "PYTHONHASHSEED" "0")
536 (for-each 536 (apply invoke
537 (lambda (opt) 537 `(,,(if (%current-target-system)
538 (format #t "Compiling with optimization level: ~a\n" opt) 538 "python3"
539 (lambda (file) 539 '(string-append out
540 (apply invoke 540 "/bin/python3"))
541 `(,,(if (%current-target-system) 541 "-m" "compileall"
542 "python3" 542 "-o" "0" "-o" "1" "-o" "2"
543 '(string-append out 543 "-f" ; force rebuild
544 "/bin/python3")) 544 "--invalidation-mode=unchecked-hash"
545 ,opt 545 ;; Don't build lib2to3, because it's Python 2 code.
546 "-m" "compileall" 546 "-x" "lib2to3/.*"
547 "-f" ; force rebuild 547 ,out)))))
548 "--invalidation-mode=unchecked-hash"
549 ;; Don't build lib2to3, because it's Python 2 code.
550 "-x" "lib2to3/.*"
551 ,out))))
552 (list "none" "-O" "-OO")))))
553 (replace 'install-sitecustomize.py 548 (replace 'install-sitecustomize.py
554 ,(customize-site version)))))) 549 ,(customize-site version))))))
555 (native-inputs 550 (native-inputs