Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pycryptodome/, dev-python/pycryptodome/files/
Date: Wed, 27 Nov 2019 05:32:42
Message-Id: 1574832741.953aee9c307b4cead26995a66292248de5b97e92.chutzpah@gentoo
1 commit: 953aee9c307b4cead26995a66292248de5b97e92
2 Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
3 AuthorDate: Wed Nov 27 05:31:01 2019 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 27 05:32:21 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=953aee9c
7
8 dev-python/pycryptodome-3.9.4: Bump, add py38, fix tests
9
10 Copyright: Sony Interactive Entertainment Inc.
11 Package-Manager: Portage-2.3.79, Repoman-2.3.18
12 Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
13
14 dev-python/pycryptodome/Manifest | 1 +
15 .../files/pycryptodome-3.9.4-parallel-make.patch | 22 ++++++++++
16 .../files/pycryptodome-3.9.4-tests.patch | 48 ++++++++++++++++++++++
17 dev-python/pycryptodome/pycryptodome-3.9.4.ebuild | 46 +++++++++++++++++++++
18 4 files changed, 117 insertions(+)
19
20 diff --git a/dev-python/pycryptodome/Manifest b/dev-python/pycryptodome/Manifest
21 index 31aadd3a9fb..31352feff6b 100644
22 --- a/dev-python/pycryptodome/Manifest
23 +++ b/dev-python/pycryptodome/Manifest
24 @@ -3,3 +3,4 @@ DIST pycryptodome-3.4.7.tar.gz 6483140 BLAKE2B 02368e2af0a12686cf2e635cca8e2c279
25 DIST pycryptodome-3.6.6.tar.gz 7137656 BLAKE2B 72a3dffa22ca4a90a6515ce0bb6939d4c11aab31793ca330523feb08f6529cbfdf3dee01b1caa4577caed1818c0227961e7f25d855b2dcfb09757beb3e0790b4 SHA512 ce03d9940c23ce59e19bcd795c300dbddeddd49756a4bfcc6933da66dfb8b7bedb8d6eaa2b01727c53e72c8e84dfcab2961d1580a188afa9c9451bd2099bdc61
26 DIST pycryptodome-3.7.3.tar.gz 9285823 BLAKE2B 6f215a3bb0337f5b7469d92bd2d5b5a19ab4e2c6a8f119411c3a5bcdcf93307752d99113866268b5066cceda6470bd0fbe81b1b2f9e30b5e5e569c77ede087f3 SHA512 b5e09c08cd252cad4d76249be84ce29e16a9bba4f2c5e81594c24d9a39df0f3fc67822698497eb9daa4cb6a43311c5d5a2543f187a5d5f801288596c2941f08f
27 DIST pycryptodome-3.8.2.tar.gz 12441359 BLAKE2B 857b77ce23bafe8a296d6fc2402914491818b51142d2a08aa882a0d4e15899bc2b18a6b69ffa904cad406fb3ce8bf029404ea178532cd4580ce118ec03311cd2 SHA512 361909d479b3478b72f2723f2c94cafd4e9d50c2d4156535d217f0566c534dc27435f64e9ba0cdb8215c2c3d3800ad1e0befde95d9999eed481f33f9ed2ba318
28 +DIST pycryptodome-3.9.4.tar.gz 11575825 BLAKE2B c153fe71179d633a5722480c4c42cc133100f524a8ba9d3cd9380b7e172564c276b70b97ef36437fa3a149c418903802f410c9d1807d5d72345dffb0aa568223 SHA512 d99e4e431d77856ce3ae33526984cadf2fa6aa82b1f692a2ad0ae893f6a1e9538e6d71d281578e6bd733a816664d1683364c64441196cbc6ee1278f9d6eac62c
29
30 diff --git a/dev-python/pycryptodome/files/pycryptodome-3.9.4-parallel-make.patch b/dev-python/pycryptodome/files/pycryptodome-3.9.4-parallel-make.patch
31 new file mode 100644
32 index 00000000000..331333533f1
33 --- /dev/null
34 +++ b/dev-python/pycryptodome/files/pycryptodome-3.9.4-parallel-make.patch
35 @@ -0,0 +1,22 @@
36 +diff --git a/setup.py b/setup.py
37 +index 1d70caad..c72f64ff 100644
38 +--- a/setup.py
39 ++++ b/setup.py
40 +@@ -364,7 +364,7 @@ ext_modules = [
41 + Extension("Crypto.Cipher._raw_eksblowfish",
42 + include_dirs=['src/'],
43 + define_macros=[('EKS',None),],
44 +- sources=["src/blowfish.c"]),
45 ++ sources=["src/blowfish_eks.c"]),
46 + Extension("Crypto.Cipher._raw_cast",
47 + include_dirs=['src/'],
48 + sources=["src/CAST.c"]),
49 +@@ -427,7 +427,7 @@ ext_modules = [
50 + # Math
51 + Extension("Crypto.Math._modexp",
52 + include_dirs=['src/'],
53 +- sources=['src/modexp.c', 'src/siphash.c', 'src/modexp_utils.c', 'src/mont.c'],
54 ++ sources=['src/modexp.c', 'src/siphash.c', 'src/modexp_utils.c', 'src/mont_math.c'],
55 + ),
56 + ]
57 +
58
59 diff --git a/dev-python/pycryptodome/files/pycryptodome-3.9.4-tests.patch b/dev-python/pycryptodome/files/pycryptodome-3.9.4-tests.patch
60 new file mode 100644
61 index 00000000000..2cfcaec127d
62 --- /dev/null
63 +++ b/dev-python/pycryptodome/files/pycryptodome-3.9.4-tests.patch
64 @@ -0,0 +1,48 @@
65 +diff --git a/lib/Crypto/SelfTest/Cipher/test_ChaCha20_Poly1305.py b/lib/Crypto/SelfTest/Cipher/test_ChaCha20_Poly1305.py
66 +index a2109891..44d2e532 100644
67 +--- a/lib/Crypto/SelfTest/Cipher/test_ChaCha20_Poly1305.py
68 ++++ b/lib/Crypto/SelfTest/Cipher/test_ChaCha20_Poly1305.py
69 +@@ -626,6 +626,7 @@ class TestVectorsWycheproof(unittest.TestCase):
70 + def __init__(self, wycheproof_warnings):
71 + unittest.TestCase.__init__(self)
72 + self._wycheproof_warnings = wycheproof_warnings
73 ++ self._id = "None"
74 +
75 + def setUp(self):
76 + comps = "Crypto.SelfTest.Cipher.test_vectors.wycheproof".split(".")
77 +diff --git a/lib/Crypto/SelfTest/Cipher/test_EAX.py b/lib/Crypto/SelfTest/Cipher/test_EAX.py
78 +index cdd0e85a..546186d1 100644
79 +--- a/lib/Crypto/SelfTest/Cipher/test_EAX.py
80 ++++ b/lib/Crypto/SelfTest/Cipher/test_EAX.py
81 +@@ -656,6 +656,7 @@ class TestVectorsWycheproof(unittest.TestCase):
82 + def __init__(self, wycheproof_warnings):
83 + unittest.TestCase.__init__(self)
84 + self._wycheproof_warnings = wycheproof_warnings
85 ++ self._id = "None"
86 +
87 + def setUp(self):
88 + comps = "Crypto.SelfTest.Cipher.test_vectors.wycheproof".split(".")
89 +diff --git a/lib/Crypto/SelfTest/Cipher/test_GCM.py b/lib/Crypto/SelfTest/Cipher/test_GCM.py
90 +index e3a7a3da..71ea0d18 100644
91 +--- a/lib/Crypto/SelfTest/Cipher/test_GCM.py
92 ++++ b/lib/Crypto/SelfTest/Cipher/test_GCM.py
93 +@@ -828,6 +828,7 @@ class TestVectorsWycheproof(unittest.TestCase):
94 + unittest.TestCase.__init__(self)
95 + self._wycheproof_warnings = wycheproof_warnings
96 + self._extra_params = extra_params
97 ++ self._id = "None"
98 +
99 + def setUp(self):
100 + comps = "Crypto.SelfTest.Cipher.test_vectors.wycheproof".split(".")
101 +diff --git a/lib/Crypto/SelfTest/Cipher/test_SIV.py b/lib/Crypto/SelfTest/Cipher/test_SIV.py
102 +index 38341e14..ab588adc 100644
103 +--- a/lib/Crypto/SelfTest/Cipher/test_SIV.py
104 ++++ b/lib/Crypto/SelfTest/Cipher/test_SIV.py
105 +@@ -456,6 +456,7 @@ class TestVectorsWycheproof(unittest.TestCase):
106 +
107 + def __init__(self):
108 + unittest.TestCase.__init__(self)
109 ++ self._id = "None"
110 +
111 + def setUp(self):
112 + comps = "Crypto.SelfTest.Cipher.test_vectors.wycheproof".split(".")
113
114 diff --git a/dev-python/pycryptodome/pycryptodome-3.9.4.ebuild b/dev-python/pycryptodome/pycryptodome-3.9.4.ebuild
115 new file mode 100644
116 index 00000000000..00d860e0cd6
117 --- /dev/null
118 +++ b/dev-python/pycryptodome/pycryptodome-3.9.4.ebuild
119 @@ -0,0 +1,46 @@
120 +# Copyright 1999-2019 Gentoo Authors
121 +# Distributed under the terms of the GNU General Public License v2
122 +
123 +EAPI=7
124 +
125 +PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} pypy{,3} )
126 +PYTHON_REQ_USE="threads(+)"
127 +
128 +inherit distutils-r1
129 +
130 +DESCRIPTION="A self-contained cryptographic library for Python"
131 +HOMEPAGE="https://www.pycryptodome.org https://github.com/Legrandin/pycryptodome https://pypi.org/project/pycryptodome/"
132 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
133 +
134 +LICENSE="BSD-2 Unlicense"
135 +SLOT="0"
136 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
137 +IUSE=""
138 +
139 +RDEPEND="dev-libs/gmp:0
140 + virtual/python-cffi[${PYTHON_USEDEP}]
141 + !dev-python/pycrypto"
142 +BDEPEND="${RDEPEND}
143 + dev-python/setuptools[${PYTHON_USEDEP}]"
144 +
145 +PATCHES=(
146 + "${FILESDIR}/pycryptodome-3.9.4-parallel-make.patch"
147 + # https://github.com/Legrandin/pycryptodome/pull/351
148 + "${FILESDIR}/pycryptodome-3.9.4-tests.patch"
149 +)
150 +
151 +python_prepare_all() {
152 + # parallel make fixes
153 + # Multiple targets were compiling the same file, setuptools doesn't
154 + # understand this and you get race conditions where a file gets
155 + # overwritten while it's linking. This makes the files look like separate
156 + # files so this race won't happen
157 + ln src/blowfish.c src/blowfish_eks.c || die
158 + ln src/mont.c src/mont_math.c || die
159 +
160 + distutils-r1_python_prepare_all
161 +}
162 +
163 +python_test() {
164 + esetup.py test -vv
165 +}