aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorLars Bilke <lars.bilke@ufz.de>2024-07-26 18:15:16 +0200
committerLudovic Courtès <ludo@gnu.org>2024-07-26 18:18:12 +0200
commit31fe177a97bacec643180cc5bcf8805a6cb07481 (patch)
tree6848975e5bc65f0d2fa5cf7061f785a23a0a64a6 /gnu/packages
parent4c8997c12336803d9dcc7529e44acb6602260147 (diff)
downloadguix-31fe177a97bacec643180cc5bcf8805a6cb07481.tar.gz
guix-31fe177a97bacec643180cc5bcf8805a6cb07481.zip
gnu: petsc: Build reproducibly.
* gnu/packages/maths.scm (petsc)[arguments]: In ‘configure’ phase, add ‘sorted’ call in ‘gmakegen.py’. In ‘clean-local-references’, remove substitution of “Libraries compiled on”, which is unnecessary since PETSc 3.9 (<https://gitlab.com/petsc/petsc/-/commit/a970bd748978a4e12790be7c36b10e832ec0149f>). Add substitution for “Machine characteristics” bit. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Change-Id: Ibb846c1ae368af94b46d5ce789b1263e0bc78a13
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/maths.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 1265ae13e9..e4c13a13bd 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3545,6 +3545,11 @@ September 2004}")
(let* ((prefix (assoc-ref outputs "out"))
(flags `(,(string-append "--prefix=" prefix)
,@configure-flags)))
+ ;; Sort source files in configure (for reproducibility).
+ (substitute* "config/gmakegen.py"
+ (("join\\(srcs\\[lang\\]\\)")
+ "join(sorted(srcs[lang]))"))
+
(format #t "build directory: ~s~%" (getcwd))
(format #t "configure flags: ~s~%" flags)
(apply invoke "./configure" flags)
@@ -3559,8 +3564,8 @@ September 2004}")
(substitute* (find-files "." "^petsc(conf|machineinfo).h$")
;; Prevent build directory from leaking into compiled code
(((getcwd)) out)
- ;; Scrub timestamp for reproducibility
- ((".*Libraries compiled on.*") ""))
+ (("Machine characteristics: Linux-[0-9]+\\.[0-9]+\\.[0-9]+")
+ "Machine characteristics: Linux-x.x.x"))
(substitute* (find-files "." "petscvariables")
;; Do not expose build machine characteristics, set to defaults.
(("MAKE_NP = [:digit:]+") "MAKE_NP = 2")