@@ -3484,8 +3484,20 @@ (define-public petsc
'("configure.log" "make.log" "gmake.log"
"test.log" "error.log" "RDict.db"
"PETScBuildInternal.cmake"
+ "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")
+ (("/gnu/store/.*/bin/gcc") "gcc")
+ (("/gnu/store/.*/bin/g++") "g++")
+ (("/gnu/store/.*/bin/make") "make")
+ (("/gnu/store/.*/bin/diff") "diff")
+ (("/gnu/store/.*/bin/sed") "sed")
+ ))))
(add-after 'install 'move-examples
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))