[bug#73152,v2,3/6] gnu: nss: Store the package release date in an environment variable.

Message ID 20250506225115.22450-3-ian@retrospec.tv
State New
Headers
Series [bug#73152,v2,1/6] gnu: nspr: Update to 4.36. |

Commit Message

Ian Eure May 6, 2025, 10:51 p.m. UTC
  * gnu/packages/nss.scm (nss): Store the package release date in an environment
variable.

Change-Id: Ic3708c0a32e2fc15b0400e42611735f33839b78b
---
 gnu/packages/nss.scm | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
  

Patch

diff --git a/gnu/packages/nss.scm b/gnu/packages/nss.scm
index ab238330a4..abaee7e980 100644
--- a/gnu/packages/nss.scm
+++ b/gnu/packages/nss.scm
@@ -172,6 +172,13 @@  (define-public nss
                         (target-ppc32?)))
       #:phases
       #~(modify-phases %standard-phases
+          ;; The "PayPalEE.cert" certificate expires every six months, leading
+          ;; to test failures:
+          ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=609734>.  To work
+          ;; around that, set the time to roughly the release date.
+          (add-after 'unpack 'set-release-date
+            (lambda _
+              (setenv "GUIX_NSS_RELEASE_DATE" "2024-01-23")))
           (replace 'configure
             (lambda _
               (setenv "CC" #$(cc-for-target))
@@ -212,12 +219,12 @@  (define-public nss
                                 (("SOURCE_DIR=.*")
                                  (string-append "SOURCE_DIR=" (getcwd) "/nss\n")))))
 
-                    ;; The "PayPalEE.cert" certificate expires every six months,
-                    ;; leading to test failures:
-                    ;; <https://bugzilla.mozilla.org/show_bug.cgi?id=609734>.  To
-                    ;; work around that, set the time to roughly the release date.
-                    (invoke #$(if (target-64bit?) "faketime" "datefudge")
-                            "2024-01-23" "./nss/tests/all.sh"))
+
+                    (let ((release-date (getenv "GUIX_NSS_RELEASE_DATE")))
+                      (when (string=? "" release-date)
+                        (raise-exception "`GUIX_NSS_RELEASE_DATE' unset"))
+                      (invoke #$(if (target-64bit?) "faketime" "datefudge")
+                              release-date "./nss/tests/all.sh")))
                   (format #t "test suite not run~%"))))
           (replace 'install
             (lambda* (#:key outputs #:allow-other-keys)