Subject: [bug#72766] [PATCH v3 2/2] gnu: slurm: Move client executables into separate output.

From: Arun Isaac <[email-masked]>
Date: Fri, 18 Oct 2024 15:58:12 +0100

* gnu/packages/parallel.scm (slurm)[outputs]: Add client.
[arguments]: Add move-client-executables phase.

Change-Id: Id7441b0b34a5b8433e4c38bd5c56e4ca1fec587c
---
 gnu/packages/parallel.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/parallel.scm b/gnu/packages/parallel.scm
index 522d326ef2..f27f07ca1e 100644
--- a/gnu/packages/parallel.scm
+++ b/gnu/packages/parallel.scm
@@ -246,6 +246,7 @@ (define-public slurm
     (native-inputs
      (list autoconf expect perl pkg-config python-wrapper))
     (build-system gnu-build-system)
+    (outputs '("out" "client"))
     (arguments
      (list #:configure-flags
            #~(list "--enable-pam"
@@ -291,7 +292,17 @@ (define-public slurm
                    (invoke "make" "install" "-C" "contribs/pmi")
 
                    ;; Others expect pmi2.
-                   (invoke "make" "install" "-C" "contribs/pmi2"))))))
+                   (invoke "make" "install" "-C" "contribs/pmi2")))
+               (add-after 'install 'move-client-executables
+                 (lambda _
+                   (let ((client-bin (string-append #$output:client "/bin")))
+                     (mkdir-p client-bin)
+                     (for-each (lambda (executable)
+                                 (rename-file executable
+                                              (string-append client-bin
+                                                             "/"
+                                                             (basename executable))))
+                               (find-files (string-append #$output "/bin")))))))))
     (home-page "https://slurm.schedmd.com/")
     (synopsis "Workload manager for cluster computing")
     (description
-- 
2.45.2