diff mbox series

[bug#63044,4/4] gnu: criu: Change timestamps to 1-Jan-1980 before compressing

Message ID 7ae6c1c4c32a5ce24695f7604a9dcba3f6c5974d.1682299133.git.bjc@spork.org
State New
Headers show
Series [bug#63044,1/4] gnu: criu: Use gexps. | expand

Commit Message

Brian Cully April 24, 2023, 1:18 a.m. UTC
The zip library used by bdist in python-setuptools throws an error unless
files are from at least 1980.

 * gnu/packages/virtualization.scm (sssd) [change-file-datetimes]: new phase
---
 gnu/packages/virtualization.scm | 99 ++++++++++++++++++---------------
 1 file changed, 53 insertions(+), 46 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 20cbfcfcfe..910f8b321d 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -141,6 +141,7 @@  (define-module (gnu packages virtualization)
   #:use-module (guix git-download)
   #:use-module (guix gexp)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix modules)
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
@@ -1699,52 +1700,58 @@  (define-public criu
                              (search-input-file %build-inputs
                                                 "/bin/xmlto")))
       #:phases
-      #~(modify-phases %standard-phases
-          (delete 'configure)            ; no configure script
-          (add-after 'unpack 'fix-documentation
-            (lambda* (#:key inputs outputs #:allow-other-keys)
-              (substitute* "Documentation/Makefile"
-                (("-m custom.xsl")
-                 (string-append
-                  "-m custom.xsl --skip-validation -x "
-                  (assoc-ref inputs "docbook-xsl") "/xml/xsl/"
-                  #$(package-name docbook-xsl) "-"
-                  #$(package-version docbook-xsl)
-                  "/manpages/docbook.xsl")))))
-          (add-after 'unpack 'hardcode-variables
-            (lambda* (#:key inputs outputs #:allow-other-keys)
-              ;; Hardcode arm version detection
-              (substitute* "Makefile"
-                (("ARMV.*:=.*") "ARMV := 7\n"))
-              ;; Hard-code the correct PLUGINDIR above.
-              (substitute* "criu/include/plugin.h"
-                (("/var") (string-append (assoc-ref outputs "out"))))
-              ))
-          (add-before 'build 'fix-symlink
-            (lambda* (#:key inputs #:allow-other-keys)
-              ;; The file 'images/google/protobuf/descriptor.proto' points to
-              ;; /usr/include/..., which obviously does not exist.
-              (let* ((file "google/protobuf/descriptor.proto")
-                     (target (string-append "images/" file))
-                     (source (search-input-file
-                              inputs
-                              (string-append "include/" file))))
-                (delete-file target)
-                (symlink source target))))
-          (add-after 'install 'wrap
-            (lambda* (#:key inputs outputs #:allow-other-keys)
-              ;; Make sure 'crit' runs with the correct PYTHONPATH.
-              (let* ((site (string-append #$output "/lib/python"
-                                          #$(version-major+minor
-                                             (package-version python))
-                                          "/site-packages"))
-                     (path (getenv "GUIX_PYTHONPATH")))
-                (wrap-program (string-append #$output "/bin/crit")
-                  `("GUIX_PYTHONPATH" ":" prefix (,site ,path))))))
-          (add-after 'install 'delete-static-libraries
-            ;; Not building/installing these at all doesn't seem to be supported.
-            (lambda _
-              (for-each delete-file (find-files #$output "\\.a$")))))))
+      (with-imported-modules (source-module-closure '((guix utils)))
+        #~(modify-phases %standard-phases
+            (delete 'configure)            ; no configure script
+            (add-after 'unpack 'fix-documentation
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                (substitute* "Documentation/Makefile"
+                  (("-m custom.xsl")
+                   (string-append
+                    "-m custom.xsl --skip-validation -x "
+                    (assoc-ref inputs "docbook-xsl") "/xml/xsl/"
+                    #$(package-name docbook-xsl) "-"
+                    #$(package-version docbook-xsl)
+                    "/manpages/docbook.xsl")))))
+            (add-after 'unpack 'hardcode-variables
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                ;; Hardcode arm version detection
+                (substitute* "Makefile"
+                  (("ARMV.*:=.*") "ARMV := 7\n"))
+                ;; Hard-code the correct PLUGINDIR above.
+                (substitute* "criu/include/plugin.h"
+                  (("/var") (string-append (assoc-ref outputs "out"))))
+                ))
+            (add-before 'build 'fix-symlink
+              (lambda* (#:key inputs #:allow-other-keys)
+                ;; The file 'images/google/protobuf/descriptor.proto' points to
+                ;; /usr/include/..., which obviously does not exist.
+                (let* ((file "google/protobuf/descriptor.proto")
+                       (target (string-append "images/" file))
+                       (source (search-input-file
+                                inputs
+                                (string-append "include/" file))))
+                  (delete-file target)
+                  (symlink source target))))
+            (add-before 'install 'change-file-datetimes
+              (lambda _
+                (use-modules (guix utils))
+                (change-file-timestamps-recursively "./"
+                                                    "1980-01-01 00:00:00")))
+            (add-after 'install 'wrap
+              (lambda* (#:key inputs outputs #:allow-other-keys)
+                ;; Make sure 'crit' runs with the correct PYTHONPATH.
+                (let* ((site (string-append #$output "/lib/python"
+                                            #$(version-major+minor
+                                               (package-version python))
+                                            "/site-packages"))
+                       (path (getenv "GUIX_PYTHONPATH")))
+                  (wrap-program (string-append #$output "/bin/crit")
+                    `("GUIX_PYTHONPATH" ":" prefix (,site ,path))))))
+            (add-after 'install 'delete-static-libraries
+              ;; Not building/installing these at all doesn't seem to be supported.
+              (lambda _
+                (for-each delete-file (find-files #$output "\\.a$"))))))))
     (inputs
      (list protobuf
            python