guix-commits
[Top][All Lists]
Advanced

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

branch core-updates updated: gnu: python-pycrypto: Fix build with Python


From: guix-commits
Subject: branch core-updates updated: gnu: python-pycrypto: Fix build with Python 3.8.
Date: Sat, 11 Apr 2020 10:06:04 -0400

This is an automated email from the git hooks/post-receive script.

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

The following commit(s) were added to refs/heads/core-updates by this push:
     new 2a2a987  gnu: python-pycrypto: Fix build with Python 3.8.
2a2a987 is described below

commit 2a2a9878682e4d959633ecab5275397809a1ce3f
Author: Marius Bakke <address@hidden>
AuthorDate: Sat Apr 11 16:04:26 2020 +0200

    gnu: python-pycrypto: Fix build with Python 3.8.
    
    * gnu/packages/patches/python-pycrypto-time-clock.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Adjust accordingly.
    * gnu/packages/python-crypto.scm (python-pycrypto)[source](patches): Add it.
---
 gnu/local.mk                                       |  1 +
 .../patches/python-pycrypto-time-clock.patch       | 23 ++++++++++++++++++++++
 gnu/packages/python-crypto.scm                     |  3 ++-
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index e7e5d00..3f48c46 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1387,6 +1387,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/python2-parameterized-docstring-test.patch      \
   %D%/packages/patches/python-paste-remove-timing-test.patch   \
   %D%/packages/patches/python-pycrypto-CVE-2013-7459.patch     \
+  %D%/packages/patches/python-pycrypto-time-clock.patch                \
   %D%/packages/patches/python2-pygobject-2-gi-info-type-error-domain.patch \
   %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \
   %D%/packages/patches/python-robotframework-honor-source-date-epoch.patch \
diff --git a/gnu/packages/patches/python-pycrypto-time-clock.patch 
b/gnu/packages/patches/python-pycrypto-time-clock.patch
new file mode 100644
index 0000000..9b7a823
--- /dev/null
+++ b/gnu/packages/patches/python-pycrypto-time-clock.patch
@@ -0,0 +1,23 @@
+Drop use of the deprecated time.clock which was removed in Python 3.8.
+
+Adapted from upstream pull request:
+
+https://github.com/dlitz/pycrypto/pull/296
+
+diff --git a/lib/Crypto/Random/_UserFriendlyRNG.py 
b/lib/Crypto/Random/_UserFriendlyRNG.py
+--- a/lib/Crypto/Random/_UserFriendlyRNG.py
++++ b/lib/Crypto/Random/_UserFriendlyRNG.py
+@@ -73,8 +73,11 @@ class _EntropyCollector(object):
+         t = time.time()
+         self._time_es.feed(struct.pack("@I", int(2**30 * (t - floor(t)))))
+ 
+-        # Add the fractional part of time.clock()
+-        t = time.clock()
++        # Add the fractional part of time.process_time()
++        try:
++           t = time.process_time()
++        except AttributeError:
++           t = time.clock()
+         self._clock_es.feed(struct.pack("@I", int(2**30 * (t - floor(t)))))
+ 
+ 
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index 8016030..eb57f2b 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -280,7 +280,8 @@ making them easy to handle and incorporate into other 
protocols.")
      (origin
       (method url-fetch)
       (uri (pypi-uri "pycrypto" version))
-      (patches (search-patches "python-pycrypto-CVE-2013-7459.patch"))
+      (patches (search-patches "python-pycrypto-CVE-2013-7459.patch"
+                               "python-pycrypto-time-clock.patch"))
       (sha256
        (base32
         "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"))))



reply via email to

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