@@ -515,6 +515,19 @@ (define-public python-3.10
(substitute* "Makefile.pre.in"
(("-j0") "-j1")))))
'())
+ (add-after 'unpack 'patch-distutils
+ (lambda _
+ ;; Ensure byte_compile produces the same output regardless
+ ;; filesystem ordering. For more information see:
+ ;; https://bugzilla.opensuse.org/show_bug.cgi?id=1049186
+ (let* ((file "Lib/distutils/util.py")
+ (old-content (call-with-input-file file get-string-all)))
+ (substitute* file
+ (("^ for file in py_files:\n$")
+ " for file in sorted(py_files):\n"))
+ (if (string=? old-content
+ (call-with-input-file file get-string-all))
+ (error "substitute did nothing, phase requires an update")))))
(add-after 'unpack 'remove-windows-binaries
(lambda _
;; Delete .exe from embedded .whl (zip) files