guix-commits
[Top][All Lists]
Advanced

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

01/01: python-build-system: Add 'ensure-no-mtimes-pre-1980' phase.


From: Mark H. Weaver
Subject: 01/01: python-build-system: Add 'ensure-no-mtimes-pre-1980' phase.
Date: Thu, 16 Jul 2015 05:51:33 +0000

mhw pushed a commit to branch core-updates
in repository guix.

commit 3bacb7a698435ab87eea24fe1d6d2384ef9b7ee9
Author: Mark H Weaver <address@hidden>
Date:   Thu Jul 16 01:49:39 2015 -0400

    python-build-system: Add 'ensure-no-mtimes-pre-1980' phase.
    
    * guix/build/python-build-system.scm (ensure-no-mtimes-pre-1980):
      New phase.
      (%standard-phases): Add it after 'unpack'.
---
 guix/build/python-build-system.scm |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/guix/build/python-build-system.scm 
b/guix/build/python-build-system.scm
index 26a7254..d008ac2 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2013, 2015 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2013 Andreas Enge <address@hidden>
 ;;; Copyright © 2013 Nikita Karetnikov <address@hidden>
+;;; Copyright © 2015 Mark H Weaver <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -119,10 +120,24 @@ installed with setuptools."
       (rename-file easy-install-pth new-pth))
     #t))
 
+(define* (ensure-no-mtimes-pre-1980 #:rest _)
+  "Ensure that there are no mtimes before 1980-01-02 in the source tree."
+  ;; Rationale: patch-and-repack creates tarballs with timestamps at the POSIX
+  ;; epoch, 1970-01-01 UTC.  This causes problems with Python packages,
+  ;; because Python eggs are ZIP files, and the ZIP format does not support
+  ;; timestamps before 1980.
+  (let ((early-1980 315619200))  ; 1980-01-02 UTC
+    (ftw "." (lambda (file stat flag)
+               (unless (<= early-1980 (stat:mtime stat))
+                 (utime file early-1980 early-1980))
+               #t))
+    #t))
+
 (define %standard-phases
   ;; 'configure' and 'build' phases are not needed.  Everything is done during
   ;; 'install'.
   (modify-phases gnu:%standard-phases
+    (add-after 'unpack 'ensure-no-mtimes-pre-1980 ensure-no-mtimes-pre-1980)
     (delete 'configure)
     (replace 'install install)
     (replace 'check check)



reply via email to

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