[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#72071] [PATCH 1/1] Backup original settings, so they can be restore
From: |
Luca Cirrottola |
Subject: |
[bug#72071] [PATCH 1/1] Backup original settings, so they can be restored before the check phase and patched again before the install phase (since the install-data target depends on this file). |
Date: |
Thu, 25 Jul 2024 14:49:03 +0200 |
---
gnu/packages/maths.scm | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 8116569bca..6787f9bb49 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1729,7 +1729,13 @@ (define-public hdf5-1.8
(("libhdf5hl_fortran_la_LDFLAGS =")
(string-append "libhdf5hl_fortran_la_LDFLAGS = -Wl,-rpath="
(assoc-ref outputs "fortran") "/lib")))))
- (add-after 'configure 'patch-settings
+ (add-after 'configure 'copy-settings
+ (lambda _
+ ;; Backup the original settings (because they are needed as a test
+ ;; reference during the "check" phase) before patching them in the
+ ;; "patch-settings-for-build" phase.
+ (copy-file "src/libhdf5.settings" "libhdf5_settings.orig")))
+ (add-before 'build 'patch-settings-for-build
(lambda _
;; libhdf5.settings contains the full path of the
;; compilers used, and its contents are included in
@@ -1742,7 +1748,19 @@ (define-public hdf5-1.8
;; settings file reproducible.
(("Uname information:.*")
"Uname information: Linux\n"))))
- (add-after 'install 'patch-references
+ (add-before 'check 'restore-settings-for-check
+ (lambda _
+ ;; Swap the file that has been patched in the
+ ;; "patch-settings-for-build" phase with the original one which
+ ;; has been saved in the "copy-settings" phase, so that it can be
+ ;; used as a test reference in the "check" phase.
+ (copy-file "src/libhdf5.settings" "libhdf5_settings.patched")
+ (rename-file "libhdf5_settings.orig" "src/libhdf5.settings")))
+ (add-before 'install 'patch-settings-for-install
+ (lambda _
+ ;; Restore the patched settings file before installation.
+ (rename-file "libhdf5_settings.patched" "src/libhdf5.settings")))
+ (add-after 'install 'patch-references
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((bin (string-append (assoc-ref outputs "out") "/bin"))
(zlib (assoc-ref inputs "zlib")))
--
2.34.1
- [bug#72071] [PATCH 0/2] Fix hdf5-parallel-openmpi, Luca Cirrottola, 2024/07/12
- [bug#72071] [PATCH 1/2] Solve issue https://issues.guix.gnu.org/68313 by updating HDF5 version to 1.14.3 (containing the official fix https://github.com/HDFGroup/hdf5/pull/3421)., Luca Cirrottola, 2024/07/12
- [bug#72071] [PATCH 0/2] Fix hdf5-parallel-openmpi, Ludovic Courtès, 2024/07/19
- [bug#72071] [PATCH 0/1] Split the patch-settings phase into copy-settings, patch-settings-for-build, restore-settings-for-check, patch-settings-for-install, Luca Cirrottola, 2024/07/25
- [bug#72071] [PATCH 1/1] Backup original settings, so they can be restored before the check phase and patched again before the install phase (since the install-data target depends on this file).,
Luca Cirrottola <=
- [bug#72071] [PATCH 0/2] A clean series of patches, Luca Cirrottola, 2024/07/29