guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#28219] [PATCH] gnu: netcdf: Fix reproducibility issue; remove unnee


From: Thomas Danckaert
Subject: [bug#28219] [PATCH] gnu: netcdf: Fix reproducibility issue; remove unneeded references.
Date: Thu, 24 Aug 2017 15:36:03 +0200 (CEST)

Hi,

this patch fixes a reproducibility issue due to the way SOURCE_DATE_EPOCH is treated in netCDF's configure script (`date -u -d ${SOURCE_DATE_EPOCH}` will evaluate to “1st hour of the current day”).

The patch also removes a store reference to the C compiler from libnetcdf.settings.

The other solution would be simply to remove libnetcdf.settings, not sure if anybody relies on this file in Guix.

Thomas
>From e6cfb7e09fbeb97bf6ebb6487cdcf782ca594cc7 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <address@hidden>
Date: Thu, 24 Aug 2017 15:13:02 +0200
Subject: [PATCH] gnu: netcdf: Fix reproducibility issue; remove unneeded
 references.

* gnu/packages/maths.scm (netcdf) [arguments]: Add phase to fix the embedded
  'Configured On' date; truncate reference to compiler store item.
---
 gnu/packages/maths.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 16c61dda9..4c25f77e2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -918,6 +918,21 @@ similar to MATLAB, GNU Octave or SciPy.")
        ("libjpeg" ,libjpeg)))
     (arguments
      `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
+
+       #:phases (modify-phases %standard-phases
+         (add-before 'configure 'fix-source-date
+           (lambda _
+             (substitute* "./configure"
+               (("date -u -d \"\\$\\{SOURCE_DATE_EPOCH\\}\"")
+                "date --date='@0'"))
+             #t))
+         (add-after 'configure 'patch-settings
+           (lambda _
+             (substitute* "libnetcdf.settings"
+               (("(/gnu/store/)([a-Z0-9]*)" all prefix hash)
+                (string-append prefix (string-take hash 10) "...")))
+             #t)))
+
        #:parallel-tests? #f))           ;various race conditions
     (home-page "http://www.unidata.ucar.edu/software/netcdf/";)
     (synopsis "Library for scientific data")
-- 
2.14.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]