diff mbox series

[bug#67822,v2] gnu: maths: petsc: Reduce closure size.

Message ID 5b3a72695c82aa1c46e79ed30004d30d56df61ea.1702565587.git.lars.bilke@ufz.de
State New
Headers show
Series [bug#67822,v2] gnu: maths: petsc: Reduce closure size. | expand

Commit Message

Lars Bilke Dec. 14, 2023, 2:53 p.m. UTC
Reduces closure size by around 350 MB by removing refernces to build
dependencies (e.g. gcc).

The v2 patch does not delete petscvariables but only removes some store
references. This fixes downstream packages such as e.g. dealii-openmpi.

Change-Id: I2e6900747b2118546f0a39ceb109b3f2f90e6949
---
 gnu/packages/maths.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)


base-commit: ac61e9705fb8c450c6cd0c1731fbb1b909c1f944
diff mbox series

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 0f4d29b40f..8e8e380336 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -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"))