unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 74572@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>,
	Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#74572] [PATCH 6/6] gnu: openmpi-5: Streamline source and do not install HTML doc.
Date: Thu, 28 Nov 2024 16:47:57 +0900	[thread overview]
Message-ID: <040e8d813af84e53e68c61f747059c229b6b70f5.1732774966.git.maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <cover.1732774966.git.maxim.cournoyer@gmail.com>

This reduces the installed package size by 63 MiB.

* gnu/packages/mpi.scm (openmpi-5) [source]: Add modules, snippet fields.

Change-Id: Ie3dc365a2e4e48dc4c385dd447d3c64b7db065ca
---
 gnu/packages/mpi.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/mpi.scm b/gnu/packages/mpi.scm
index 67e12657db..2f37364ef3 100644
--- a/gnu/packages/mpi.scm
+++ b/gnu/packages/mpi.scm
@@ -325,6 +325,31 @@ (define-public openmpi-5
        (uri (string-append "https://www.open-mpi.org/software/ompi/v"
                            (version-major+minor version)
                            "/downloads/openmpi-" version ".tar.bz2"))
+       (modules '((guix build utils)
+                  (ice-9 ftw)
+                  (srfi srfi-26)))
+       (snippet
+        '(begin
+           ;; XXX: 'delete-all-but' is copied from the turbovnc package.
+           (define (delete-all-but directory . preserve)
+             (define (directory? x)
+               (and=> (stat x #f)
+                      (compose (cut eq? 'directory <>) stat:type)))
+             (with-directory-excursion directory
+               (let* ((pred
+                       (negate (cut member <> (append '("." "..") preserve))))
+                      (items (scandir "." pred)))
+                 (for-each (lambda (item)
+                             (if (directory? item)
+                                 (delete-file-recursively item)
+                                 (delete-file item)))
+                           items))))
+           ;; Delete as many bundled libraries as permitted by the build
+           ;; system.
+           (delete-all-but "3rd-party" "treematch" "Makefile.in" "Makefile.am")
+           ;; Do not install 64 MiB worth fo pre-generated HTML
+           ;; documentation.
+           (delete-file-recursively "docs/html")))
        (sha256
         (base32 "0mw1z4ppnlvxngwd58kl5q26qmvf3bgjkd4r8wjpqis3pky86hdx"))))
 
-- 
2.46.0





      parent reply	other threads:[~2024-11-28  7:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28  6:24 [bug#74572] [PATCH 0/6] ] Python bindings, reduced size for OpenPMIx/OpenMPI Maxim Cournoyer
2024-11-28  7:47 ` [bug#74572] [PATCH 1/6] gnu: openmpi-5: Update to 5.0.6 Maxim Cournoyer
2024-11-28  7:47 ` [bug#74572] [PATCH 2/6] gnu: openpmix: Enable Python bindings Maxim Cournoyer
2024-11-28  7:47 ` [bug#74572] [PATCH 3/6] gnu: openpmix: Fix indentation Maxim Cournoyer
2024-11-28  7:47 ` [bug#74572] [PATCH 4/6] gnu: openpmix: Do not install HTML documentation Maxim Cournoyer
2024-11-28  7:47 ` [bug#74572] [PATCH 5/6] gnu: openmpi-5: Reformat Maxim Cournoyer
2024-11-28  7:47 ` Maxim Cournoyer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=040e8d813af84e53e68c61f747059c229b6b70f5.1732774966.git.maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=74572@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).