diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 471cf190fb..0b887a2cdb 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -836,7 +836,7 @@ (define-public python-3.12 "json/tests" "distutils/tests")))))))) (add-after 'remove-tests 'move-tk-inter - (lambda* (#:key outputs #:allow-other-keys) + (lambda* (#:key outputs inputs #:allow-other-keys) ;; When Tkinter support is built move it to a separate output so ;; that the main output doesn't contain a reference to Tcl/Tk. (let ((out (assoc-ref outputs "out")) @@ -854,7 +854,14 @@ (define-public python-3.12 len) "/site-packages"))) (install-file tkinter.so target) - (delete-file tkinter.so)))))))) + (delete-file tkinter.so)))) + ;; Remove explicit store path references. + (let ((tcl (assoc-ref inputs "tcl")) + (tk (assoc-ref inputs "tk"))) + (substitute* (find-files (string-append out "/lib") + "^(_sysconfigdata_.*\\.py|Makefile)$") + (((string-append "-L" tk "/lib")) "") + (((string-append "-L" tcl "/lib")) ""))))))) (add-after 'move-tk-inter 'move-idle (lambda* (#:key outputs #:allow-other-keys) ;; when idle is built, move it to a separate output to save some