[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#57005: [PATCH v2] gnu: petsc: scrub build machine specifics
From: |
Lars Bilke |
Subject: |
bug#57005: [PATCH v2] gnu: petsc: scrub build machine specifics |
Date: |
Fri, 01 Mar 2024 09:27:02 +0100 |
'Libraries compiled on' does not have to be removed since PETSc 3.9:
https:
//gitlab.com/petsc/petsc/-/commit/a970bd748978a4e12790be7c36b10e832ec0149f
Also merged all add-after 'install phases into `clean-install.
Change-Id: I41d82339e43187d7dc7e3fc189a338784c363c68
---
gnu/packages/maths.scm | 43 ++++++++++++++++++------------------------
1 file changed, 18 insertions(+), 25 deletions(-)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 1f61ee0583..4b4d033506 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3455,30 +3455,34 @@ (define-public petsc
(substitute* "config/example_template.py"
(("#!/usr/bin/env bash")
(string-append "#!" (which "bash")))))))
- (add-after 'configure 'clean-local-references
- (lambda* (#:key outputs #:allow-other-keys)
+ (add-after 'install 'clean-install
+ ;; Try to keep installed files from leaking build directory names.
+ (lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
- (substitute* (find-files "." "^petsc(conf|machineinfo).h$")
+ (substitute* (find-files "." "petscmachineinfo.h")
;; Prevent build directory from leaking into compiled code
(((getcwd)) out)
- ;; Scrub timestamp for reproducibility
- ((".*Libraries compiled on.*") ""))
+ ;; Scrub build machine characteristic
+ (("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")
- (("NPMAX = [:digit:]+") "NPMAX = 2")))))
- (add-after 'install 'clean-install
- ;; Try to keep installed files from leaking build directory names.
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out")))
+ (("MAKE_NP = [[:digit:]]+") "MAKE_NP = 2")
+ (("MAKE_TEST_NP = [[:digit:]]+") "MAKE_TEST_NP = 2")
+ (("MAKE_LOAD = [[:digit:]]+\\.[[:digit:]]+") "MAKE_LOAD =
2.0")
+ (("NPMAX = [[:digit:]]+") "NPMAX = 2"))
(substitute* (map (lambda (file)
(string-append out "/lib/petsc/conf/"
file))
'("petscvariables"))
(((getcwd)) out))
- ;; Make compiler references point to the store
(substitute* (string-append out
"/lib/petsc/conf/petscvariables")
- (("= (gcc|g\\+\\+|gfortran)" _ compiler)
- (string-append "= " (which compiler))))
+ ;; Do not retain a reference to GCC and other build only
inputs.
+ (("([[:graph:]]+)/bin/gcc") "gcc")
+ (("([[:graph:]]+)/bin/g\\+\\+") "g++")
+ (("([[:graph:]]+)/bin/make") "make")
+ (("([[:graph:]]+)/bin/diff") "diff")
+ (("([[:graph:]]+)/bin/sed") "sed")
+ (("([[:graph:]]+)/bin/gfortran") "gfortran"))
;; PETSc installs some build logs, which aren't necessary.
(for-each (lambda (file)
(let ((f (string-append out "/lib/petsc/conf/"
file)))
@@ -3490,17 +3494,6 @@ (define-public petsc
"configure-hash"
;; Once installed, should uninstall with Guix
"uninstall.py")))))
- (add-after 'clean-install 'clear-reference-to-compiler
- (lambda* (#:key inputs outputs #:allow-other-keys)
- ;; Do not retain a reference to GCC and other build only inputs.
- (let ((out (assoc-ref outputs "out")))
- (substitute* (string-append out "/lib/petsc/conf/petscvariables")
- (("([[:graph:]]+)/bin/gcc") "gcc")
- (("([[:graph:]]+)/bin/g\\+\\+") "g++")
- (("([[:graph:]]+)/bin/make") "make")
- (("([[:graph:]]+)/bin/diff") "diff")
- (("([[:graph:]]+)/bin/sed") "sed")
- (("([[:graph:]]+)/bin/gfortran") "gfortran")))))
(add-after 'install 'move-examples
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
base-commit: 75bad75367fcf2c289fae3b40dbcc850f92177be
--
2.43.0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#57005: [PATCH v2] gnu: petsc: scrub build machine specifics,
Lars Bilke <=