Subject: Re: [bug#28593] [PATCH] gnu: openfoam: Clean up to reduce closure.
From: [email-masked] (Ludovic Courtès)
To: Dave Love <[email-masked]>
Cc: [email-masked], Paul Garlick <[email-masked]>
Date: Fri, 01 Dec 2017 11:27:57 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Dave Love <[email-masked]> skribis:

>>From dc88db3e91c70da5e6e557ed5fdd528499cb1c65 Mon Sep 17 00:00:00 2001
> From: Dave Love <[email-masked]>
> Date: Sat, 21 Oct 2017 17:20:42 +0100
> Subject: [PATCH] gnu: openfoam: Clean up to reduce closure.
>
> This saves ~1GB.
>
> * gnu/packages/simulation.scm (openfoam)[outputs]: Add debug.
> [arguments]: Clean up .o and src after build.

I removed the FIXME as suggested by Paul, made the changes below, and
committed.

Thank you,
Ludo’.

diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm
index 3e65d1687..a5b661e34 100644
--- a/gnu/packages/simulation.scm
+++ b/gnu/packages/simulation.scm
@@ -84,8 +84,6 @@
      `(("gzip" ,gzip)
        ("gnuplot" ,gnuplot)
        ("openmpi" ,openmpi)))
-    ;; FIXME: Also separate tutorials (80MB) and src (60MB); maybe also doc
-    ;; (8MB)
     (outputs '("debug"                  ;~60MB
                "out"))
     (arguments
@@ -176,14 +174,14 @@
                          "lockDir=$HOME/.$WM_PROJECT/.wmake\n"))
                       #t))
                   (add-after 'build 'cleanup
-                    ;; Avoid unncessary, voluminous object and dep files
+                    ;; Avoid unncessary, voluminous object and dep files.
                     (lambda _
                       (delete-file-recursively
                        "platforms/linux64GccDPInt32Opt/src")
                       (delete-file-recursively
                        "platforms/linux64GccDPInt32OptSYSTEMOPENMPI")
-                      (zero?
-                       (system* "find" "-name" "*.o" "-delete"))))
+                      (for-each delete-file (find-files "." "\\.o$"))
+                      #t))
                   (replace 'install
                     (lambda _
                       ;; use 'OpenFOAM-version' convention